93 lines
3.0 KiB
Plaintext
93 lines
3.0 KiB
Plaintext
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces")
|
|
|
|
(deflisten current_workspace :initial "1" "bash ~/.config/eww/scripts/get-active-workspace")
|
|
|
|
(defwidget workspaces [monitor]
|
|
(eventbox :onscroll "bash ~/.config/eww/scripts/change-active-workspace {} ${current_workspace}" :class "workspaces-widget"
|
|
(box :spacing 10 :orientation "h" :halign "start" :space-evenly false
|
|
(label :text "${workspaces}${current_workspace}" :visible false)
|
|
(for workspace in workspaces
|
|
(box
|
|
:visible {workspace.output == monitor}
|
|
(eventbox :onclick "swaymsg workspace number ${workspace.id}"
|
|
(box :class "workspace-entry ${workspace.focused ? 'current' : ''} ${workspace.urgent ? 'urgent' : ''}"
|
|
(label :text "${workspace.id}"))))))))
|
|
|
|
|
|
(defpoll time :interval "1s"
|
|
"date '+%H:%M'")
|
|
|
|
|
|
(defwidget time-widget []
|
|
(label
|
|
:text {time}
|
|
:class "time-label"))
|
|
|
|
(deflisten BATPERC :initial "" "bash ~/.config/eww/scripts/battery-perc-monitor")
|
|
(deflisten BATICON :initial "" "bash ~/.config/eww/scripts/battery-icon-monitor")
|
|
|
|
(defwidget battery-widget []
|
|
(box :orientation "horizontal" :spacing 0
|
|
(label :text {BATICON} :class "battery-icon")
|
|
(label :text {BATPERC} :class "battery-percent")))
|
|
|
|
(defwidget wifi []
|
|
(label :text wifi-icon
|
|
:class "wifi-icon"))
|
|
(deflisten wifi-icon :initial "" "bash ~/.config/eww/scripts/wifi-monitor")
|
|
(deflisten wifi-name :initial "" "bash ~/.config/eww/scripts/wifi-name-monitor")
|
|
|
|
(deflisten brightness :initial "50" "bash ~/.config/eww/scripts/brightness")
|
|
|
|
(defwidget brightness-widget []
|
|
(eventbox :onscroll "[ {} = up ] && brightnessctl set 5%+ || brightnessctl set 5%-"
|
|
(box :orientation "h" :spacing 0
|
|
(label :text "" :class "brightness-icon")
|
|
(scale :min 0
|
|
:max 100
|
|
:value brightness
|
|
:class "brightness-bar"
|
|
:onchange "brightnessctl set {}%"))))
|
|
|
|
(deflisten volume :initial "50" "bash ~/.config/eww/scripts/volume")
|
|
|
|
(defwidget volume-widget []
|
|
(box :orientation "h" :spacing 0
|
|
(label :text "" :class "volume-icon")
|
|
(scale :min 0
|
|
:max 100
|
|
:value volume
|
|
:class "volume-bar"
|
|
:onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%")))
|
|
|
|
(defwidget system []
|
|
(box :orientation "h" :halign "end" :spacing 0
|
|
(brightness-widget)
|
|
(volume-widget)
|
|
(wifi)
|
|
(battery-widget)
|
|
(time-widget)))
|
|
|
|
|
|
(defwidget bar [monitor]
|
|
(box :orientation "h" :space-evenly false
|
|
(workspaces :monitor monitor)
|
|
(box :hexpand true)
|
|
(system)))
|
|
|
|
(defwindow bar0
|
|
:monitor 0
|
|
:geometry (geometry :x "0%"
|
|
:y "0px"
|
|
:width "100%"
|
|
:height "30px"
|
|
:anchor "top center")
|
|
:stacking "fg"
|
|
:exclusive true
|
|
:reserve (struts :distance "40px" :side "top")
|
|
:windowtype "dock"
|
|
:wm-ignore false
|
|
(bar :monitor "eDP-1"))
|
|
|
|
|