feat: adjust eww var timings and add dynamic mic icon
This commit is contained in:
parent
45b9992bd5
commit
54233a6690
6 changed files with 37 additions and 5 deletions
|
@ -194,9 +194,9 @@
|
|||
|
||||
(eventbox :class "left-part"
|
||||
:cursor "pointer"
|
||||
:onclick "swayosd --input-volume mute-toggle"
|
||||
:onclick "$EWW_PATH/mic.sh toggle-muted"
|
||||
|
||||
(label :text " "
|
||||
(label :text " ${mic_icon} "
|
||||
:class "grid-label"
|
||||
)
|
||||
)
|
||||
|
|
|
@ -56,11 +56,12 @@ fi
|
|||
|
||||
if [[ $1 == "icon" ]]; then
|
||||
while true; do
|
||||
sleep 0.2
|
||||
sleep 0.01
|
||||
get_icon
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ $1 == "set" ]]; then
|
||||
eww update br=$2
|
||||
brightnessctl set $2%
|
||||
fi
|
||||
|
|
30
config/eww/scripts/mic.sh
Executable file
30
config/eww/scripts/mic.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SOURCE="@DEFAULT_SOURCE@"
|
||||
|
||||
is_muted () {
|
||||
pactl get-source-mute $SOURCE | awk '{print $2}'
|
||||
}
|
||||
|
||||
get_icon () {
|
||||
if [[ $(is_muted) == "yes" ]]; then
|
||||
echo " "
|
||||
else
|
||||
echo " "
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ $1 == "icon" ]]; then
|
||||
while true; do
|
||||
sleep 0.01
|
||||
get_icon
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ $1 == "muted" ]]; then
|
||||
is_muted
|
||||
fi
|
||||
|
||||
if [[ $1 == "toggle-muted" ]]; then
|
||||
swayosd --input-volume mute-toggle
|
||||
fi
|
|
@ -23,7 +23,7 @@ icon () {
|
|||
|
||||
if [[ $1 == "icon" ]]; then
|
||||
while true; do
|
||||
sleep 0.2
|
||||
sleep 0.01
|
||||
icon
|
||||
done
|
||||
fi
|
||||
|
|
|
@ -61,7 +61,7 @@ get_vol () {
|
|||
|
||||
if [[ $1 == "icon" ]]; then
|
||||
while true; do
|
||||
sleep 0.2
|
||||
sleep 0.01
|
||||
get_icon
|
||||
done
|
||||
fi
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
(deflisten notif_icon "$EWW_PATH/notif.sh icon")
|
||||
(deflisten heart_icon "tail -f $HOME/.config/.heart")
|
||||
(deflisten mic_icon "$EWW_PATH/mic.sh icon")
|
||||
|
||||
(deflisten volume_icon "$EWW_PATH/volume.sh icon")
|
||||
(defpoll volume :interval "1s" "$EWW_PATH/volume.sh percentage")
|
||||
|
|
Loading…
Reference in a new issue