dotfiles/home/private_dot_config/eww/yuck/widgets.yuck

158 lines
3.4 KiB
Text
Raw Permalink Normal View History

2024-01-22 06:28:52 -06:00
;; Widgets
(defwidget launcher []
(box :class "box-launcher"
:orientation "h"
:hexpand false
(button :class "button-launcher"
:hexpand false
:onclick "${rofi-bin}/launcher.sh"
"")))
(defwidget powermenu []
(box :class "box-launcher"
:orientation "h"
(button :class "button-launcher"
:onclick "${rofi-bin}/powermenu.sh"
"󰐥")))
(defwidget volume []
(box :class "sysinfo"
:orientation "h"
:space-evenly "false"
(button
:onclick "bin/volume --toggle"
"${volume-icon} ")
(button
:onclick "bin/volume --inc"
:onrightclick "bin/volume --dec"
volume-level )))
(defwidget clock []
(box :class "clock"
:orientation "h"
:space-evenly "false"
(label
:text clocktext
:limit-width 40 )))
2024-05-28 13:22:10 -05:00
2024-01-22 06:28:52 -06:00
(defwidget battery []
(box :orientation "h"
2024-05-28 13:22:10 -05:00
:space-evenly false
:spacing 5
(label
:text '${EWW_BATTERY["BAT0"].status == "Discharging" ? "󰄌" : "󰚥"} ${EWW_BATTERY["BAT0"].capacity}%')
(label
:text '${EWW_BATTERY["BAT0"].capacity < 20 ? "low battery!!!": ""}')))
2024-01-22 06:28:52 -06:00
(defwidget ram []
(box :orientation "h"
2024-05-28 13:22:10 -05:00
(label :text "󰀹 ${round(EWW_RAM.used_mem_perc, 0)}%")))
2024-01-22 06:28:52 -06:00
(defwidget cpu []
(box :orientation "h"
2024-05-28 13:22:10 -05:00
(label :text " ${round(EWW_CPU.avg, 0)}%")))
2024-01-22 06:28:52 -06:00
(defwidget wifi []
(box :class "sysinfo"
:orientation "h"
(label :text '${ ssid=="ethernet" ? "󰈀" : ssid=="" ? "󰖪" : "󰖩"}'
:tooltip ssid)))
(defwidget bluetooth []
(box :class "sysinfo"
:orientation "h"
(button :onclick "${rofi-bin}/bluetooth.sh &"
bluetooth-icon)))
; Composite Widgets
(defwidget sysinfo []
(box :class "sysinfo"
:orientation "h"
2024-05-28 13:22:10 -05:00
:spacing 10
2024-01-22 06:28:52 -06:00
:space-evenly false
(ram)
(cpu)
2024-05-28 13:22:10 -05:00
(battery)))
2024-01-22 06:28:52 -06:00
(defwidget workspaces [screen]
(box :class "workspaces panel"
:orientation "h"
:halign "start"
2024-05-28 13:22:10 -05:00
(workspaces-icons :screen screen)))
2024-01-22 06:28:52 -06:00
(defwidget workspaces-icons [screen]
(box :class "workspaces"
:orientation "h"
:space-evenly false
:halign "center"
:valign "center"
(for ws in "${workspaces[screen]}"
(button
:class "ws-button ${ws.class}"
:onclick "hyprctl dispatch focusworkspaceoncurrentmonitor ${ws.id}"
"${ws.icon}"))))
(defwidget sep []
(box :class "separator"
(label :text "|")))
(defwidget sidestuff [?minimal]
(box :class "sidestuff panel"
:orientation "h"
:space-evenly false
:halign "end"
(box :visible {minimal ? false : true}
:space-evenly false
(bluetooth)
(sep)
(wifi)
(sep)
(volume))
(sep)
(clock)
(powermenu)))
(defwidget leftstuff [screen ?minimal]
(box :class "panel"
:orientation "h"
:halign "start"
:space-evenly false
(launcher)
(sysinfo)
; (ws-layout :screen screen)
;(box :visible {minimal ? false : true}
; :space-evenly false
; (sep)
; (sysinfo)
;; (chord)
;)
))
(defwidget leftstuffmin [screen]
(box :class "panel"
:orientation "h"
:halign "start"
:space-evenly false
(launcher)
(ws-layout :screen screen)))
(defwidget sidestuffmin []
(box :class "sidestuff panel"
:orientation "h"
:space-evenly false
:halign "end"
(clock)
(powermenu)))
(defwidget bar [screen ?minimal]
(centerbox :orientation "h"
:class "bar"
(leftstuff :screen screen :minimal minimal)
(workspaces :screen screen)
(sidestuff :minimal minimal)))