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
|
2021-03-15 15:12:32 +01: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
|
|
|
|
|
2021-03-15 15:12:32 +01:00
|
|
|
swaylock -C ~/.config/swaylock/config -f
|