2022-08-24 18:17:29 +02:00
|
|
|
(defwidget bar []
|
2022-09-24 13:57:01 +02:00
|
|
|
(centerbox
|
|
|
|
:orientation "v"
|
|
|
|
(box
|
|
|
|
:valign "start"
|
|
|
|
:hexpand false
|
|
|
|
:vexpand false
|
|
|
|
:orientation "v"
|
|
|
|
:space-evenly false
|
2022-08-24 18:17:29 +02:00
|
|
|
)
|
|
|
|
|
2022-09-24 13:57:01 +02:00
|
|
|
(workspaces
|
|
|
|
:halign "center"
|
|
|
|
:vexpand true
|
|
|
|
:hexpand false
|
|
|
|
:orientation "v"
|
|
|
|
)
|
2022-08-24 18:17:29 +02:00
|
|
|
|
|
|
|
(box :valign "end" :hexpand false :vexpand true :orientation "v" :space-evenly false
|
|
|
|
(wifi)
|
2022-09-24 13:57:01 +02:00
|
|
|
(do-not-disturb)
|
2022-08-24 18:17:29 +02:00
|
|
|
(volume)
|
|
|
|
(battery)
|
|
|
|
(time)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
;; ━━━ BATTERY ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
|
|
(defwidget battery []
|
2022-08-27 23:58:28 +02:00
|
|
|
(eventbox :onclick "eww open batterywindow --toggle"
|
2022-09-24 13:57:01 +02:00
|
|
|
(label
|
|
|
|
:text `${
|
2022-08-28 23:47:34 +02:00
|
|
|
EWW_BATTERY.BAT0.status == "Charging" ? "" :
|
|
|
|
EWW_BATTERY.BAT0.capacity < 10 ? "" :
|
|
|
|
EWW_BATTERY.BAT0.capacity < 20 ? "" :
|
|
|
|
EWW_BATTERY.BAT0.capacity < 30 ? "" :
|
|
|
|
EWW_BATTERY.BAT0.capacity < 40 ? "" :
|
|
|
|
EWW_BATTERY.BAT0.capacity < 50 ? "" :
|
|
|
|
EWW_BATTERY.BAT0.capacity < 60 ? "" :
|
|
|
|
EWW_BATTERY.BAT0.capacity < 70 ? "" :
|
|
|
|
EWW_BATTERY.BAT0.capacity < 80 ? "" :
|
|
|
|
EWW_BATTERY.BAT0.capacity < 90 ? "" : ""
|
|
|
|
}`
|
|
|
|
:class "battery"
|
|
|
|
))
|
2022-08-27 23:58:28 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
(defwidget batterymenu []
|
|
|
|
(box :orientation "v"
|
|
|
|
:class "batterymenu"
|
|
|
|
(label :text "${EWW_BATTERY.BAT0.status}: ${EWW_BATTERY.BAT0.capacity}%")
|
|
|
|
(progress :value "${EWW_BATTERY.BAT0.capacity}" :orientation "h") ; TODO: change class (and color) on low juice
|
2022-08-24 18:17:29 +02:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2022-08-27 23:58:28 +02:00
|
|
|
(defwindow batterywindow
|
|
|
|
:monitor 0
|
|
|
|
:geometry (geometry
|
|
|
|
:x "53px"
|
|
|
|
:y "30px"
|
|
|
|
:anchor "bottom left"
|
|
|
|
)
|
|
|
|
(batterymenu)
|
|
|
|
)
|
|
|
|
|
2022-09-24 13:57:01 +02:00
|
|
|
; ━━━ do-not-disturb ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
|
|
(defvar dnd "")
|
|
|
|
(defwidget do-not-disturb []
|
|
|
|
(eventbox
|
|
|
|
:orientation "h"
|
|
|
|
:halign "center"
|
|
|
|
:space-evenly false
|
|
|
|
:onclick "nohup ./scripts/do-not-disturb.sh &"
|
|
|
|
(label
|
|
|
|
:text {dnd}
|
|
|
|
:class "dnd"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
;; ━━━ WIFI ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
|
|
(defpoll wifi :interval "30s" "./scripts/wifi.sh")
|
|
|
|
|
|
|
|
(defwidget wifi []
|
|
|
|
(box
|
|
|
|
:orientation "h"
|
|
|
|
:halign "center"
|
|
|
|
:space-evenly false
|
|
|
|
(label
|
|
|
|
:text {wifi.icon}
|
|
|
|
:tooltip {wifi.status}
|
|
|
|
:class "wifi"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2022-08-24 18:17:29 +02:00
|
|
|
;; ━━━ VOLUME ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
|
|
(defpoll volume :interval "1s" "./scripts/volume.sh")
|
|
|
|
(defwidget volume []
|
2022-09-24 13:57:01 +02:00
|
|
|
(eventbox
|
|
|
|
:orientation "h"
|
|
|
|
:halign "center"
|
|
|
|
:space-evenly false
|
|
|
|
:onclick "pamixer -t"
|
|
|
|
(label
|
|
|
|
:text {volume.icon}
|
2022-08-24 18:17:29 +02:00
|
|
|
:tooltip "${volume.percent}%"
|
|
|
|
:class "volume"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
;; ━━━ TIME ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
|
|
(defpoll hour :interval "10s" "date +%H")
|
|
|
|
(defpoll minute :interval "10s" "date +%M")
|
|
|
|
(defpoll dateVar :interval "600s" "date '+%A %d.%m.%y'")
|
|
|
|
|
|
|
|
(defwidget time []
|
2022-09-24 13:57:01 +02:00
|
|
|
(eventbox
|
|
|
|
:cursor "hand"
|
|
|
|
:hexpand false
|
|
|
|
:vexpand false
|
2022-08-24 18:17:29 +02:00
|
|
|
:tooltip "${dateVar}"
|
2022-08-27 23:58:28 +02:00
|
|
|
:onclick "eww open calendar --toggle &"
|
2022-08-24 18:17:29 +02:00
|
|
|
(box :orientation "v" :hexpand false :vexpand false :space-evenly false :class "clock"
|
2022-08-27 23:58:28 +02:00
|
|
|
(label :class "date" :text "${hour}")
|
2022-08-24 18:17:29 +02:00
|
|
|
|
2022-08-27 23:58:28 +02:00
|
|
|
(label :class "date" :text "${minute}")
|
2022-08-24 18:17:29 +02:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2022-08-27 23:58:28 +02:00
|
|
|
;; Calendar
|
|
|
|
(defpoll calendar_day :interval "20h" "date '+%d'")
|
|
|
|
(defpoll calendar_year :interval "20h" "date '+%Y'")
|
|
|
|
(defwidget cal []
|
|
|
|
(box :class "cal" :orientation "v"
|
|
|
|
(box :class "cal-in"
|
|
|
|
(calendar :class "cal"
|
|
|
|
:day calendar_day
|
|
|
|
:year calendar_year))))
|
|
|
|
|
|
|
|
(defwindow calendar
|
|
|
|
:monitor 0
|
|
|
|
:geometry (geometry :x "53px"
|
|
|
|
:y "5px"
|
|
|
|
:anchor "bottom left"
|
|
|
|
:width "270px"
|
|
|
|
:height "60px")
|
|
|
|
(cal))
|
|
|
|
|
2022-08-24 18:17:29 +02:00
|
|
|
(deflisten workspaces_listen "./scripts/workspaces.sh")
|
|
|
|
(defwidget workspaces []
|
|
|
|
(literal :content workspaces_listen))
|
|
|
|
|
|
|
|
(defwindow bar
|
|
|
|
:monitor 0
|
|
|
|
:exclusive false
|
|
|
|
:geometry (geometry :height "1080px" :x "-4px" :y "0px"
|
|
|
|
:width "52px"
|
|
|
|
:anchor "top left")
|
|
|
|
:stacking "fg"
|
|
|
|
(bar))
|