-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayer
More file actions
executable file
·39 lines (37 loc) · 1.17 KB
/
Copy pathplayer
File metadata and controls
executable file
·39 lines (37 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/zsh
#
cmus
exit
# if not in tmux
if [[ -z "$TMUX" ]]; then
# if music session exists and attached
if [[ $(tmux ls | grep music | grep attached) ]]; then
# jump to music session or tell user to find it
echo "Music session already exists"
# else if music session exists and not attached
elif [[ $(tmux ls | grep music | grep -v attached) ]]; then
# attach to tmux -s music
tmux attach -t music
# else if there is no music session
else
# tmux new-session -s music
# maybe move to window 9
# start cmus
tmux new-session -d -s music
tmux new-window -n cmus -t music:9 'cmus'
tmux kill-window -t music:1
tmux attach-session -t music
fi
# else if in music tmux session
elif [[ $(tmux display-message -p '#S') == "music" ]]; then
# start cmus
cmus
# else if in some tmux session that is not music and there is no music
elif ! [[ $(tmux ls | grep music) ]]; then
tmux new-session -d -s music
tmux new-window -n cmus -t music:9 'cmus'
tmux kill-window -t music:1
tmux switch-client -t music
elif [[ $(tmux ls | grep music) ]]; then
tmux switch-client -t music
fi