💥 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
@@ -1,8 +1,5 @@
(include "widgets/control-center/notification.yuck")
(deflisten json_notification_history :initial "{[]}"
`python ./scripts/notification-watcher.py`)
(defwidget notifications []
(box :class "cc-notifications"
:space-evenly false
@@ -11,7 +8,7 @@
(scroll :class "vertical-scroll"
:hscroll false
:vscroll true
:height 400 ; Adjust according to your screen size
:height 400 ; Adjust according to control center size
:vexpand true
(box :class "notifications"
@@ -49,7 +46,7 @@
"󰒲")
(button :class "clear-all"
:onclick "dunstctl history-clear"
"Clear all ")
"Clear all")
)
)
)
+6 -2
View File
@@ -1,4 +1,5 @@
(deflisten hostname :initial "GNU/Linux"
(defpoll hostname :initial "GNU/Linux"
:interval "24h"
`cat /etc/hostname`)
(defpoll uptime_info :interval "50s"
@@ -13,7 +14,7 @@
:halign "start"
(label :xalign 0
:text " ${hostname}"
:text " ${hostname}"
:class "hostname")
(label :xalign 0
@@ -29,6 +30,9 @@
(button :class "lock"
:onclick "hyprctl dispatch exec hyprlock"
"󰌾")
(button :class "color-picker"
:onclick "sh $HOME/.config/eww/scripts/color-picker.sh"
"󰴱")
(button :class "powermenu"
:onclick "eww close-all; eww open powermenu"
"󰗽")
+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)
)
)
)