Improve ewwbar
This commit is contained in:
@ -7,8 +7,9 @@
|
||||
:anchor "center left")
|
||||
:stacking "fg"
|
||||
:exclusive true
|
||||
(box :orientation "v"
|
||||
(centerbox :orientation "v"
|
||||
(workspaces)
|
||||
(middle)
|
||||
(bottom)
|
||||
))
|
||||
|
||||
@ -21,18 +22,27 @@
|
||||
:anchor "center left")
|
||||
:stacking "fg"
|
||||
:exclusive true
|
||||
(box :orientation "v"
|
||||
(box :orientation "v" :space-evenly: false
|
||||
(workspaces)
|
||||
(bottom)
|
||||
))
|
||||
|
||||
(defwidget middle []
|
||||
(box :orientation "v"
|
||||
:space-evenly false
|
||||
:valign "center"
|
||||
))
|
||||
|
||||
(defwidget bottom []
|
||||
(box :orientation "v"
|
||||
:space-evenly false
|
||||
:valign "end"
|
||||
(speaker)
|
||||
(vpn)
|
||||
(speaker)
|
||||
(temperature)
|
||||
(battery)
|
||||
(box :class "boxed" (systray :orientation "v"))
|
||||
(date)
|
||||
(clock)
|
||||
))
|
||||
|
||||
@ -40,37 +50,69 @@
|
||||
(box :orientation "v"
|
||||
:valign "start"
|
||||
:class "workspaces"
|
||||
:space-evenly: false
|
||||
(for workspace in workspaces_json
|
||||
(label :class 'workspace ${workspace.class}' :text '${workspace.id}')
|
||||
(button :class 'workspace ${workspace.class}' (label :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")
|
||||
))
|
||||
(eventbox
|
||||
:onhover "${EWW_CMD} update show_volume=true"
|
||||
:onhoverlost "${EWW_CMD} update show_volume=false"
|
||||
(box :orientation "v"
|
||||
:class "boxed 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 boxed ${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 boxed"
|
||||
(label :text "TMP")
|
||||
(label :text "99C")
|
||||
))
|
||||
|
||||
(defwidget battery []
|
||||
(box :orientation "v"
|
||||
:valign "end"
|
||||
:class "battery boxed"
|
||||
:visible {current_battery != ""}
|
||||
(label :text "BAT")
|
||||
(label :text "${current_battery}%")
|
||||
))
|
||||
|
||||
(defwidget date []
|
||||
(tooltip :class "boxed date" :halign "fill"
|
||||
(calendar :class "calendar")
|
||||
|
||||
(box :orientation "v" :hexpand true
|
||||
(label :text current_month)
|
||||
(label :text current_day)
|
||||
)))
|
||||
|
||||
(defwidget clock []
|
||||
(box :orientation "v"
|
||||
:valign "end"
|
||||
@ -79,6 +121,7 @@
|
||||
(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")
|
||||
|
||||
Reference in New Issue
Block a user