💥 eww(bar/workspaces): fix workspace indicator with a literal script

This commit is contained in:
retrozinndev
2024-12-10 10:41:06 -03:00
parent 75ce9fa8f9
commit cacc59cb8e
41 changed files with 377 additions and 782 deletions
+50 -14
View File
@@ -1,36 +1,72 @@
(defwidget toggle-grid []
(box :class "toggle-grid"
(grid-toggle :class "network"
:icon "󰈀"
:header "Network"
:active true ; This sets if toggle is enabled or not, put condition check here
:body "Connected" ; Generally put state here
:visible true
:max-width 128
:max-height 48
:onclick "notify-send 'Network' 'toggle network with nmcli!'"
:orientation "vertical"
(box :orientation "horizontal"
:class "row"
(grid-toggle :class "network"
:icon "󰈀"
:header "Network"
:active true ; This sets if toggle is enabled or not, put condition check here
:body "Connected" ; Put state here (e.g.: enabled, disabled)
:visible true
:onclick "notify-send 'Network' 'toggle network with nmcli!'"
)
(grid-toggle :class "bluetooth"
:icon "󰂯"
:header "Bluetooth"
:active false
:body "Connected"
:visible true
:onclick "notify-send 'Network' 'toggle network with nmcli!'"
)
(grid-toggle :class "dnd"
:icon "󰍶"
:header "Do Not Disturb"
:active false
:body "Disabled"
:visible true
:onclick "notify-send 'Network' 'toggle network with nmcli!'"
)
)
(box :orientation "horizontal"
:class "row"
:space-evenly false
(grid-toggle :class "airplane"
:icon "󰀝"
:header "Airplane Mode"
:active false
:body "Disabled"
:visible true
:onclick "notify-send 'Network' 'toggle network with nmcli!'"
)
)
)
)
(defwidget grid-toggle [ class onclick active ?icon header body visible max-width max-height ]
(defwidget grid-toggle [ class onclick active ?icon header body visible ]
(eventbox :visible "${visible}"
:onclick "${onclick}"
:class "${class} ${ active ? 'active' : '' }"
:class "grid-toggle ${class} ${ active == true ? 'active' : '' } button"
(box :class "toggle"
:space-evenly false
:orientation "horizontal"
:width 142
:height 52
(label :class "icon"
:visible { icon != "" ? true : false }
:valign "center"
"${icon}")
:text "${icon}")
(box :orientation "vertical"
:space-evenly false
(label :class "header"
"${header}")
:text "${header}"
:xalign 0)
(label :class "body"
"${body}")
:text "${body}"
:xalign 0)
)
)
)