diff --git a/bin/khal_sync.sh b/bin/khal_sync.sh new file mode 100755 index 0000000..b9dba30 --- /dev/null +++ b/bin/khal_sync.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +notify_khal() { + while inotifywait -r -e modify -e create -e delete "${HOME}/.calendars/"; do + "${HOME}/bin/vdirsyncer.sh" + done +} +notify_khal & diff --git a/bin/lock.sh b/bin/lock.sh new file mode 100755 index 0000000..3956227 --- /dev/null +++ b/bin/lock.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +notify-send "DUNST_COMMAND_PAUSE" + +i3lock-fancy -n + +notify-send "DUNST_COMMAND_RESUME" diff --git a/bin/polybar.sh b/bin/polybar.sh new file mode 100755 index 0000000..4244b54 --- /dev/null +++ b/bin/polybar.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env sh + +# kill running polybar instances +killall -q polybar + +# wait for termination +while pgrep -x polybar >/dev/null; do sleep 1; done + +for m in $(polybar --list-monitors | cut -d":" -f1); do + MONITOR=$m polybar --reload example & +done + +polybar example & diff --git a/bin/tm b/bin/tm new file mode 100755 index 0000000..aad3dc8 --- /dev/null +++ b/bin/tm @@ -0,0 +1,31 @@ +#!/bin/bash + +# abort if we're already inside a TMUX session +[ "$TMUX" == "" ] || exit 0 +# startup a "default" session if non currently exists +# tmux has-session -t _default || tmux new-session -s _default -d + +# present menu for user to choose which workspace to open +PS3="Please choose your session: " +options=($(tmux list-sessions -F "#S" 2>/dev/null) "New Session" "zsh") +echo "Available sessions" +echo "------------------" +echo " " +select opt in "${options[@]}" +do + case $opt in + "New Session") + read -p "Enter new session name: " SESSION_NAME + tmux new -s "$SESSION_NAME" + break + ;; + "zsh") + zsh --login + break;; + *) + tmux attach-session -t $opt + break + ;; + esac +done +# vim: set filetype=sh ts=4 sw=4 tw=120 noet : diff --git a/bin/vdirsyncer.sh b/bin/vdirsyncer.sh new file mode 100755 index 0000000..4a730b7 --- /dev/null +++ b/bin/vdirsyncer.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +set -e + +/usr/bin/vdirsyncer sync +/usr/bin/vdirsyncer metasync +khal