diff --git a/eww/scripts/display-calendar.sh b/eww/scripts/display-calendar.sh deleted file mode 100644 index e7f5eec..0000000 --- a/eww/scripts/display-calendar.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -if [[ $(eww get calendar_state) == "show" ]]; then - eww close calendar - eww update calendar_state="hidden" -else - eww open calendar - eww update calendar_state="show" -fi diff --git a/eww/scripts/get-window.sh b/eww/scripts/get-window.sh index d01e33d..bec309e 100644 --- a/eww/scripts/get-window.sh +++ b/eww/scripts/get-window.sh @@ -3,9 +3,33 @@ ACTIVE_WINDOW=$(hyprctl -j activewindow) WINDOW_TITLE=$(echo $ACTIVE_WINDOW | jq '.title' | sed -e 's/^\"//' -e 's/\"$//') WINDOW_CLASS=$(echo $ACTIVE_WINDOW | jq '.class' | sed -e 's/^\"//' -e 's/\"$//') +WINDOW_NAME="$WINDOW_CLASS: $WINDOW_TITLE" +WINDOW_CHAR_LIMIT="50" + +# Rewrite window names +case $WINDOW_CLASS in + "zen-alpha") + WINDOW_NAME="Zen Browser" + ;; + "firefox" | "org.mozilla.firefox") + WINDOW_NAME="Mozilla Firefox" + ;; +esac + +#case $WINDOW_TITLE in +# "example with window title") # case +# WINDOW_NAME="you just learned!" # statement +# ;; # breaks +#esac + +#case $WINDOW_NAME in +# "example with window name") # case +# WINDOW_NAME="something cool" # statement +# ;; # breaks +#esac if ! [[ $WINDOW_CLASS == "null" ]]; then - echo "$WINDOW_CLASS: $WINDOW_TITLE" + echo "${WINDOW_NAME:0:WINDOW_CHAR_LIMIT}" eww update widget_window_visible=true else echo ""