eww: Add WIP bluetooth widget
This commit is contained in:
@ -36,6 +36,7 @@
|
||||
:class "bottom"
|
||||
:space-evenly false
|
||||
(vpn)
|
||||
(bluetooth)
|
||||
(speaker)
|
||||
(temperature)
|
||||
(battery)
|
||||
@ -71,9 +72,37 @@
|
||||
(label :text n))
|
||||
)
|
||||
|
||||
(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 bluetooth []
|
||||
(eventbox :onhover "${EWW_CMD} update show_bluetooth=true"
|
||||
:onhoverlost "${EWW_CMD} update show_bluetooth=false"
|
||||
(box :orientation "v"
|
||||
:class "thingy bluetooth ${show_bluetooth ? "active" : ""}"
|
||||
:space-evenly false
|
||||
(revealer :transition "slidedown"
|
||||
:reveal show_bluetooth
|
||||
(box :orientation "v"
|
||||
(button :class "clickable" :onclick "ba lurar" (label :text "LUR"))
|
||||
(button :class "clickable" :onclick "ba högtalare" (label :text "HÖG"))
|
||||
(button :class "clickable" :onclick "ba bluetoothctl disconnect" (label :text "---"))
|
||||
)
|
||||
)
|
||||
(label :text "BLT")
|
||||
(revealer :transition "slideup"
|
||||
:reveal {!show_bluetooth}
|
||||
(label :text "---")
|
||||
)
|
||||
)))
|
||||
|
||||
(defwidget speaker []
|
||||
(eventbox
|
||||
:onhover "${EWW_CMD} update show_volume=true"
|
||||
(eventbox :onhover "${EWW_CMD} update show_volume=true"
|
||||
:onhoverlost "${EWW_CMD} update show_volume=false"
|
||||
(box :orientation "v"
|
||||
:class "thingy volbox ${show_volume ? "active" : ""}"
|
||||
@ -95,14 +124,6 @@
|
||||
)
|
||||
)))
|
||||
|
||||
(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"
|
||||
@ -174,6 +195,7 @@
|
||||
))
|
||||
|
||||
(defvar show_volume false)
|
||||
(defvar show_bluetooth false)
|
||||
|
||||
(defpoll workspaces :interval "1s" "eww-workspaces")
|
||||
(defpoll volume_out :interval "1s" "pamixer --get-volume")
|
||||
|
||||
Reference in New Issue
Block a user