diff options
| author | ivan-boikov <ik.boikov.public@protonmail.com> | 2024-08-18 22:11:50 +0200 |
|---|---|---|
| committer | ivan-boikov <ik.boikov.public@protonmail.com> | 2024-08-18 22:11:53 +0200 |
| commit | 3423c22a504fafb2225750a361249243a7a5a4ed (patch) | |
| tree | 99eff1fe6b918c04805806addedf0b9d4f94f31d /scripts/.local/bin/theme | |
| parent | 444b73970cc4374d2ae235fd81bbf25cfa514d26 (diff) | |
Forgotten things
Diffstat (limited to 'scripts/.local/bin/theme')
| -rwxr-xr-x | scripts/.local/bin/theme | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/.local/bin/theme b/scripts/.local/bin/theme new file mode 100755 index 0000000..71b5fa2 --- /dev/null +++ b/scripts/.local/bin/theme @@ -0,0 +1,29 @@ +#!/bin/sh + +theme="dark" +oppositetheme="light" +gtktheme="Adwaita-dark" +wallpaper="$XDG_DATA_HOME/wallpapers/space-cat.jpg" +if [ "$1" = "light" ]; then + theme="light" + oppositetheme="dark" + gtktheme="Adwaita" + wallpaper="$XDG_DATA_HOME/wallpapers/abstract.jpg" +fi + +rm "$HOME/.Xresources" && ln -s "$HOME/.Xresources.$theme" "$HOME/.Xresources" && xrdb -merge "$HOME/.Xresources" +echo "Net/ThemeName \"$gtktheme\"" > "$XDG_RUNTIME_DIR/xsettings" +ln -fs "$wallpaper" "$XDG_DATA_HOME/wallpapers/bg" +sed -i "s/background=$oppositetheme/background=$theme/" "$XDG_CONFIG_HOME/nvim/init.vim" +# https://shapeshed.com/vim-tmux-alacritty-theme-switcher/ +tmux list-panes -a -F '#{pane_id} #{pane_current_command}' | + grep vim | + cut -d ' ' -f 1 | + xargs -I PANE tmux send-keys -t PANE ESCAPE \ + ":set background=$theme" ENTER + +setbg +pidof st | xargs kill -s USR1 +pgrep xsettings && pkill xsettingsd +xsettingsd -c "$XDG_RUNTIME_DIR/xsettings" & +sysact "renew dwm" |
