diff --git a/homedir/.config/watchman/init.d/compton b/homedir/.config/watchman/init.d/compton new file mode 100755 index 0000000..cf2dc5f --- /dev/null +++ b/homedir/.config/watchman/init.d/compton @@ -0,0 +1,4 @@ +#!/usr/bin/env watchman + +service_command='/bin/compton' +service_args=( --vsync opengl -f -D 3 -e 1.0 ) diff --git a/homedir/.config/watchman/init.d/dunst b/homedir/.config/watchman/init.d/dunst new file mode 100755 index 0000000..a5e8102 --- /dev/null +++ b/homedir/.config/watchman/init.d/dunst @@ -0,0 +1,4 @@ +#!/usr/bin/env watchman + +#service_respawn='true' +service_command='/usr/bin/dunst' diff --git a/homedir/.config/watchman/init.d/jackd b/homedir/.config/watchman/init.d/jackd new file mode 100755 index 0000000..269ea9b --- /dev/null +++ b/homedir/.config/watchman/init.d/jackd @@ -0,0 +1,4 @@ +#!/bin/env watchman + +service_command='/usr/bin/jackd' +service_args=( -d alsa ) diff --git a/homedir/.config/watchman/init.d/lockd b/homedir/.config/watchman/init.d/lockd new file mode 100755 index 0000000..5216f9d --- /dev/null +++ b/homedir/.config/watchman/init.d/lockd @@ -0,0 +1,30 @@ +#!/usr/bin/env ssm +# vim: ft=sh + +service_respawn='true' +service_command="$HOME/bin/lockd" +service_args=( i3lock-extra -s -o ~/pics/lock.png -g -p ) + +function _lock { + kill -USR1 "$service_pid" +} + +function lock { + status || { + start; sleep 1 + "$0" "$service_name" lock + return "$?" + } + + _lock +} + +function toggle { + if status; then + out=$( "$0" "$service_name" stop 2>&1 ) + notify-send "ssm" "$out" + else + out=$( "$0" "$service_name" start 2>&1 ) + notify-send "ssm" "$out" + fi +} diff --git a/homedir/.config/watchman/init.d/moltenbar b/homedir/.config/watchman/init.d/moltenbar new file mode 100755 index 0000000..af1d72b --- /dev/null +++ b/homedir/.config/watchman/init.d/moltenbar @@ -0,0 +1,21 @@ +#!/usr/bin/env watchman + +#service_respawn='true' +service_command='/home/fbt/bin/moltenbar' + +service_depends_ready=( compton ) + +post_start() { + # Die if the thing didn't start + timer 5 nullexec xdo id -a moltenbar || return 1 + + # Set the layer on which lemonbar resides + xdo above -t $( xdo id -n root ) $( xdo id -a moltenbar ) + + # Set the top badding for bspwm + bspc config top_padding $(( 14 + 9 )) &>/tmp/debug.log +} + +pre_stop() { + bspc config top_padding 0 +} diff --git a/homedir/.config/watchman/init.d/mpc-notify b/homedir/.config/watchman/init.d/mpc-notify new file mode 100755 index 0000000..be7951d --- /dev/null +++ b/homedir/.config/watchman/init.d/mpc-notify @@ -0,0 +1,4 @@ +#!/usr/bin/env watchman + +#service_respawn='true' +service_command="$HOME/bin/mpc-notify" diff --git a/homedir/.config/watchman/init.d/mpd b/homedir/.config/watchman/init.d/mpd new file mode 100755 index 0000000..1b32986 --- /dev/null +++ b/homedir/.config/watchman/init.d/mpd @@ -0,0 +1,8 @@ +#!/usr/bin/env ssm + +service_tmpfiles=( "/run/user/$UID/mpd:dir" ) +# service_respawn=false +service_command='/usr/bin/mpd' +service_args=( --no-daemon -v ) + +post_start() { ready; } diff --git a/homedir/.config/watchman/init.d/privoxy b/homedir/.config/watchman/init.d/privoxy new file mode 100755 index 0000000..f7d4c48 --- /dev/null +++ b/homedir/.config/watchman/init.d/privoxy @@ -0,0 +1,21 @@ +#!/usr/bin/env watchman + +privoxy_configfile="$HOME/.config/privoxy/config" + +service_respawn='true' +service_command='/usr/bin/privoxy' +service_args=( --no-daemon "$privoxy_configfile" ) + +privoxy::configtest() { + "$service_command" --config-test "${service_args[@]}" +} + +restart() { + privoxy::configtest || { + watchman.err "Config test failed, not restarting!" + return 1 + } + + stop + start +} diff --git a/homedir/.config/watchman/init.d/pulseaudio b/homedir/.config/watchman/init.d/pulseaudio new file mode 100755 index 0000000..5d6f041 --- /dev/null +++ b/homedir/.config/watchman/init.d/pulseaudio @@ -0,0 +1,14 @@ +#!/bin/env watchman + +service_depends=( jackd ) + +service_command='/usr/bin/pulseaudio' +service_args=( + --realtime=false + --exit-idle-time=-1 + -L module-jack-sink + -L module-jack-source + -L module-native-protocol-tcp +) + +stop () { "$service_command" -k; } diff --git a/homedir/.config/watchman/init.d/scron b/homedir/.config/watchman/init.d/scron new file mode 100755 index 0000000..db786dd --- /dev/null +++ b/homedir/.config/watchman/init.d/scron @@ -0,0 +1,5 @@ +#!/usr/bin/env ssm + +service_respawn='true' +service_command='/usr/bin/crond' +service_args=( -n -f ~/.config/crontab ) diff --git a/homedir/.config/watchman/init.d/socks b/homedir/.config/watchman/init.d/socks new file mode 100755 index 0000000..29e09d6 --- /dev/null +++ b/homedir/.config/watchman/init.d/socks @@ -0,0 +1,13 @@ +#!/usr/bin/bash + +[[ $PROXY_USER ]] || PROXY_USER='proxy' +[[ $PROXY_HOST ]] || PROXY_HOST='malganis.priv' + +service_respawn=true +service_command=( /usr/bin/ssh -i ~/.ssh/proxy/id_ecdsa -ND 8080 "$PROXY_USER@$PROXY_HOST" ) + +function info { + printf 'Name: %s\n' "$service_name" + printf 'Command: %s\n' "${service_command[*]}" + (( service_respawn )) && printf 'Respawn: yes\n' +} diff --git a/homedir/.config/watchman/init.d/ssh-agent b/homedir/.config/watchman/init.d/ssh-agent new file mode 100755 index 0000000..6a2851b --- /dev/null +++ b/homedir/.config/watchman/init.d/ssh-agent @@ -0,0 +1,4 @@ +#!/usr/bin/env watchman + +service_command='/usr/bin/ssh-agent' +service_args=( -d -a "/tmp/${USER}-ssh-auth.sock" ) diff --git a/homedir/.config/watchman/init.d/sxhkd b/homedir/.config/watchman/init.d/sxhkd new file mode 100755 index 0000000..ae65a18 --- /dev/null +++ b/homedir/.config/watchman/init.d/sxhkd @@ -0,0 +1,5 @@ +#!/usr/bin/env watchman + +service_respawn='true' +service_command='/usr/bin/sxhkd' +service_reload_signal='USR1' diff --git a/homedir/.config/watchman/init.d/syncthing b/homedir/.config/watchman/init.d/syncthing new file mode 100755 index 0000000..2e28477 --- /dev/null +++ b/homedir/.config/watchman/init.d/syncthing @@ -0,0 +1,4 @@ +#!/bin/env watchman + +#service_respawn='true' +service_command='/usr/bin/syncthing' diff --git a/homedir/.config/watchman/init.d/transmission-daemon b/homedir/.config/watchman/init.d/transmission-daemon new file mode 100755 index 0000000..c82abd2 --- /dev/null +++ b/homedir/.config/watchman/init.d/transmission-daemon @@ -0,0 +1,4 @@ +#!/bin/env watchman + +service_command='/usr/bin/transmission-daemon' +service_args=( -f ) diff --git a/homedir/.config/watchman/init.d/ufwd b/homedir/.config/watchman/init.d/ufwd new file mode 100755 index 0000000..b060438 --- /dev/null +++ b/homedir/.config/watchman/init.d/ufwd @@ -0,0 +1,5 @@ +#!/usr/bin/env watchman + +#service_respawn='true' +service_command='/usr/bin/ufwd' +service_args=( -n -c -- -p )