#!/bin/bash export TMUX_TMPDIR="/tmp/clerk/tmux" if [[ ! -d "${TMUX_TMPDIR}" ]]; then mkdir -p "${TMUX_TMPDIR}" fi 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