sway: watch-dconf

This commit is contained in:
Cat /dev/Nulo 2023-02-16 15:13:29 -03:00
parent 6e1fd12bf4
commit d991318870
2 changed files with 3 additions and 17 deletions

View file

@ -258,3 +258,4 @@ exec swaync
exec kanshi exec kanshi
exec waybar exec waybar
exec "nm-applet --indicator" exec "nm-applet --indicator"
exec "~/.local/bin/watch-dconf"

View file

@ -2,7 +2,6 @@
. ~/.profile . ~/.profile
dconf_color_path=/org/gnome/desktop/interface/color-scheme dconf_color_path=/org/gnome/desktop/interface/color-scheme
dconf_message_path=/org/gnome/shell/extensions/simple-message/message
switch_helix() { switch_helix() {
sed -i 's/theme = ".*"/theme = "'$1'"/' ~/.config/helix/config.toml sed -i 's/theme = ".*"/theme = "'$1'"/' ~/.config/helix/config.toml
@ -28,23 +27,9 @@ switch_from_dconf() {
switch_from_dconf "$(dconf read "$dconf_color_path")" switch_from_dconf "$(dconf read "$dconf_color_path")"
(dconf watch "$dconf_color_path" | while read -r line; do dconf watch "$dconf_color_path" | while read -r line; do
theme="$(echo "$line" | grep -E "'.*'" | sed "s/'//g")" theme="$(echo "$line" | grep -E "'.*'" | sed "s/'//g")"
test -z "$theme" && continue test -z "$theme" && continue
switch_from_dconf "$theme" switch_from_dconf "$theme"
done) &
update_zeit() {
dconf write "$dconf_message_path" "'$(zeit tracking --no-colors)'"
echo updated zeit
}
update_zeit
(busybox inotifyd - "$ZEIT_DB":c | while read -r; do
update_zeit
done) &
while true; do
sleep 30
update_zeit
done done