smol misc stuff

This commit is contained in:
vib 2021-12-14 14:42:27 +02:00
parent 5fdfd687d6
commit c67200e5ec
3 changed files with 36 additions and 12 deletions

View file

@ -1,16 +1,34 @@
#!/bin/sh
if [ -z "`pgrep -x $1`" ]; then
$@ &
if [ "$1" = mpd ]; then
sleep 1
mpd-mpris &
mpd-rpc --no-idle --dont-broadcast-the-paused-state &
mpdscribble &
#those tho will kill themselves when mpd gets killed so we're good
if [ "$1" = "-s" ]; then
if [ "`systemctl is-active $2`" = "active" ]; then
systemctl stop $2
notify-send $2 "process now stopped"
else
systemctl start $2
notify-send $2 "process now active"
fi
elif [ "$1" = "-su" ]; then
if [ "`systemctl --user is-active $2`" = "active" ]; then
systemctl --user stop $2
notify-send $2 "process now stopped"
else
systemctl --user start $2
notify-send $2 "process now active"
fi
notify-send $1 "is now enabled"
else
notify-send $1 "is now disabled"
pkill $1
if [ -z "`pgrep -x $1`" ]; then
$@ &
if [ "$1" = mpd ]; then
sleep 1
#mpd-mpris &
mpd-rpc --no-idle --dont-broadcast-the-paused-state &
mpdscribble &
#those tho will kill themselves when mpd gets killed so we're good
fi
notify-send $1 "is now enabled"
else
notify-send $1 "is now disabled"
pkill $1
fi
fi