aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/DarkLight.sh
diff options
context:
space:
mode:
authorJa.KooLit <85185940+JaKooLit@users.noreply.github.com>2025-02-11 00:55:42 +0900
committerGitHub <noreply@github.com>2025-02-11 00:55:42 +0900
commitf4459e7abdf3ad6cf9d78b7f59bbe2524d870886 (patch)
tree71d4c2e071d8ba152b8ee121980c75a56a15ac55 /config/hypr/scripts/DarkLight.sh
parent99dcaf5bf9e77adf0342446012acfd4588cf5738 (diff)
parent90623057bbfd7e9d010cbb316947467884e3b774 (diff)
Merge pull request #549 from JaKooLit/main
main to development
Diffstat (limited to 'config/hypr/scripts/DarkLight.sh')
-rwxr-xr-xconfig/hypr/scripts/DarkLight.sh46
1 files changed, 22 insertions, 24 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
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage