forked from Shinonome/dots-hyprland
188 lines
4.6 KiB
Plaintext
Executable File
188 lines
4.6 KiB
Plaintext
Executable File
(defwidget system-menu []
|
|
(eventbox
|
|
:onhoverlost "${EWW_CMD} close system-menu"
|
|
(box
|
|
:class "system-menu-box"
|
|
:space-evenly false
|
|
:orientation "v"
|
|
(box
|
|
:class "module"
|
|
:space-evenly false
|
|
:spacing 5
|
|
:halign "end"
|
|
(syscpu)
|
|
(sysmem)
|
|
(sysbatt)
|
|
(settingscog)
|
|
)
|
|
(box
|
|
:class "top-row"
|
|
:space-evenly false
|
|
(label :class "time" :text "${time.hour}:${time.minute}")
|
|
(box
|
|
:class "date-box"
|
|
:space-evenly false
|
|
(label :class "date" :text "${time.day},")
|
|
(label :class "date" :text "${time.date}")
|
|
)
|
|
)
|
|
|
|
(box
|
|
:class "system-row"
|
|
:space-evenly false
|
|
(box
|
|
:class "wifi-box"
|
|
:space-evenly false
|
|
:orientation "v"
|
|
(box
|
|
:class "element icon"
|
|
:space-evenly false
|
|
(button
|
|
:class "wifi-button"
|
|
:onclick "scripts/net toggle"
|
|
{net.icon}
|
|
)
|
|
(label :class "separator" :text "|")
|
|
(button
|
|
:class "wifi-arrow-btn"
|
|
:onclick "eww close system-menu && nm-connection-editor &"
|
|
""
|
|
)
|
|
)
|
|
(label :text {net.essid} :xalign 0.5 :limit-width 15)
|
|
)
|
|
|
|
(box
|
|
:class "bluetooth-box"
|
|
:space-evenly false
|
|
:orientation "v"
|
|
(box
|
|
:class "element icon"
|
|
:space-evenly false
|
|
(button
|
|
:class "bluetooth-button"
|
|
:onclick "scripts/bluetooth toggle"
|
|
{bluetooth.icon}
|
|
)
|
|
(label :class "separator" :text "|")
|
|
(button
|
|
:class "bluetooth-arrow-btn"
|
|
:onclick "eww close system-menu && blueberry"
|
|
""
|
|
)
|
|
)
|
|
(label
|
|
:text {bluetooth.text}
|
|
:xalign 0.5
|
|
:tooltip "${bluetooth.text} ${bluetooth.batt_icon}"
|
|
:limit-width 15
|
|
)
|
|
)
|
|
|
|
(box
|
|
:class "airplane-box"
|
|
:space-evenly false
|
|
:orientation "v"
|
|
(box
|
|
:class "element"
|
|
(button
|
|
:class "airplane-button"
|
|
:onclick "scripts/airplane toggle"
|
|
airplane
|
|
)
|
|
)
|
|
(label :text "Airplane Mode" :xalign 0.5 :limit-width 16)
|
|
)
|
|
|
|
(box
|
|
:space-evenly false
|
|
:orientation "v"
|
|
(box
|
|
:class "element"
|
|
(button
|
|
:halign "end"
|
|
; :onclick "wlogout -p layer-shell &"
|
|
:onclick "wlogout"
|
|
""
|
|
)
|
|
)
|
|
(label
|
|
:text "Power"
|
|
:xalign 0.5
|
|
:limit-width 16
|
|
)
|
|
)
|
|
)
|
|
(audiolevels)
|
|
(box
|
|
:class "system-info-box"
|
|
|
|
; cpu
|
|
(box
|
|
:class "sys-box"
|
|
:space-evenly false
|
|
:halign "start"
|
|
(circular-progress
|
|
:value "${EWW_CPU.avg}"
|
|
:class "sys-cpu"
|
|
:thickness 3
|
|
(label
|
|
:text ""
|
|
:class "sys-icon-cpu icon"))
|
|
(box
|
|
:orientation "v"
|
|
:vexpand false
|
|
(label
|
|
:text "CPU"
|
|
:halign "start"
|
|
:class "sys-text-cpu")
|
|
(label
|
|
:text "${round(EWW_CPU.avg,2)}%"
|
|
:halign "start"
|
|
:class "sys-text-sub")
|
|
(label
|
|
:text "${EWW_CPU.cores[0].freq} MHz"
|
|
:halign "start"
|
|
:class "sys-text-sub")))
|
|
|
|
; memory
|
|
(box
|
|
:class "sys-box"
|
|
:space-evenly false
|
|
:halign "end"
|
|
(circular-progress
|
|
:value {memory.percentage}
|
|
:class "sys-mem"
|
|
:thickness 3
|
|
(label
|
|
:text ""
|
|
:class "sys-icon-mem icon"
|
|
)
|
|
)
|
|
(box
|
|
:orientation "v"
|
|
(label :text "Memory" :halign "start" :class "sys-text-mem")
|
|
(label :text "${memory.used} / ${memory.total}" :halign "start" :class "sys-text-sub")
|
|
(label :text "Swap ${memory.swapused} / ${memory.swaptotal}" :halign "start" :class "sys-text-sub")
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; windows
|
|
(defwindow system-menu
|
|
:wm-ignore true
|
|
:monitor 0
|
|
; :focusable true
|
|
:geometry (geometry
|
|
:x "0"
|
|
:y "0"
|
|
:width "0%"
|
|
:height "0%"
|
|
:anchor "right top")
|
|
(system-menu)
|
|
)
|
|
|