New backup 2025-07-24 11:00:03
This commit is contained in:
parent
b22cfccfcd
commit
2f5d0c97cc
3 changed files with 42 additions and 11 deletions
|
@ -59,6 +59,7 @@ $bar-module-border-radius: 8px;
|
||||||
padding: 0px 5px;
|
padding: 0px 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.workspaces>revealer>box>box>button,
|
||||||
.workspaces>box>box>button {
|
.workspaces>box>box>button {
|
||||||
margin: 5px 0px;
|
margin: 5px 0px;
|
||||||
background-color: $bar-module-bg-color;
|
background-color: $bar-module-bg-color;
|
||||||
|
@ -173,7 +174,7 @@ label {
|
||||||
.profile {
|
.profile {
|
||||||
border-radius: $bar-module-border-radius;
|
border-radius: $bar-module-border-radius;
|
||||||
}
|
}
|
||||||
.workspaces button,
|
//.workspaces button,
|
||||||
.leftgroup button {
|
.leftgroup button {
|
||||||
// background-color: $bar-module-bg-color;
|
// background-color: $bar-module-bg-color;
|
||||||
// border-left: 1px solid $bar-module-fg-color;
|
// border-left: 1px solid $bar-module-fg-color;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
(deflisten workspacesArray :initial '[{"name": "placeholder","focused":true,"num":0}]'
|
(deflisten workspacesArray :initial '[{"name": "placeholder","focused":true,"num":0}]'
|
||||||
'scripts/bar/workspaces')
|
'scripts/bar/workspaces')
|
||||||
|
(deflisten activeWorkspace :initial '0'
|
||||||
|
'scripts/bar/active-workspace')
|
||||||
(defvar wsreveal true)
|
(defvar wsreveal true)
|
||||||
|
|
||||||
(defwidget workspaces [array]
|
(defwidget workspaces [array]
|
||||||
|
@ -15,22 +17,36 @@
|
||||||
(box
|
(box
|
||||||
(for entry in array
|
(for entry in array
|
||||||
(literal
|
(literal
|
||||||
:visible {(entry.num < jq(array, '.. | select(.type?) | select(.focused==true).num', 'r')) ? true : false}
|
:visible {(entry.num < activeWorkspace) ? true : false}
|
||||||
:content {(entry.num < jq(array, '.. | select(.type?) | select(.focused==true).num', 'r')) ? "(workspace :ws entry)" : "(box :visible false)"}))))
|
:content {(entry.num < activeWorkspace) ? "(workspace :ws entry)" : "(box :visible false)"}))))
|
||||||
|
(box
|
||||||
|
(for entry in array
|
||||||
|
(literal
|
||||||
|
:visible {entry.focused ? true : false}
|
||||||
|
:content {entry.focused ? "(workspace :ws entry)" : "(box :visible false)"})))
|
||||||
|
(revealer
|
||||||
|
:reveal wsreveal
|
||||||
|
:transition "slideright"
|
||||||
|
:duration "500ms"
|
||||||
|
(box
|
||||||
|
(for entry in array
|
||||||
|
(literal
|
||||||
|
:visible {(entry.num > activeWorkspace) ? true : false}
|
||||||
|
:content {(entry.num > activeWorkspace) ? "(workspace :ws entry)" : "(box :visible false)"}))))))
|
||||||
|
|
||||||
(for entry in array
|
; (for entry in array
|
||||||
; {entry.focused ? (workspace :ws entry) : ""})))
|
; {entry.focused ? (workspace :ws entry) : ""})))
|
||||||
; (for ws in {}
|
; (for ws in {}
|
||||||
(box
|
; (box
|
||||||
; (literal
|
; (literal
|
||||||
; :visible {(entry.num < jq(array, '.. | select(.type?) | select(.focused==true).num', 'r')) ? true : false}
|
; :visible {(entry.num < jq(array, '.. | select(.type?) | select(.focused==true).num', 'r')) ? true : false}
|
||||||
; :content {(entry.num < jq(array, '.. | select(.type?) | select(.focused==true).num', 'r')) ? "(workspace :ws entry)" : "(box :visible false)"})
|
; :content {(entry.num < jq(array, '.. | select(.type?) | select(.focused==true).num', 'r')) ? "(workspace :ws entry)" : "(box :visible false)"})
|
||||||
(literal
|
; (literal
|
||||||
:visible {entry.focused ? true : false}
|
; :visible {entry.focused ? true : false}
|
||||||
:content {entry.focused ? "(workspace :ws entry)" : "(box :visible false)"})
|
; :content {entry.focused ? "(workspace :ws entry)" : "(box :visible false)"})
|
||||||
(literal
|
; (literal
|
||||||
:visible {(entry.num > jq(array, '.. | select(.type?) | select(.focused==true).num', 'r')) ? true : false}
|
; :visible {(entry.num > jq(array, '.. | select(.type?) | select(.focused==true).num')) ? true : false}
|
||||||
:content {(entry.num > jq(array, '.. | select(.type?) | select(.focused==true).num', 'r')) ? "(workspace :ws entry)" : "(box :visible false)"})))))
|
; :content {(entry.num > jq(array, '.. | select(.type?) | select(.focused==true).num')) ? "(workspace :ws entry)" : "(box :visible false)"})))))
|
||||||
|
|
||||||
;; {entry.focused ? "${entry.num}" : ""})))
|
;; {entry.focused ? "${entry.num}" : ""})))
|
||||||
; (button :onclick `swaymsg workspace "${entry.name}"`
|
; (button :onclick `swaymsg workspace "${entry.name}"`
|
||||||
|
|
14
de/home/.config/eww/scripts/bar/active-workspace
Executable file
14
de/home/.config/eww/scripts/bar/active-workspace
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function get_workspaces_info() {
|
||||||
|
output=$(swaymsg -t get_workspaces | jq -r '.. | select(.type?) | select(.focused==true).num')
|
||||||
|
echo $output
|
||||||
|
}
|
||||||
|
|
||||||
|
get_workspaces_info
|
||||||
|
|
||||||
|
swaymsg -t subscribe '["workspace"]' --monitor | {
|
||||||
|
while read -r event; do
|
||||||
|
get_workspaces_info
|
||||||
|
done
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue