making eww work more like waybar workspaces

This commit is contained in:
Chris Cochrun 2023-10-24 06:17:59 -05:00
parent 789fa95abf
commit a32286fc67
4 changed files with 25 additions and 18 deletions

View file

@ -312,9 +312,9 @@ tooltip label {
} }
.works { .works {
font-size: 14px; font-size: 15px;
font-weight: normal; font-weight: normal;
margin: 2px 0px 0px 0px; margin: 0px 0px 0px 0px;
background-color: rgba(00, 00, 00, 0.0); background-color: rgba(00, 00, 00, 0.0);
padding-left: 5px; padding-left: 5px;
padding-right: 9px; padding-right: 9px;
@ -323,7 +323,7 @@ tooltip label {
.worksbox { .worksbox {
font-size: 14px; font-size: 14px;
padding-left: 15px; padding-left: 15px;
// padding-right: 15px; padding-right: 10px;
background-color: rgba(00, 00, 00, 0.0); background-color: rgba(00, 00, 00, 0.0);
} }

View file

@ -45,7 +45,10 @@
:space-evenly false :space-evenly false
:valign "center" :valign "center"
(for workspace in workspaces (for workspace in workspaces
(button :onclick "hyprctl dispatch workspace ${workspace.id}" :class "works ${workspace.id == current_workspace ? "current_workspace" : ""} ${workspace.windows > 0 ? "occupied_workspace" : "empty_workspace"}" (button
:onclick "hyprctl dispatch workspace ${workspace.id}"
:class "works ${workspace.id == current_workspace ? "current_workspace" : ""} ${workspace.windows > 0 ? "occupied_workspace" : "empty_workspace"}"
:visible {workspace.windows > 0 ? "true" : workspace.id == current_workspace ? "true" : "false"}
"${workspace.id == 1 ? "" : "${workspace.id == 1 ? "" :
workspace.id == 2 ? "" : workspace.id == 2 ? "" :
workspace.id == 3 ? "󰈙" : workspace.id == 3 ? "󰈙" :

View file

@ -1,5 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
hyprctl monitors -j | jq '.[] | select(.focused) | .activeWorkspace.id' active (){
hyprctl monitors -j | jq '.[] | select(.focused) | .activeWorkspace.id'
}
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
active
done
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - |
stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}'

View file

@ -7,5 +7,5 @@ spaces (){
spaces spaces
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
spaces hyprctl workspaces -j
done done