-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtmux-float
More file actions
executable file
·32 lines (29 loc) · 1.26 KB
/
tmux-float
File metadata and controls
executable file
·32 lines (29 loc) · 1.26 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
##############################################################################
# Script Name : tmux-float
# Author : Dilip Chauhan
# Repository : https://github.com/dc-scripts
# Description : A utility script to launch floating terminals in tmux, making
# it easier to run commands or view files without disrupting
# the current tmux workflow.
###############################################################################
#!/usr/bin/env bash
TMUX_POPUP_OPTS="-b single -w 70% -h 70%"
TMUX_FIXED_POPUP_OPTS="-b single -w 82 -h 27"
TMUX_BIG_POPUP_OPTS="-b single -w 80% -h 80%"
case $1 in
"todo")
tmux display-popup -d "#{pane_current_path}" -T " todo " $TMUX_POPUP_OPTS -E "nvim ~/Notes/todo.md"
;;
"git")
tmux display-popup -d "#{pane_current_path}" -T " lazygit " $TMUX_BIG_POPUP_OPTS -E "lazygit"
;;
"persist")
tmux display-popup -d "#{pane_current_path}" $TMUX_POPUP_OPTS -E "tmux attach -t persist || tmux new-session -s persist"
;;
"qad-client")
tmux display-popup -d "#{pane_current_path}" $TMUX_FIXED_POPUP_OPTS -E "tmux attach -t qad-client || tmux new-session -s qad-client"
;;
*)
tmux display-popup -d "#{pane_current_path}" -T " $@ " $TMUX_POPUP_OPTS -E "$@"
;;
esac