executable_swap.sh

 1#!/usr/bin/env bash
 2
 3sed -i 's/dark/light/g' ~/.config/chezmoi/chezmoi.toml
 4chezmoi apply
 5xfconf-query -c xsettings -p /Net/ThemeName -s "Catppuccin-Latte-Standard-Rosewater-Light"
 6xrdb -load ~/.Xresources
 7"$XDG_CONFIG_HOME/emacs/bin/doom" sync
 8
 9matched=$(hyprctl instances | grep -oE "instance [a-zA-Z0-9]{40}_[a-zA-Z0-9]{10}:")
10
11pkill dunst
12pkill emacs
13if [[ -n $matched ]]; then
14    pkill waybar
15    hyprctl dispatch exec -- waybar
16    hyprctl dispatch exec -- dunst
17    hyprctl dispatch exec -- emacs --daemon
18else
19    pkill polybar
20    i3-msg exec "polybar top"
21    i3-msg exec "polybar bottom"
22    i3-msg exec "dunst"
23    i3-msg exec "emacs --daemon"
24fi
25
26unlink ~/.wallpaper.png
27ln -s ~/Pictures/walls/catppuccin-latte.png ~/.wallpaper.png
28feh --bg-scale ~/.wallpaper.png
29notify-send "Theme switch complete"