grrr windows
This commit is contained in:
parent
b339ecb123
commit
45d9ce3474
@ -32,7 +32,7 @@ export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quo
|
|||||||
# Add some custom keybinds
|
# Add some custom keybinds
|
||||||
|
|
||||||
bind '"\C-o":"lfcd\n"'
|
bind '"\C-o":"lfcd\n"'
|
||||||
bind '"\C-t":"tms\n"'
|
bind '"\C-g":"tms\n"'
|
||||||
bind '"\C-w":"tms $(pwd)\n"'
|
bind '"\C-w":"tms $(pwd)\n"'
|
||||||
bind '"\C-n":"zk edit --interactive --sort modified-\n"'
|
bind '"\C-n":"zk edit --interactive --sort modified-\n"'
|
||||||
bind '"\C-f":"cd $(dirname "$(fzf)")\n"'
|
bind '"\C-f":"cd $(dirname "$(fzf)")\n"'
|
||||||
|
|||||||
@ -4,25 +4,32 @@
|
|||||||
# connect to an existing one.
|
# connect to an existing one.
|
||||||
|
|
||||||
if [[ $# -eq 1 ]]; then
|
if [[ $# -eq 1 ]]; then
|
||||||
|
echo $1
|
||||||
selected=$1
|
selected=$1
|
||||||
else
|
else
|
||||||
selected=$(find ~/repos/github.com/*/ ~/repos/gitlab.com/inkletblot ~/.config ~/ ~/nextcloud ~/nextcloud/*/ -mindepth 1 -maxdepth 1 -type d | fzf)
|
selected=$(find ~/repos/github.com/*/ ~/repos/gitlab.inkletblot.com/inkletblot ~/.config ~/ ~/nextcloud ~/nextcloud/*/ -mindepth 1 -maxdepth 1 -type d | fzf)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z $selected ]]; then
|
if [[ -z $selected ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
selected_name=$(basename "$selected" | tr . _)
|
selected_name=$(basename "$selected" | tr ":,. " _)
|
||||||
tmux_running=$(pgrep tmux)
|
|
||||||
|
|
||||||
if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then
|
switch_to() {
|
||||||
tmux new-session -s "$selected_name" -c "$selected"
|
if [[ -z $TMUX ]]; then
|
||||||
|
tmux attach-session -t "$selected_name"
|
||||||
|
else
|
||||||
|
tmux switch-client -t "$selected_name"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if tmux has-session -t="$selected_name" 2>/dev/null; then
|
||||||
|
switch_to
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! tmux has-session -t="$selected_name" 2>/dev/null; then
|
|
||||||
tmux new-session -ds "$selected_name" -c "$selected"
|
tmux new-session -ds "$selected_name" -c "$selected"
|
||||||
fi
|
switch_to
|
||||||
|
|
||||||
tmux switch-client -t "$selected_name"
|
tmux send-keys -t "$selected_name" "ready-tmux"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user