diff --git a/de/home/.config/eww/eww.scss b/de/home/.config/eww/eww.scss index 177774e..49f3da2 100644 --- a/de/home/.config/eww/eww.scss +++ b/de/home/.config/eww/eww.scss @@ -9,7 +9,8 @@ padding: 5px 0px; } .workspaces, -.music { +.music, +.active_window { margin: 10px; } .tray_children { @@ -54,7 +55,8 @@ circular-progress { } .rightgroup>label, .rightgroup>button, -.music { +.music, +.active_window { background-color: $color9; border: 2px solid $color1; color: $color0; @@ -78,6 +80,7 @@ label { color: $color0; // margin: 10px 0px; padding: 5px; + min-width: 25px; } .workspaces button:hover { background-color: $color1; diff --git a/de/home/.config/eww/eww.yuck b/de/home/.config/eww/eww.yuck index 962d9ba..250e991 100644 --- a/de/home/.config/eww/eww.yuck +++ b/de/home/.config/eww/eww.yuck @@ -36,10 +36,10 @@ `${replace(entry.name,".*:","")}`)))) (deflisten active_window_name :initial false - :interval "1s" + :interval "1s" "scripts/activewindow") (defwidget windowtitle [] - (box + (box :class "active_window" {active_window_name})) (defwidget clock [] @@ -110,7 +110,7 @@ (revealer-on-hover :revealvar reveal_tray :revealvar-name "reveal_tray" - "" + {reveal_tray ? "" : ""} (tray_children))) diff --git a/de/home/.config/eww/scripts/activewindow b/de/home/.config/eww/scripts/activewindow index 58ea085..4999fc8 100755 --- a/de/home/.config/eww/scripts/activewindow +++ b/de/home/.config/eww/scripts/activewindow @@ -1,12 +1,16 @@ #!/bin/bash -title_rewrites=("— Alacritty" "") +#declare -A titles +#declare -A icons +titles=(" — Alacritty" " — LibreWolf" " — LibreOffice Calc" " — LibreOffice Writer" " — LibreOffice Draw" " — LibreOffice Math" " - KeePassXC" " — Dolphin") +icons=(" " " " " " " " " " " " " " " ") function get_window_name() { output=$(swaymsg -t get_tree | jq -r '.. | (.nodes? // empty)[] | select(.focused==true).name') - for s in "${title_rewrites[@]}";do - if [[ "${output}" == *"${s}"* ]]; then - output="${output/${s}/}" + for s in "${!titles[@]}";do + if [[ "${output}" == *"${titles[${s}]}"* ]]; then + output="${output/${titles[s]}/}" + output="${icons[${s}]} ${output}" fi done echo $output