1
0
mirror of https://github.com/vbrandl/dotfiles synced 2024-11-23 00:13:49 +01:00

Add custom scripts

This commit is contained in:
Valentin Brandl 2019-04-28 22:03:13 +02:00
parent e44ed12635
commit 216f510d55
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D
5 changed files with 65 additions and 0 deletions

7
bin/khal_sync.sh Executable file
View File

@ -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 &

7
bin/lock.sh Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env sh
notify-send "DUNST_COMMAND_PAUSE"
i3lock-fancy -n
notify-send "DUNST_COMMAND_RESUME"

13
bin/polybar.sh Executable file
View File

@ -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 &

31
bin/tm Executable file
View File

@ -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 :

7
bin/vdirsyncer.sh Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env sh
set -e
/usr/bin/vdirsyncer sync
/usr/bin/vdirsyncer metasync
khal