aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/WaybarStyles.sh
diff options
context:
space:
mode:
authorJaKooLit <jimmielovejay@gmail.com>2023-10-22 15:55:57 +0900
committerJaKooLit <jimmielovejay@gmail.com>2023-10-22 15:55:57 +0900
commitc222e1bad2ba5e779c3af5b956906c82ead43271 (patch)
treea5253e0861c200ff90354169e1f67ef42ebf0ef9 /config/hypr/scripts/WaybarStyles.sh
parentbb0be21dba7980fc1c047eaba24eda1712bd7f31 (diff)
Initial upload
Diffstat (limited to 'config/hypr/scripts/WaybarStyles.sh')
-rwxr-xr-xconfig/hypr/scripts/WaybarStyles.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/config/hypr/scripts/WaybarStyles.sh b/config/hypr/scripts/WaybarStyles.sh
new file mode 100755
index 00000000..70032443
--- /dev/null
+++ b/config/hypr/scripts/WaybarStyles.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+# Check which waybar theme is set
+THEMEIS=$(realpath ~/.config/waybar/style.css | sed 's/.*-\(.*\)\.css/\1/')
+
+# Change theme
+if [ "$THEMEIS" == "default" ]; then
+ SWITCHTO="-b&w"
+elif [ "$THEMEIS" == "b&w" ]; then
+ SWITCHTO="-rgb"
+elif [ "$THEMEIS" == "rgb" ]; then
+ SWITCHTO="-default_alter"
+elif [ "$THEMEIS" == "default_alter" ]; then
+ SWITCHTO="-mauve"
+elif [ "$THEMEIS" == "mauve" ]; then
+ SWITCHTO="-light"
+elif [ "$THEMEIS" == "light" ]; then
+ SWITCHTO="-dark"
+else
+ SWITCHTO="-default"
+fi
+
+# Set the waybar theme
+THEMEFILE="$HOME/.config/waybar/style/style${SWITCHTO}.css"
+if [ -f "$THEMEFILE" ]; then
+ ln -sf "$THEMEFILE" "$HOME/.config/waybar/style.css"
+
+else
+ echo "Error: $THEMEFILE not found"
+ exit 1
+fi
+
+# Restart waybar
+# Kill already running process
+_ps=(waybar mako dunst)
+for _prs in "${_ps[@]}"; do
+ if [[ $(pidof ${_prs}) ]]; then
+ killall -9 ${_prs}
+ fi
+done
+
+exec ~/.config/hypr/scripts/Refresh.sh
+
+
+
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage