Files
df/tree/.config/eww/eww.yuck

138 lines
3.4 KiB
Plaintext

(defwindow bar0
:monitor 0
:geometry (geometry :y "0%"
:x "3px"
:height "90%"
:width "50px"
:anchor "center left")
:stacking "fg"
:exclusive true
(centerbox :orientation "v"
(workspaces)
(middle)
(bottom)
))
(defwindow bar1
:monitor 1
:geometry (geometry :y "0%"
:x "3px"
:height "90%"
:width "50px"
:anchor "center left")
:stacking "fg"
:exclusive true
(box :orientation "v" :space-evenly: false
(workspaces)
(bottom)
))
(defwidget middle []
(box :orientation "v"
:valign "center"
:space-evenly false
))
(defwidget bottom []
(box :orientation "v"
:valign "end"
:class "bottom"
:space-evenly false
(vpn)
(speaker)
(temperature)
(battery)
(box :class "thingy" (systray :orientation "v"))
(date)
(clock)
))
(defwidget workspaces []
(box :orientation "v"
:valign "start"
:class "workspaces"
:space-evenly: false
(for workspace in workspaces_json
(button :class 'workspace ${workspace.class}' (label :text '${workspace.id}'))
)))
(defwidget speaker []
(eventbox
:onhover "${EWW_CMD} update show_volume=true"
:onhoverlost "${EWW_CMD} update show_volume=false"
(box :orientation "v"
:class "thingy volbox ${show_volume ? "active" : ""}"
:space-evenly false
(revealer :transition "slidedown"
:reveal show_volume
(scale :orientation "v"
:class "volume"
:flipped true
:min 0
:max 100
:value volume_out
:onchange "pamixer --set-volume {} && volshow"
))
(label :text "VOL")
(revealer :transition "slideup"
:reveal {!show_volume}
(label :text volume_out)
)
)))
(defwidget vpn []
(button :valign "end"
:class "vpn thingy ${vpn_status.class}"
:onclick "${vpn_status.on_click}"
:tooltip "${vpn_status.tooltip}"
(label :text "${vpn_status.icon}")
))
(defwidget temperature []
(box :orientation "v"
:valign "end"
:class "battery thingy"
:visible {current_temp != ""}
(label :text "TMP")
(label :text "${current_temp / 1000}C")
))
(defwidget battery []
(box :orientation "v"
:valign "end"
:class "thingy"
:visible {current_battery != ""}
(label :text "BAT")
(label :text "${current_battery}%")
))
(defwidget date []
(tooltip :halign "fill"
(calendar :class "calendar")
(button :onclick "ba gnome-calendar"
:hexpand true
:class "thingy date"
(box :orientation "v"
(label :text current_month)
(label :text current_day)
))))
(defwidget clock []
(box :orientation "v"
:valign "end"
:class "clock thingy"
(label :text current_hour)
(label :text current_minute)
))
(defvar show_volume false)
(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")
(defpoll current_temp :interval "5s" "cat /sys/class/thermal/thermal_zone*/temp")