diff options
-rwxr-xr-x | clerk_fzf/clerk_starter | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/clerk_fzf/clerk_starter b/clerk_fzf/clerk_starter index 52b990f..1074262 100755 --- a/clerk_fzf/clerk_starter +++ b/clerk_fzf/clerk_starter @@ -6,16 +6,28 @@ if [[ ! -d "${TMUX_TMPDIR}" ]]; then mkdir -p "${TMUX_TMPDIR}" fi -tmux has-session -t music -if [ $? != 0 ]; then - tmux -f /etc/clerk/tmux.conf new-session -s music -n albums -d 'clerk_fzf --albums' -# tmux send-keys -t music 'clerk_fzf --albums' C-m - tmux new-window -t music -n tracks 'clerk_fzf --tracks' -# tmux send-keys -t music 'clerk_fzf --tracks' C-m - tmux new-window -t music -n latest 'clerk_fzf --latest' -# tmux send-keys -t music 'clerk_fzf --latest' C-m - tmux new-window -t music -n queue 'ncmpcpp' -# tmux send-keys -t music 'ncmpcpp' C-m +main() { + tmux has-session -t music + if [ $? != 0 ]; then + tmux -f /etc/clerk/tmux.conf new-session -s music -n albums -d 'clerk_fzf --albums' + tmux new-window -t music -n tracks 'clerk_fzf --tracks' + tmux new-window -t music -n latest 'clerk_fzf --latest' + tmux new-window -t music -n queue 'ncmpcpp' + fi + tmux attach -t music +} + + +if [[ $1 == "--help" || $1 == "-h" ]]; then + echo "clerk: MPD Interface using fzf and tmux" + echo "Copyright © 2016 Rasmus Steinke" + echo "" + echo "--help, -h this help message" + echo "--kill kill running clerk sessions" +elif [[ $1 == "--kill" ]]; then + tmux kill-session -t music +else + main fi -tmux attach -t music + |