dotfiles/home/.config/eww/panels/power.yuck
Sarthak 7f41cf7a82 replace the old dotfiles with the sakura line rice
The bare $HOME repo is gone. This is now the rice: install.sh, rice-*
scripts in bin/, configs in home/ linked into $HOME, theme templates, st
and the particle wallpaper. Clone to ~/rice and run install.sh.
2026-09-14 19:44:44 +05:30

31 lines
1.8 KiB
Text

;; Power: what the machine is doing, the power profile, and session actions.
(defwindow power
:monitor 0
:geometry (geometry :x "-10px" :y "47px" :width "380px" :anchor "top right")
:stacking "fg"
:wm-ignore true
:resizable false
(box :class "panel" :orientation "v" :space-evenly false
(head :title "Power"
(head-action :glyph "󰍛" :tip "Activity monitor" :onclick "rice-panel close; setsid -f st -c rice-float -e btop"))
(row :glyph "󰍛" :title "CPU"
:value "${power?.cpu?.load ?: 0}%${power?.cpu?.temp != 'null' && power?.cpu?.temp != '' ? ' ' + power.cpu.temp + '°' : ''}")
(row :glyph "󰢮" :title "GPU" :sub {power?.gpu?.vram ?: ""}
:value "${power?.gpu?.load ?: 0}%${power?.gpu?.temp != 'null' && power?.gpu?.temp != '' ? ' ' + power.gpu.temp + '°' : ''}")
(row :glyph "󰘚" :title "Memory" :value "${power?.memory?.used ?: '-'} / ${power?.memory?.total ?: '-'}")
(row :glyph "󰔟" :title "Uptime" :value {power?.uptime ?: ""})
(box :orientation "v" :space-evenly false :visible {arraylength(power?.profiles ?: []) > 0}
(section :text "Power profile")
(box :class "row" :space-evenly true
(for p in {power?.profiles ?: []}
(button :class "pill ${p.active ? 'active' : ''}" :onclick "rice-power profile ${p.name}" {p.label}))))
(sep)
(box :space-evenly true :class "row"
(button :class "media-btn" :tooltip "Lock" :onclick "rice-power lock" "󰌾")
(button :class "media-btn" :tooltip "Suspend" :onclick "rice-power suspend" "󰒲")
(button :class "media-btn" :tooltip "Log out" :onclick "rice-power logout" "󰍃")
(button :class "media-btn" :tooltip "Reboot" :onclick "rice-power reboot" "󰜉")
(button :class "media-btn urgent" :tooltip "Shut down" :onclick "rice-power shutdown" "󰐥"))))