From c4d6938ca6d225f15f2b04924cafaa07062b54b4 Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" Date: Thu, 16 Nov 2023 15:10:32 +0900 Subject: waybar changes on name, style and script --- config/hypr/scripts/WaybarLayout.sh | 29 ++++-------- config/hypr/scripts/WaybarStyles.sh | 93 +++++++++++++++++-------------------- 2 files changed, 52 insertions(+), 70 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/WaybarLayout.sh b/config/hypr/scripts/WaybarLayout.sh index 15d9195f..dd5fc387 100755 --- a/config/hypr/scripts/WaybarLayout.sh +++ b/config/hypr/scripts/WaybarLayout.sh @@ -4,24 +4,15 @@ CONFIG="$HOME/.config/waybar/configs" WCONFIG="$HOME/.config/waybar/config" menu() { - cat < /dev/null; then - pkill rofi - exit 0 -fi + apply_style "$choice" -# Verify the selected theme -if [[ " ${STYLES[@]} " =~ " $SELECTED_STYLE " ]]; then - SWITCHTO="${SELECTED_STYLE}" -else - echo "Invalid selection" - exit 1 -fi + # Restart relevant processes + for process in waybar mako dunst; do + if pgrep -x "$process" >/dev/null; then + pkill "$process" + fi + done -# APPLY THEME -THEMEFILE="$HOME/.config/waybar/style/${SWITCHTO}.css" -if [ -f "$THEMEFILE" ]; then - ln -sf "$THEMEFILE" "$HOME/.config/waybar/style.css" -else - echo "Error: $THEMEFILE not found" - exit 1 -fi + # Launch Refresh.sh in the background + ~/.config/hypr/scripts/Refresh.sh & +} -# Restart relevant processes -for process in waybar mako dunst; do - if pidof "$process" > /dev/null; then - pkill "$process" - fi -done +# Check if rofi is already running +if pgrep -x "rofi" >/dev/null; then + pkill rofi + exit 0 +fi -exec ~/.config/hypr/scripts/Refresh.sh +main -- cgit v1.2.3