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    # Within Hyprland
15    pkill waybar
16    hyprctl dispatch exec -- waybar
17    hyprctl dispatch exec -- dunst
18    hyprctl dispatch exec -- emacs --daemon
19else
20    # Without Hyprland
21    pkill polybar
22    i3-msg exec "polybar top"
23    i3-msg exec "polybar bottom"
24    i3-msg exec "dunst"
25    i3-msg exec "emacs --daemon"
26fi
27
28unlink ~/.wallpaper.png
29ln -s ~/Pictures/walls/catppuccin-latte.png ~/.wallpaper.png
30feh --bg-scale ~/.wallpaper.png
31notify-send "Theme switch complete"