From 94cdea6aaa2a181473c6535b29c1914d4727c356 Mon Sep 17 00:00:00 2001 From: Amolith Date: Mon, 29 Jan 2024 10:52:25 -0500 Subject: [PATCH] delete hyprland vs others --- .../share/dark-mode.d/executable_swap.sh | 19 +++++++++++---- .../share/light-mode.d/executable_swap.sh | 23 +++++++++++++++---- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/dot_local/share/dark-mode.d/executable_swap.sh b/dot_local/share/dark-mode.d/executable_swap.sh index 61e18aa9287329144d7a011b08d997e77556f812..d0bfe443b37e04144a8bb5a1ca7e186c138e0141 100644 --- a/dot_local/share/dark-mode.d/executable_swap.sh +++ b/dot_local/share/dark-mode.d/executable_swap.sh @@ -8,10 +8,21 @@ xrdb -load ~/.Xresources pkill polybar pkill dunst pkill emacs -i3-msg exec "polybar top" -i3-msg exec "polybar bottom" -i3-msg exec "dunst" -i3-msg exec "emacs --daemon" + +matched=$(hyprctl instances | grep -oE "instance [a-zA-Z0-9]{40}_[a-zA-Z0-9]{10}:") + +if [[ -n $matched ]]; then + hyprctl dispatch exec -- polybar top + hyprctl dispatch exec -- polybar bottom + hyprctl dispatch exec -- dunst + hyprctl dispatch exec -- emacs --daemon +else + i3-msg exec "polybar top" + i3-msg exec "polybar bottom" + i3-msg exec "dunst" + i3-msg exec "emacs --daemon" +fi + unlink ~/.wallpaper.png ln -s ~/Pictures/walls/catppuccin-macchiato.png ~/.wallpaper.png feh --bg-scale ~/.wallpaper.png diff --git a/dot_local/share/light-mode.d/executable_swap.sh b/dot_local/share/light-mode.d/executable_swap.sh index 64c97f71c6e1ca970f647be57d761e402cf17b1d..ed15386e52e5d97898b7a02720b31bf7145a3b38 100644 --- a/dot_local/share/light-mode.d/executable_swap.sh +++ b/dot_local/share/light-mode.d/executable_swap.sh @@ -5,13 +5,26 @@ chezmoi apply xfconf-query -c xsettings -p /Net/ThemeName -s "Catppuccin-Latte-Standard-Rosewater-Light" xrdb -load ~/.Xresources "$XDG_CONFIG_HOME/emacs/bin/doom" sync -pkill polybar + +matched=$(hyprctl instances | grep -oE "instance [a-zA-Z0-9]{40}_[a-zA-Z0-9]{10}:") + pkill dunst pkill emacs -i3-msg exec "polybar top" -i3-msg exec "polybar bottom" -i3-msg exec "dunst" -i3-msg exec "emacs --daemon" +if [[ -n $matched ]]; then + # Within Hyprland + pkill waybar + hyprctl dispatch exec -- waybar + hyprctl dispatch exec -- dunst + hyprctl dispatch exec -- emacs --daemon +else + # Without Hyprland + pkill polybar + i3-msg exec "polybar top" + i3-msg exec "polybar bottom" + i3-msg exec "dunst" + i3-msg exec "emacs --daemon" +fi + unlink ~/.wallpaper.png ln -s ~/Pictures/walls/catppuccin-latte.png ~/.wallpaper.png feh --bg-scale ~/.wallpaper.png