update
This commit is contained in:
parent
3ce3e3927c
commit
8b9171e709
2 changed files with 17 additions and 1 deletions
|
|
@ -91,6 +91,21 @@ popup() {
|
||||||
tmux attach-session -t "$name"
|
tmux attach-session -t "$name"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scratch() {
|
||||||
|
name="scratch"
|
||||||
|
|
||||||
|
tmux has-session -t ${name} >/dev/null && {
|
||||||
|
tmux attach-session -t ${name}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
tmux new-session -d -s "$name" -c "$HOME"
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
tmux send-keys -t "$name" 'tmux set -g status off;clear' C-m
|
||||||
|
tmux send-keys -t "$name" 'nvim scratch' C-m
|
||||||
|
tmux attach-session -t "$name"
|
||||||
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
new) new $2 ;;
|
new) new $2 ;;
|
||||||
switch) switch ;;
|
switch) switch ;;
|
||||||
|
|
@ -98,5 +113,6 @@ delete) delete ;;
|
||||||
window) window ;;
|
window) window ;;
|
||||||
notes) notes ;;
|
notes) notes ;;
|
||||||
popup) popup ;;
|
popup) popup ;;
|
||||||
|
scratch) scratch ;;
|
||||||
*) echo "Please enter an action" ;;
|
*) echo "Please enter an action" ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ bind T if-shell -F '#{==:#{session_name},popup}' {
|
||||||
bind S if-shell -F '#{==:#{session_name},scratch}' {
|
bind S if-shell -F '#{==:#{session_name},scratch}' {
|
||||||
detach-client
|
detach-client
|
||||||
} {
|
} {
|
||||||
display-popup -d "#{pane_current_path}" -xC -yC -w 80% -h 75% -E 'tmux attach-session -t scratch || tmux new-session -s scratch nvim new'
|
display-popup -d "#{pane_current_path}" -xC -yC -w 80% -h 75% -E ". $HOME/.config/scripts/sessions.sh scratch"
|
||||||
}
|
}
|
||||||
|
|
||||||
bind N if-shell -F '#{==:#{session_name},notes}' {
|
bind N if-shell -F '#{==:#{session_name},notes}' {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue