160 lines
4.8 KiB
Plaintext
160 lines
4.8 KiB
Plaintext
;; Bars
|
|
|
|
;; Variables
|
|
(defpoll volume :interval "1s"
|
|
"pactl get-sink-volume $(pactl get-default-sink) | awk '{print $5}' | head -n1")
|
|
|
|
(defpoll time :interval "10s"
|
|
"date '+%H:%M %b %d, %Y'")
|
|
|
|
(defvar logo "")
|
|
|
|
(deflisten music :initial ""
|
|
"playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true")
|
|
|
|
;; workspaces
|
|
;; monitor 0
|
|
(defvar workspace_1_monitor_0 "")
|
|
(defvar workspace_2_monitor_0 "")
|
|
(defvar workspace_3_monitor_0 "")
|
|
(defvar workspace_4_monitor_0 "")
|
|
(defvar workspace_5_monitor_0 "")
|
|
(defvar workspace_6_monitor_0 "")
|
|
(defvar workspace_7_monitor_0 "")
|
|
(defvar workspace_8_monitor_0 "")
|
|
(defvar workspace_9_monitor_0 "")
|
|
|
|
;; monitor 1
|
|
(defvar workspace_1_monitor_1 "")
|
|
(defvar workspace_2_monitor_1 "")
|
|
(defvar workspace_3_monitor_1 "")
|
|
(defvar workspace_4_monitor_1 "")
|
|
(defvar workspace_5_monitor_1 "")
|
|
(defvar workspace_6_monitor_1 "")
|
|
(defvar workspace_7_monitor_1 "")
|
|
(defvar workspace_8_monitor_1 "")
|
|
(defvar workspace_9_monitor_1 "")
|
|
|
|
;; Full Bar
|
|
;; monitor 0
|
|
(defwidget bar0 []
|
|
(centerbox :orientation "h"
|
|
(left_status)
|
|
(workspaces_monitor_0)
|
|
;;(music)
|
|
(right_status)))
|
|
|
|
;; monitor 1
|
|
(defwidget bar1 []
|
|
(centerbox :orientation "h"
|
|
(left_status)
|
|
(workspaces_monitor_1)
|
|
;;(music)
|
|
(right_status)))
|
|
|
|
;; Bar Sections
|
|
;; left
|
|
(defwidget left_status []
|
|
(box :class "left_status" :orientation "h" :space-evenly false :halign "start"
|
|
time))
|
|
|
|
;; right
|
|
(defwidget right_status []
|
|
(box :class "right_status" :orientation "h" :space-evenly false :halign "end"
|
|
(metric :label ""
|
|
:value volume
|
|
:onchange "pactl set-sink-volume $(pactl get-default-sink) {}%")
|
|
(metric :label ""
|
|
:value {EWW_RAM.used_mem_perc}
|
|
:onchange "")
|
|
(metric :label ""
|
|
:value {EWW_CPU.avg}
|
|
:onchange "")
|
|
(button :onclick "echo" "")))
|
|
|
|
;; monitor 0
|
|
(defwidget workspaces_monitor_0 []
|
|
(box :class "workspaces"
|
|
:orientation "h"
|
|
:space-evenly false
|
|
:halign "center"
|
|
:spacing 10
|
|
(button :onclick "scripts/change-workspace.sh 1" "${workspace_1_monitor_0}" )
|
|
(button :onclick "scripts/change-workspace.sh 2" "${workspace_2_monitor_0}" )
|
|
(button :onclick "scripts/change-workspace.sh 3" "${workspace_3_monitor_0}" )
|
|
(button :onclick "scripts/change-workspace.sh 4" "${workspace_4_monitor_0}" )
|
|
(button :onclick "scripts/change-workspace.sh 5" "${workspace_5_monitor_0}" )
|
|
(button :onclick "scripts/change-workspace.sh 6" "${workspace_6_monitor_0}" )
|
|
(button :onclick "scripts/change-workspace.sh 7" "${workspace_7_monitor_0}" )
|
|
(button :onclick "scripts/change-workspace.sh 8" "${workspace_8_monitor_0}" )
|
|
(button :onclick "scripts/change-workspace.sh 9" "${workspace_9_monitor_0}" )))
|
|
|
|
;; monitor 1
|
|
(defwidget workspaces_monitor_1 []
|
|
(box :class "workspaces"
|
|
:orientation "h"
|
|
:space-evenly false
|
|
:halign "center"
|
|
:spacing 10
|
|
(button :onclick "scripts/change-workspace.sh 1" "${workspace_1_monitor_1}" )
|
|
(button :onclick "scripts/change-workspace.sh 2" "${workspace_2_monitor_1}" )
|
|
(button :onclick "scripts/change-workspace.sh 3" "${workspace_3_monitor_1}" )
|
|
(button :onclick "scripts/change-workspace.sh 4" "${workspace_4_monitor_1}" )
|
|
(button :onclick "scripts/change-workspace.sh 5" "${workspace_5_monitor_1}" )
|
|
(button :onclick "scripts/change-workspace.sh 6" "${workspace_6_monitor_1}" )
|
|
(button :onclick "scripts/change-workspace.sh 7" "${workspace_7_monitor_1}" )
|
|
(button :onclick "scripts/change-workspace.sh 8" "${workspace_8_monitor_1}" )
|
|
(button :onclick "scripts/change-workspace.sh 9" "${workspace_9_monitor_1}" )))
|
|
|
|
;; Bar Modules
|
|
(defwidget music []
|
|
(box :class "music"
|
|
:orientation "h"
|
|
:space-evenly false
|
|
:halign "center"
|
|
{music != "" ? "🎵${music}" : ""}))
|
|
|
|
(defwidget metric [label value onchange]
|
|
(box :orientation "h"
|
|
:class "metric"
|
|
:space-evenly false
|
|
(box :class "label" label)
|
|
(scale :min 0
|
|
:max 101
|
|
:active {onchange != ""}
|
|
:value value
|
|
:onchange onchange)))
|
|
|
|
;; logo
|
|
(defwidget logo [text]
|
|
(box :orientation "h"
|
|
:class "logo"
|
|
(scale :min 0
|
|
:max 101)))
|
|
|
|
;; Total Window definitions
|
|
;; monitor 0
|
|
(defwindow bar0
|
|
:monitor 0
|
|
:windowtype "dock"
|
|
:geometry (geometry :x "0%"
|
|
:y "5px"
|
|
:width "98%"
|
|
:height "35px"
|
|
:anchor "top center")
|
|
:exclusive true
|
|
:reserve (struts :side "top" :distance "4%")
|
|
(bar0))
|
|
|
|
;; monitor 1
|
|
(defwindow bar1
|
|
:monitor 1
|
|
:geometry (geometry :x "0%"
|
|
:y "5px"
|
|
:width "98%"
|
|
:height "35px"
|
|
:anchor "top center")
|
|
:exclusive true
|
|
:reserve (struts :side "top" :distance "4%")
|
|
(bar1))
|