Files
df/tree/.config/eww/eww.yuck
2024-05-07 22:54:24 +02:00

90 lines
2.1 KiB
Plaintext

(defwindow bar0
:monitor 0
:geometry (geometry :y "0%"
:x "3px"
:height "70%"
:width "50px"
:anchor "center left")
:stacking "fg"
:exclusive true
(box :orientation "v"
(workspaces)
(bottom)
))
(defwindow bar1
:monitor 1
:geometry (geometry :y "0%"
:x "3px"
:height "70%"
:width "50px"
:anchor "center left")
:stacking "fg"
:exclusive true
(box :orientation "v"
(workspaces)
(bottom)
))
(defwidget bottom []
(box :orientation "v"
:space-evenly false
:valign "end"
(speaker)
(vpn)
(battery)
(clock)
))
(defwidget workspaces []
(box :orientation "v"
:valign "start"
:class "workspaces"
(for workspace in workspaces_json
(label :class 'workspace ${workspace.class}' :text '${workspace.id}')
)))
(defwidget speaker []
(box :class "volume"
:orientation "v"
:valign "end"
(scale :orientation "v"
:flipped true
:min 0
:max 100
:value volume_out
:onchange "pamixer --set-volume {} && volshow")
))
(defwidget vpn []
(button :valign "end"
:class "vpn boxed ${vpn_status.class}"
:onclick "${vpn_status.on_click}"
(label :text "${vpn_status.icon}")
))
(defwidget battery []
(box :orientation "v"
:valign "end"
:class "battery boxed"
(label :text "BAT")
(label :text "${current_battery}%")
))
(defwidget clock []
(box :orientation "v"
:valign "end"
:class "clock boxed"
(label :text current_hour)
(label :text current_minute)
))
(defpoll workspaces_json :interval "1s" "eww-workspaces")
(defpoll volume_out :interval "1s" "pamixer --get-volume")
(defpoll vpn_status :interval "1s" "mullvad-status")
(defpoll current_minute :interval "1s" "date +%M")
(defpoll current_hour :interval "1s" "date +%H")
(defpoll current_day :interval "60s" "date +%d")
(defpoll current_month :interval "60s" "date +%b")
(defpoll current_battery :interval "15s" "cat /sys/class/power_supply/BAT0/capacity")