68 lines
1.5 KiB
Plaintext
68 lines
1.5 KiB
Plaintext
(defwindow bar
|
|
:monitor 0
|
|
:geometry (geometry :y "0%"
|
|
:x "10px"
|
|
:height "90%"
|
|
: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)
|
|
(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 ${vpn_status.class}"
|
|
:onclick "${vpn_status.on_click}"
|
|
(label :text '${vpn_status.icon}')
|
|
))
|
|
|
|
(defwidget clock []
|
|
(box :orientation "v"
|
|
:valign "end"
|
|
:class "clock"
|
|
(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")
|