Compare commits

...

8 commits

4 changed files with 75 additions and 11 deletions

View file

@ -0,0 +1,15 @@
#!/usr/bin/env sh
case "$1" in
up)
set -- -i
;;
down)
set -- -d
;;
*)
;;
esac
set -- pamixer "$@" 5
exec "$@"

View file

@ -3,7 +3,6 @@ window, menubar {
}
window {
color: white;
font-weight: bold;
}
@ -15,9 +14,10 @@ window > box > box > * {
border-top: 2px solid white;
}
.workspace-button:hover {
border-color: #80ff80;
color: #e0ffe0;
:hover {
border-color: #b0ffb0;
color: #b0ffb0;
border-top-width: 2px;
}
.workspace-button > box {

View file

@ -24,10 +24,15 @@
)
(deflisten notifications
:initial '{}'
:initial '{"count":0}'
"swaync-client --subscribe"
)
(deflisten sound
:initial '{"output-volume":0,"input-volume":0,"output-muted":false}'
"listen/sound"
)
(defvar battery-icon '{
"unknown": "",
"critical": "",
@ -54,6 +59,13 @@
"dnd": "󰂛"
}')
(defvar sound-icon '{
"absent": "󰕿",
"moderate": "󰖀",
"loud": "󰕾",
"muted": "󰖁"
}')
(defwidget workspaces []
(eventbox :onscroll 'action/hyprland/nearby-workspace "{}"'
(box :class "workspaces"
@ -83,7 +95,11 @@
))
(defwidget time []
"${formattime(EWW_TIME, "%Y-%m-%d")} ${formattime(EWW_TIME, "%H:%M:%S")}"
(box (eventbox
:onclick 'eww open --toggle calendar'
"${formattime(EWW_TIME, "%Y-%m-%d")} ${formattime(EWW_TIME, "%H:%M:%S")}"
))
)
(defwidget notifications []
@ -91,6 +107,7 @@
:class "module"
:onclick 'swaync-client --toggle-panel'
:onrightclick 'swaync-client --toggle-dnd'
:onmiddleclick 'swaync-client --close-all'
"${
notifications.dnd == true
@ -98,18 +115,30 @@
: notifications.count > 0
? notifications-icon["new"]
: notifications-icon["nothing"]
} ${notifications.count}"
} ${notifications.count}"
))
)
; (defwidget sound [] "")
(defwidget sound []
(box (eventbox
:onscroll 'action/volume "{}"'
:onclick 'pavucontrol & disown'
"${
sound.output-muted == true ? sound-icon["muted"] :
sound.output-volume < 33 ? sound-icon["absent"] :
sound.output-volume < 67 ? sound-icon["moderate"] :
sound-icon["loud"]
} ${sound.output-volume} %"
))
)
(defwidget network []
"${
network.state == "wireless"
? network-icon["wifi-${network.wifi.signal}"]
: network-icon[network.state]
} ${
} ${
network.state == "disconnected"
? "no network" :
network.state == "ethernet"
@ -120,7 +149,7 @@
)
(defwidget battery []
"${battery-icon[batterystatus]}${EWW_BATTERY.BAT1.status == "Charging" ? " " : ""} ${EWW_BATTERY.BAT1.capacity} %"
"${battery-icon[batterystatus]}${EWW_BATTERY.BAT1.status == "Charging" ? " " : ""} ${EWW_BATTERY.BAT1.capacity} %"
)
(defwindow bar
@ -155,9 +184,22 @@
:space-evenly false
:class "right"
; (sound)
(sound)
(network)
(battery)
)
)
)
(defwindow calendar
:monitor 0
:geometry (geometry
:anchor "bottom center"
:width "350px"
:height "200px"
)
:exclusive false
; :stacking "fg"
(calendar)
)

View file

@ -0,0 +1,7 @@
#!/usr/bin/env sh
pactl subscribe | grep --line-buffered "'change'" | while read -r _unused; do
printf '{"output-volume":%s,"input-volume":%s,"output-muted":%s}\n' \
"$(pamixer --get-volume)" \
"$(pamixer --get-volume --default-source)" \
"$(pamixer --get-mute)"
done