summaryrefslogtreecommitdiff
path: root/.config/eww
diff options
context:
space:
mode:
Diffstat (limited to '.config/eww')
-rw-r--r--.config/eww/eww.yuck16
-rwxr-xr-x.config/eww/scripts/active-workspace-listener22
2 files changed, 18 insertions, 20 deletions
diff --git a/.config/eww/eww.yuck b/.config/eww/eww.yuck
index afcce11..b50fcc0 100644
--- a/.config/eww/eww.yuck
+++ b/.config/eww/eww.yuck
@@ -36,24 +36,24 @@
:stacking "fg"
:exclusive true
:geometry (geometry :width "100%" :height "40px" :anchor "top center")
- (bar))
+ (bar :monitor 0))
(defwindow bar-2
:monitor 1
:stacking "fg"
:exclusive true
:geometry (geometry :width "100%" :height "40px" :anchor "top center")
- (bar))
+ (bar :monitor 1))
;; Widgets
-(defwidget bar []
+(defwidget bar [monitor]
(centerbox
- (start)
+ (start :monitor monitor)
(middle)
(end)))
-(defwidget start []
- (workspaces))
+(defwidget start [monitor]
+ (workspaces :monitor monitor))
(defwidget middle []
(clock))
@@ -70,11 +70,11 @@
(battery)
(user)))
-(defwidget workspaces []
+(defwidget workspaces [monitor]
(box :class "workspaces"
:space-evenly false
(for id in workspace-list
- (button :class {active-workspace == id ? "active" : ""}
+ (button :class {active-workspace[monitor] == id ? "active" : ""}
:onclick `hyprctl dispatch workspace ${id}`
id))))
diff --git a/.config/eww/scripts/active-workspace-listener b/.config/eww/scripts/active-workspace-listener
index 359a0f2..3f57ec5 100755
--- a/.config/eww/scripts/active-workspace-listener
+++ b/.config/eww/scripts/active-workspace-listener
@@ -2,15 +2,13 @@
readonly IPC=/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock
-hyprctl -j activeworkspace | jq -r '.name'
-socat -u UNIX-CONNECT:"$IPC" - | while read -r line
-do
- case "$line" in
- 'workspace>>'*)
- echo "${line#*'>>'}"
- ;;
- 'moveworkspace>>'*)
- hyprctl -j activewindow | jq -r .workspace.name
- ;;
- esac
-done
+{
+ hyprctl -j monitors
+ socat -u UNIX-CONNECT:"$IPC" - | while read -r _
+ do
+ case "${_%>>*}" in
+ workspace|moveworkspace)
+ hyprctl -j monitors
+ esac
+ done
+} | jq -cr '[.[] | .activeWorkspace.name]'