From f4b52e2836c998296becf6e4a9decd1f506b86d9 Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Tue, 14 May 2024 09:40:43 +0200 Subject: [PATCH] eww: Only show workspaces on same monitor --- tree/.config/eww/eww.yuck | 9 +++++---- tree/.local/bin/eww-workspaces | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tree/.config/eww/eww.yuck b/tree/.config/eww/eww.yuck index a1e1149..c8f7061 100644 --- a/tree/.config/eww/eww.yuck +++ b/tree/.config/eww/eww.yuck @@ -6,7 +6,7 @@ :stacking "fg" :exclusive true (centerbox :orientation "v" :active true :class "sidebar" - (workspaces) + (workspaces :monitor 0) (middle) (bottom) )) @@ -19,7 +19,7 @@ :stacking "fg" :exclusive true (centerbox :orientation "v" :active true :class "sidebar" - (workspaces) + (workspaces :monitor 1) (middle) (bottom) )) @@ -45,13 +45,14 @@ (pwr) )) -(defwidget workspaces [] +(defwidget workspaces [monitor] (box :orientation "v" :valign "start" :class "workspaces" :space-evenly: false (for workspace in workspaces_json - (button :class 'workspace ${workspace.class}' (label :text '${workspace.id}')) + (button :visible {workspace.monitor == monitor} :class 'workspace ${workspace.class}' + (label :text '${workspace.id}')) ))) (defwidget speaker [] diff --git a/tree/.local/bin/eww-workspaces b/tree/.local/bin/eww-workspaces index 652ee73..06206c6 100755 --- a/tree/.local/bin/eww-workspaces +++ b/tree/.local/bin/eww-workspaces @@ -5,6 +5,5 @@ let active = (hyprctl activeworkspace -j | from json | get id) hyprctl workspaces -j | from json | sort-by id | - get id | - each {|id| {id: $id class: (if ($id == $active) {"active"} else {""}) }} | + each {|w| {id: $w.id monitor: $w.monitorID class: (if ($w.id == $active) {"active"} else {""}) }} | to json