tweaks to simplify eww

This commit is contained in:
Chris Cochrun 2023-08-30 10:26:25 -05:00
parent 472ab71a95
commit 8c9d0a03db
5 changed files with 429 additions and 351 deletions

View file

@ -0,0 +1 @@
#!/usr/bin/env bash

18
.config/eww/scripts/wks Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env bash
focused_workspace () {
hyprctl monitors | grep -B 5 "focused: yes" | awk 'NR == 1{print $3}'
}
occupied_workspace () {
hyprctl workspaces
}
case $1 in
fw)
focused_workspace
;;
ow)
occupied_workspace
;;
esac

View file

@ -50,11 +50,11 @@ fi
module() {
#output eww widget
echo "(eventbox :onscroll \"echo {} | sed -e 's/up/-1/g' -e 's/down/+1/g' | xargs hyprctl dispatch workspace\" :valign \"center\" \
(box :class \"works\" :orientation \"h\" :spacing 5 :space-evenly \"false\" :valign \"center\" \
(button :onclick \"hyprctl dispatch workspace 1\" :onrightclick \"hyprctl dispatch workspace 1 && $HOME/.config/hypr/themes/neon/scripts/default_app\" :class \"0$o1$f1\" \"${ic[1]}\") \
(button :onclick \"hyprctl dispatch workspace 2\" :onrightclick \"hyprctl dispatch workspace 2 && $HOME/.config/hypr/themes/neon/scripts/default_app\" :class \"0$o2$f2\" \"${ic[2]}\") \
(button :onclick \"hyprctl dispatch workspace 3\" :onrightclick \"hyprctl dispatch workspace 3 && $HOME/.config/hypr/themes/neon/scripts/default_app\" :class \"0$o3$f3\" \"${ic[3]}\") \
(button :onclick \"hyprctl dispatch workspace 4\" :onrightclick \"hyprctl dispatch workspace 4 && $HOME/.config/hypr/themes/neon/scripts/default_app\" :class \"0$o4$f4\" \"${ic[4]}\") \
(box :class \"works\" :orientation \"h\" :spacing 5 :space-evenly \"false\" :valign \"center\" \
(button :onclick \"hyprctl dispatch workspace 1\" :class \"0$o1$f1\" \"${ic[1]}\") \
(button :onclick \"hyprctl dispatch workspace 2\" :class \"0$o2$f2\" \"${ic[2]}\") \
(button :onclick \"hyprctl dispatch workspace 3\" :class \"0$o3$f3\" \"${ic[3]}\") \
(button :onclick \"hyprctl dispatch workspace 4\" :class \"0$o4$f4\" \"${ic[4]}\") \
)\
)"
}