2020-04-29 12:42:07 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Inhibit screen locker when media players are running
|
|
|
|
# Cheap method, add missing players to regex
|
|
|
|
isrunning=1
|
|
|
|
player=`ps -u $USER | grep -Ec "(rhythmbox|totem|mpv|vlc|*mplayer)"`
|
|
|
|
|
|
|
|
if [ "$player" -ge "$isrunning" ]; then
|
2023-06-06 16:16:01 +02:00
|
|
|
if [ "$1" == "-t" ] || [ "$1" == "-f" ]; then
|
2020-04-29 12:42:07 +02:00
|
|
|
dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2023-06-06 16:16:01 +02:00
|
|
|
swaylock -f -C ~/.config/swaylock/config --grace 0 && sleep 0.1
|