Compare commits
8 commits
9eb26b34d2
...
a59b589dca
Author | SHA1 | Date | |
---|---|---|---|
a59b589dca | |||
1873b1baf9 | |||
9ea3826c2c | |||
52edd90c6a | |||
7fb809f425 | |||
2253608753 | |||
bc82ad6ece | |||
c17b852b39 |
4 changed files with 75 additions and 11 deletions
15
config/eww-ahrc--laptop/action/volume
Executable file
15
config/eww-ahrc--laptop/action/volume
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env sh
|
||||
case "$1" in
|
||||
up)
|
||||
set -- -i
|
||||
;;
|
||||
down)
|
||||
set -- -d
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
set -- pamixer "$@" 5
|
||||
|
||||
exec "$@"
|
|
@ -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 {
|
||||
|
|
|
@ -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 []
|
||||
(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
|
||||
|
@ -102,7 +119,19 @@
|
|||
))
|
||||
)
|
||||
|
||||
; (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 []
|
||||
"${
|
||||
|
@ -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)
|
||||
)
|
||||
|
|
7
config/eww-ahrc--laptop/listen/sound
Executable file
7
config/eww-ahrc--laptop/listen/sound
Executable 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
|
Loading…
Reference in a new issue