diff --git a/bin/toggle b/bin/toggle index a646d36..e09a94e 100755 --- a/bin/toggle +++ b/bin/toggle @@ -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 diff --git a/ncmpcpp/config b/ncmpcpp/config index d9b2a3e..3fc18af 100644 --- a/ncmpcpp/config +++ b/ncmpcpp/config @@ -41,7 +41,7 @@ discard_colors_if_item_is_selected = "yes" mpd_host = localhost mpd_port = 6600 mpd_connection_timeout = 5 -mpd_music_dir = /run/media/vibbe/WAD/Music +mpd_music_dir = /mnt/wad/Music execute_on_song_change = notify-send "Now Playing" "$(mpc --format '%title% \n %artist% - %album%' current)" diff --git a/sxhkd/sxhkdrc b/sxhkd/sxhkdrc index 6b667ea..3336d8d 100644 --- a/sxhkd/sxhkdrc +++ b/sxhkd/sxhkdrc @@ -48,6 +48,12 @@ super + ctrl + alt + p toggle picom --experimental-backends super + ctrl + alt + m toggle mpd #(!)The toggle script has custom behaviour for mpd so it also starts `mpd-rpc` and `mpd-mpris` +super + ctrl + alt + v + toggle -s vncserver@:1 +super + ctrl + alt + t + toggle -su opentabletdriver +super + ctrl + alt + b + toggle -s bluetooth ### # MISC