1
0
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:
eoli3n 2023-11-08 16:11:55 +01:00
parent d284a47a54
commit f56bdaa8b8
4 changed files with 12 additions and 8 deletions

@ -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 #!/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) (label :text "${current_workspace}" :visible false)
(for workspace in workspaces (for workspace in workspaces
(eventbox :onclick "swaymsg workspace ${workspace.name}" (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}") (label :text "${workspace.icon}")
) )
) )