mirror of
https://github.com/eoli3n/dotfiles
synced 2024-11-22 15:01:59 +01:00
dynamic sway workspace eww widget without multiscreen
This commit is contained in:
parent
d284a47a54
commit
f56bdaa8b8
@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
swaymsg -t get_workspaces --raw | jq -r '.[] | select(.focused == true) | .name'
|
@ -1,3 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
swaymsg -t get_workspaces --raw | jq -c 'map({name: .name | tostring, output: .output, icon: .name[2:]})'
|
||||
function run() {
|
||||
swaymsg -t get_workspaces --raw | jq -c 'map({name: .name | tostring, output: .output, icon: .name[2:], focused: .focused})'
|
||||
}
|
||||
|
||||
run
|
||||
|
||||
swaymsg -t subscribe '["workspace"]' --monitor | {
|
||||
while read -r; do
|
||||
run
|
||||
done
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
(label :text "${current_workspace}" :visible false)
|
||||
(for workspace in workspaces
|
||||
(eventbox :onclick "swaymsg workspace ${workspace.name}"
|
||||
(box :class "workspace-entry ${workspace.name == current_workspace ? "current" : ""}"
|
||||
(box :class "workspace-entry ${workspace.focused ? "current" : ""}"
|
||||
(label :text "${workspace.icon}")
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user