New backup 2025-03-12 22:15:01
This commit is contained in:
parent
a574a0f4b0
commit
6e1b2ec305
3 changed files with 19 additions and 9 deletions
|
@ -1,8 +1,9 @@
|
||||||
(defpoll inhibit_active :initial false
|
;(defpoll inhibit_active :initial false
|
||||||
:interval "60s"
|
; :interval "60s"
|
||||||
"scripts/bar/inhibit-status")
|
; "scripts/bar/inhibit-status")
|
||||||
|
(defvar inhibit_active false)
|
||||||
|
|
||||||
(defwidget idleinhibit []
|
(defwidget idleinhibit []
|
||||||
(button :onclick {inhibit_active ? 'killall eww-idle-inhibit' : 'systemd-inhibit --what="idle" --mode="block" scripts/bar/eww-idle-inhibit'}
|
(button :onclick {inhibit_active ? 'killall eww-idle-inhibit;eww update inhibit_active=false' : 'systemd-inhibit --what="idle" --mode="block" scripts/bar/eww-idle-inhibit & eww update inhibit_active=true'}
|
||||||
:class {inhibit_active ? "active" : ""}
|
:class {inhibit_active ? "active" : ""}
|
||||||
{inhibit_active ? "" : ""}))
|
{inhibit_active ? "" : ""}))
|
||||||
|
|
|
@ -7,9 +7,8 @@
|
||||||
{(volume == 0) ? "" : ((volume > 50) ? "" : "")})
|
{(volume == 0) ? "" : ((volume > 50) ? "" : "")})
|
||||||
(volume_children)))
|
(volume_children)))
|
||||||
|
|
||||||
(defpoll volume :initial 0
|
(deflisten volume :initial "50"
|
||||||
:interval "60s"
|
"scripts/bar/volume")
|
||||||
"scripts/bar/volume-status")
|
|
||||||
(defwidget volume_children []
|
(defwidget volume_children []
|
||||||
(box :class "reveal_children"
|
(box :class "reveal_children"
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
|
|
|
@ -1,5 +1,15 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
pactl subscribe | awk '/new/ && /sink-input/' while read -r event;do
|
function print_volume() {
|
||||||
echo "test"
|
if [ "$(pactl get-sink-mute @DEFAULT_SINK@)" = "Mute: yes" ]; then
|
||||||
|
echo 0
|
||||||
|
else
|
||||||
|
echo "$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g')"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
print_volume
|
||||||
|
|
||||||
|
pactl subscribe | awk '{ if($0 ~ "new") if($0 ~ "sink-input") {system("echo hi")} }' | while read -r event;do
|
||||||
|
print_volume
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Reference in a new issue