some eww bar cleanup

This commit is contained in:
Nickiel12 2023-10-29 19:20:10 -07:00
parent 083308eb37
commit 34172f0ecb
3 changed files with 43 additions and 38 deletions

View file

@ -4,11 +4,19 @@
//Global Styles
.bar-main {
color: #b0b4bc;
margin: 15px;
padding: 10px;
margin-bottom: 0px;
padding-bottom: 0px;
background-color: rgba(30, 30, 30, 0.9);
color: #FFFFFF;
border-radius: 10;
padding-left: 10px;
padding-right: 10px;
// font: 12px;
// color: #b0b4bc;
// margin: 15px;
// padding: 10px;
// margin-bottom: 0px;
// padding-bottom: 0px;
}
.bar-section {
@ -32,7 +40,7 @@
.regular {
color: #b0b4bc;
padding: 5px;
padding: 8px;
}
.active-workspace {
@ -41,3 +49,11 @@
padding-left: 10px;
padding-right: 10px;
}
.side-stuff {
background-color: rgba(20, 20, 20, 0.9);
color: #FFFFFF;
border-radius: 10;
padding-left: 10px;
padding-right: 10px;
}

View file

@ -1,45 +1,45 @@
(defwidget bar []
(centerbox :orientation "h"
(workspaces :names active-workspaces :current-idx current-workspace)
(workspaces :current-idx current-workspace)
(music)
(info)))
(deflisten active-workspaces :initial "[]" "bash ./scripts/get-workspaces")
(deflisten current-workspace :initial "1" "bash ./scripts/get-active-workspace")
(defwidget workspaces [names current-idx]
(defwidget workspaces [current-idx]
(box
:halign "start"
:hexpand false
:class "bar-main"
:space-evenly true
:spacing "12"
:css "* {margin-left: 20px; margin-right: 20px;}"
(box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "1" ? "active-workspace" : "regular"}
(label :text {names =~ `"1"` ? "" : ""}))
:class {current-idx == "1" ? "active-workspace" : "regular"}
(label :text ""))
(box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "2" ? "active-workspace" : "regular"}
(label :text {names =~ `"2"` ? "" : ""}))
:class {current-idx == "2" ? "active-workspace" : "regular"}
(label :text ""))
(box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "3" ? "active-workspace" : "regular"}
(label :text {names =~ `"3"` ? "" : ""}))
:class {current-idx == "3" ? "active-workspace" : "regular"}
(label :text ""))
(box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "4" ? "active-workspace" : "regular"}
(label :text {names =~ `"4"` ? "" : ""}))
:class {current-idx == "4" ? "active-workspace" : "regular"}
(label :text ""))
(box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "5" ? "active-workspace" : "regular"}
(label :text {names =~ `"5"` ? "" : ""}))
:class {current-idx == "5" ? "active-workspace" : "regular"}
(label :text ""))
(box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "6" ? "active-workspace" : "regular"}
(label :text {names =~ `"6"` ? "" : ""}))
:class {current-idx == "6" ? "active-workspace" : "regular"}
(label :text ""))
(box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "7" ? "active-workspace" : "regular"}
(label :text {names =~ `"7"` ? "" : ""}))
:class {current-idx == "7" ? "active-workspace" : "regular"}
(label :text ""))
(box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "8" ? "active-workspace" : "regular"}
(label :text {names =~ `"8"` ? "" : ""}))
:class {current-idx == "8" ? "active-workspace" : "regular"}
(label :text ""))
(box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "9" ? "active-workspace" : "regular"}
(label :text {names =~ `"9"` ? "" : ""}))))
:class {current-idx == "9" ? "active-workspace" : "regular"}
(label :text ""))))
(defwidget info []
(box

View file

@ -1,11 +0,0 @@
#!/usr/bin/env bash
spaces (){
WORKSPACE_WINDOWS=$(hyprctl workspaces -j | jq 'map({key: .id | tostring, value: .windows}) | from_entries')
seq 1 10 | jq --argjson windows "${WORKSPACE_WINDOWS}" --slurp -Mc 'map(tostring) | map({id: ., windows: ($windows[.]//0)})'
}
spaces
# socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
# spaces
# done