133 lines
3.4 KiB
Text
133 lines
3.4 KiB
Text
(defwidget bar []
|
|
(centerbox :orientation "v" :hexpand false
|
|
(box :valign "start" :hexpand false :vexpand true :orientation "v" :space-evenly false
|
|
(powerbutton)
|
|
)
|
|
|
|
(workspaces :halign "center" :vexpand true :hexpand false :orientation "v")
|
|
|
|
(box :valign "end" :hexpand false :vexpand true :orientation "v" :space-evenly false
|
|
(wifi)
|
|
(volume)
|
|
(battery)
|
|
(time)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; Variables
|
|
; (defvar time false)
|
|
; (defvar cal false)
|
|
|
|
;; ━━━ WIFI ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
(defvar wifi "{}")
|
|
(defpoll wifi :interval "30s" "./scripts/wifi.sh")
|
|
|
|
(defwidget wifi []
|
|
(box :vexpand false :hexpand false :orientation "v"
|
|
(label :text {wifi.icon}
|
|
:limit-width 10
|
|
:tooltip {wifi.status}
|
|
:class "wifi"
|
|
)
|
|
)
|
|
)
|
|
|
|
;; ━━━ BATTERY ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
(defvar battery "{}")
|
|
(defpoll battery :interval "60s" "./scripts/battery.sh")
|
|
|
|
(defwidget battery []
|
|
(label :text {battery.icon}
|
|
:limit-width 10
|
|
:tooltip "${battery.status}: ${battery.percent}"
|
|
:class "battery"
|
|
)
|
|
)
|
|
|
|
;; ━━━ VOLUME ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
(defvar volume "{}")
|
|
(defpoll volume :interval "1s" "./scripts/volume.sh")
|
|
(defwidget volume []
|
|
(eventbox :onclick "pamixer -t"
|
|
(label :text {volume.icon}
|
|
:limit-width 10
|
|
: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 []
|
|
(eventbox :cursor "hand" :hexpand false :vexpand false
|
|
:tooltip "${dateVar}"
|
|
(box :orientation "v" :hexpand false :vexpand false :space-evenly false :class "clock"
|
|
(button :class "date"
|
|
:onclick "" "${hour}")
|
|
|
|
(button :class "date"
|
|
:onclick "" "${minute}")
|
|
)
|
|
)
|
|
)
|
|
|
|
(defwidget powerbutton []
|
|
(eventbox :cursor "hand"
|
|
(button :class "reg-btn powerbutton"
|
|
:onclick "eww open powermenu --toggle &" "")
|
|
)
|
|
)
|
|
(defwidget powermenucontent []
|
|
(box :orientation "h"
|
|
:class "powermenu-container"
|
|
(box :class "shutdown-btn-box"
|
|
:orientation "h"
|
|
(button :class "btn"
|
|
:tooltip "Shutdown"
|
|
:onclick "eww close powermenu && shutdown now"
|
|
"⏻")
|
|
)
|
|
(box :class "reboot-btn-box"
|
|
:orientation "h"
|
|
(button :class "btn"
|
|
:tooltip "Reboot"
|
|
:onclick "eww close powermenu && reboot"
|
|
"")
|
|
)
|
|
(box :class "exit-btn-box"
|
|
:orientation "h"
|
|
(button :class "btn"
|
|
:tooltip "Suspend"
|
|
:onclick "systemctl suspend"
|
|
"⏾")
|
|
)
|
|
)
|
|
)
|
|
|
|
(defwindow powermenu
|
|
:monitor 0
|
|
:geometry (geometry :x "0%"
|
|
:y "0%"
|
|
:width "30%"
|
|
:height "15%"
|
|
:anchor "center center")
|
|
:wm-ignore true
|
|
(powermenucontent))
|
|
|
|
(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))
|