126 lines
3.5 KiB
Text
126 lines
3.5 KiB
Text
(defwidget bar []
|
|
(centerbox :orientation "v"
|
|
(topstuff)
|
|
(centerstuff)
|
|
(bottomstuff)))
|
|
|
|
(defwidget topstuff []
|
|
(box :class "topstuff" :orientation "v" :valign "start"
|
|
(systray)
|
|
(workspaces)))
|
|
|
|
(defwidget centerstuff []
|
|
(box :class "centerstuff" :orientation "v" :valign "center"
|
|
;(label :text windowtitle)
|
|
))
|
|
|
|
(defwidget bottomstuff []
|
|
(box :class "bottomstuff" :orientation "v" :valign "end"
|
|
;(backlight)
|
|
(volume :volume {3})
|
|
(battery :capacity {EWW_BATTERY.BAT0.capacity} :status {EWW_BATTERY.BAT0.status})
|
|
(time)
|
|
(date)
|
|
))
|
|
|
|
(defwidget systray []
|
|
(label :text "st"))
|
|
|
|
(defwidget workspaces []
|
|
(box :class "workspaces"
|
|
:orientation "v"
|
|
:valign "start"
|
|
:spacing 10
|
|
(button :onclick "hyprctl dispatch split-workspace 1" 1)
|
|
(button :onclick "hyprctl dispatch split-workspace 2" 2)
|
|
(button :onclick "hyprctl dispatch split-workspace 3" 3)
|
|
(button :onclick "hyprctl dispatch split-workspace 4" 4)
|
|
(button :onclick "hyprctl dispatch split-workspace 5" 5)
|
|
(button :onclick "hyprctl dispatch split-workspace 6" 6)
|
|
(button :onclick "hyprctl dispatch split-workspace 7" 7)
|
|
(button :onclick "hyprctl dispatch split-workspace 8" 8)
|
|
(button :onclick "hyprctl dispatch split-workspace 9" 9)
|
|
(button :onclick "hyprctl dispatch split-workspace 10" 10)))
|
|
|
|
(defwidget volume [volume]
|
|
(box :orientation "v" :class "volume" :valign "center"
|
|
(label :text {
|
|
volume == 0 ? "" :
|
|
volume < 34 ? "" :
|
|
volume < 67 ? "" :
|
|
""
|
|
})
|
|
(label :text volume)))
|
|
|
|
(defwidget battery [capacity status]
|
|
(box :orientation "v" :class "battery" :valign "center" :tooltip {status}
|
|
(label :text {status == 'Charging' ?
|
|
(capacity < 10 ? "" :
|
|
capacity < 20 ? "" :
|
|
capacity < 30 ? "" :
|
|
capacity < 40 ? "" :
|
|
capacity < 50 ? "" :
|
|
capacity < 60 ? "" :
|
|
capacity < 70 ? "" :
|
|
capacity < 80 ? "" :
|
|
capacity < 90 ? "" :
|
|
capacity < 100 ? "" :
|
|
"") :
|
|
(capacity < 10 ? "" :
|
|
capacity < 20 ? "" :
|
|
capacity < 30 ? "" :
|
|
capacity < 40 ? "" :
|
|
capacity < 50 ? "" :
|
|
capacity < 60 ? "" :
|
|
capacity < 70 ? "" :
|
|
capacity < 80 ? "" :
|
|
capacity < 90 ? "" :
|
|
capacity < 100 ? "" :
|
|
"")
|
|
})
|
|
(label :text capacity)))
|
|
|
|
(defwidget time []
|
|
(box :orientation "v" :class "time" :valign "center"
|
|
(label :text "")
|
|
(label :text hour)
|
|
(label :text minute)
|
|
(label :text second)))
|
|
|
|
(defpoll hour :interval "1s"
|
|
"date '+%H'")
|
|
|
|
(defpoll minute :interval "1s"
|
|
"date '+%M'")
|
|
|
|
(defpoll second :interval "1s"
|
|
"date '+%S'")
|
|
|
|
(defwidget date []
|
|
(box :orientation "v" :class "date" :valign "center"
|
|
(label :text "")
|
|
(label :text day)
|
|
(label :text month)
|
|
(label :text year)))
|
|
|
|
(defpoll day :interval "1s"
|
|
"date '+%d'")
|
|
|
|
(defpoll month :interval "1s"
|
|
"date '+%m'")
|
|
|
|
(defpoll year :interval "1s"
|
|
"date '+%y'")
|
|
|
|
(defwindow bar
|
|
:monitor 0
|
|
:windowtype "dock"
|
|
:geometry (geometry :x "0%"
|
|
:y "0%"
|
|
:height "100%"
|
|
:width "20px"
|
|
:anchor "center right")
|
|
:stacking "fg"
|
|
:namespace "eww"
|
|
:exclusive true
|
|
(bar))
|