fixed OSD opening script

This commit is contained in:
Candifloss 2024-12-08 16:02:07 +05:30
parent e1944a24ae
commit 25a5a4e65f
2 changed files with 2 additions and 20 deletions

View File

@ -1,4 +1,4 @@
# OSD opening/closing script # OSD opening/closing script
This script opens the OSD popup, waits for the specified time, and closes the popup window. This script opens the OSD popup, waits for the specified time, and closes the popup window.
If the trigger key(vol, bri, etc.) was pressed again before closing, the timer is stopped and restarted. If the trigger key(vol, bri, etc.) was pressed again before closing, the timer is reset.

View File

@ -1,21 +1,3 @@
#!/bin/bash #!/bin/bash
pidfile="/home/lcm/.config/eww/sh/osd/osd.pid"
osd_id="$1" osd_id="$1"
eww open osd --arg osdtype=$osd_id --id $osd_id --duration 1.4s > /dev/null;
function close() {
sleep 1.4s;
eww close $osd_id 1> /dev/null;
}
active=$(eww active-windows| grep "osd_" | cut -d":" -f1)
if [[ -n "$active" ]]; then
kill $(cat $pidfile);
if [[ "$active" != "$osd_id" ]]; then
echo $active
eww close "$active" 1> /dev/null;
fi;
else
eww open osd --arg osdtype=$osd_id --id $osd_id > /dev/null;
fi;
close & echo $! > $pidfile;