diff options
| author | Ja.KooLit <85185940+JaKooLit@users.noreply.github.com> | 2025-02-11 00:55:42 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-11 00:55:42 +0900 |
| commit | f4459e7abdf3ad6cf9d78b7f59bbe2524d870886 (patch) | |
| tree | 71d4c2e071d8ba152b8ee121980c75a56a15ac55 /config/hypr/scripts | |
| parent | 99dcaf5bf9e77adf0342446012acfd4588cf5738 (diff) | |
| parent | 90623057bbfd7e9d010cbb316947467884e3b774 (diff) | |
Merge pull request #549 from JaKooLit/main
main to development
Diffstat (limited to 'config/hypr/scripts')
| -rwxr-xr-x | config/hypr/scripts/DarkLight.sh | 46 | ||||
| -rwxr-xr-x | config/hypr/scripts/Refresh.sh | 25 |
2 files changed, 33 insertions, 38 deletions
diff --git a/config/hypr/scripts/DarkLight.sh b/config/hypr/scripts/DarkLight.sh index 0ad5e0dc..783fa31a 100755 --- a/config/hypr/scripts/DarkLight.sh +++ b/config/hypr/scripts/DarkLight.sh @@ -20,8 +20,11 @@ wallust_config="$HOME/.config/wallust/wallust.toml" pallete_dark="dark16" pallete_light="light16" -# kill swaybg if running -pkill swaybg +# intial kill process +for pid in kitty waybar rofi swaync ags swaybg; do + killall -SIGUSR1 "$pid" +done + # Initialize swww if needed swww query || swww-daemon --format xrgb @@ -89,14 +92,16 @@ else fi # ags color change -if [ "$next_mode" = "Dark" ]; then - sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(0, 0, 0, 0.4);/' "${ags_style}" - sed -i '/@define-color text-color/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(255, 255, 255, 0.7);/' "${ags_style}" - sed -i '/@define-color noti-bg-alt/s/#.*;/#111111;/' "${ags_style}" -else - sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(255, 255, 255, 0.4);/' "${ags_style}" - sed -i '/@define-color text-color/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(0, 0, 0, 0.7);/' "${ags_style}" - sed -i '/@define-color noti-bg-alt/s/#.*;/#F0F0F0;/' "${ags_style}" +if command -v ags >/dev/null 2>&1; then + if [ "$next_mode" = "Dark" ]; then + sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(0, 0, 0, 0.4);/' "${ags_style}" + sed -i '/@define-color text-color/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(255, 255, 255, 0.7);/' "${ags_style}" + sed -i '/@define-color noti-bg-alt/s/#.*;/#111111;/' "${ags_style}" + else + sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(255, 255, 255, 0.4);/' "${ags_style}" + sed -i '/@define-color text-color/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(0, 0, 0, 0.7);/' "${ags_style}" + sed -i '/@define-color noti-bg-alt/s/#.*;/#F0F0F0;/' "${ags_style}" + fi fi # kitty background color change @@ -110,11 +115,6 @@ else sed -i '/^cursor /s/^cursor .*/cursor #000000/' "${kitty_conf}" fi -for pid in $(pidof kitty); do - kill -SIGUSR1 "$pid" -done - - # Set Dynamic Wallpaper for Dark or Light Mode if [ "$next_mode" = "Dark" ]; then next_wallpaper="$(find "${dark_wallpapers}" -type f \( -iname "*.jpg" -o -iname "*.png" \) -print0 | shuf -n1 -z | xargs -0)" @@ -233,20 +233,18 @@ update_theme_mode ${SCRIPTSDIR}/WallustSwww.sh && -# some process to kill -_ps=(waybar rofi swaync ags swaybg) -for _prs in "${_ps[@]}"; do - if pidof "${_prs}" >/dev/null; then - pkill "${_prs}" - fi +sleep 2 +# kill process +for pid1 in kitty waybar rofi swaync ags swaybg; do + killall "$pid1" done -sleep 2 +sleep 1 ${SCRIPTSDIR}/Refresh.sh -sleep 0.3 +sleep 0.5 # Display notifications for theme and icon changes -notify-send -u normal -i "$notif" " Themes switched to:" " $next_mode Mode" +notify-send -u low -i "$notif" " Themes switched to:" " $next_mode Mode" exit 0 diff --git a/config/hypr/scripts/Refresh.sh b/config/hypr/scripts/Refresh.sh index c8c46695..b041b19b 100755 --- a/config/hypr/scripts/Refresh.sh +++ b/config/hypr/scripts/Refresh.sh @@ -22,33 +22,30 @@ for _prs in "${_ps[@]}"; do fi done -killall -SIGUSR2 waybar # added since wallust sometimes not applying +# added since wallust sometimes not applying +killall -SIGUSR2 waybar +killall -SIGUSR2 swaync # quit ags & relaunch ags -#ags -q && ags & +ags -q && ags & -# Kill waybar & swaync (yet again) # added since wallust sometimes not applying -_ps2=(waybar swaync) -for _prs2 in "${_ps2[@]}"; do - if pidof "${_prs2}" >/dev/null; then - killall "${_prs2}" - fi +# some process to kill +for pid in $(pidof waybar rofi swaync ags swaybg); do + kill -SIGUSR1 "$pid" done -# relaunch swaync -sleep 0.5 -swaync > /dev/null 2>&1 & - #Restart waybar sleep 1 waybar & +# relaunch swaync +sleep 0.5 +swaync > /dev/null 2>&1 & + # Relaunching rainbow borders if the script exists sleep 1 if file_exists "${UserScripts}/RainbowBorders.sh"; then ${UserScripts}/RainbowBorders.sh & fi - - exit 0
\ No newline at end of file |
