From 2de8db566116f7b2e49c559d4ccf832853b42df4 Mon Sep 17 00:00:00 2001 From: Nulo Date: Wed, 4 May 2022 17:09:38 -0300 Subject: [PATCH] zeit-bg-daemon --- .config/river/init | 1 + .local/bin/.zeit-bg-daemon.trigger | 13 +++++++++++++ .local/bin/zeit-bg-daemon | 3 +++ 3 files changed, 17 insertions(+) create mode 100755 .local/bin/.zeit-bg-daemon.trigger create mode 100755 .local/bin/zeit-bg-daemon diff --git a/.config/river/init b/.config/river/init index 5c1b903..3f338ff 100755 --- a/.config/river/init +++ b/.config/river/init @@ -26,4 +26,5 @@ riverctl float-filter-add app-id fzf ~/.config/river/keys riverctl spawn "pgrep -x stacktile >/dev/null || stacktile --per-tag-config --drop-empty-configs --primary-sublayout=stack" +riverctl spawn "killall zeit-bg-daemon ; zeit-bg-daemon" riverctl default-layout stacktile diff --git a/.local/bin/.zeit-bg-daemon.trigger b/.local/bin/.zeit-bg-daemon.trigger new file mode 100755 index 0000000..eb31790 --- /dev/null +++ b/.local/bin/.zeit-bg-daemon.trigger @@ -0,0 +1,13 @@ +#!/bin/sh + +. ~/.cache/themer.lua/shell + +tracking="$(zeit tracking --no-colors)" + +if echo "$tracking" | grep -q '^ ▶ tracking'; then + color="$backgroundish" +else + color="$background" +fi + +riverctl background-color "0x$color" diff --git a/.local/bin/zeit-bg-daemon b/.local/bin/zeit-bg-daemon new file mode 100755 index 0000000..34b5bc0 --- /dev/null +++ b/.local/bin/zeit-bg-daemon @@ -0,0 +1,3 @@ +#!/bin/sh +~/.local/bin/.zeit-bg-daemon.trigger +busybox inotifyd ~/.local/bin/.zeit-bg-daemon.trigger "$ZEIT_DB:c"