fixed OSD opening script
This commit is contained in:
parent
e1944a24ae
commit
25a5a4e65f
@ -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.
|
@ -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;
|
|
||||||
|
Loading…
Reference in New Issue
Block a user