changes to neovim and tmux
This commit is contained in:
Regular → Executable
+10
@@ -1,3 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Changes the audio output device with dmenu
|
||||
SPEAKER="Speaker"
|
||||
HEADPHONES="Headphones"
|
||||
|
||||
OUTPUT="$(echo -e "${SPEAKER}\n${HEADPHONES}" | dmenu -l 2)"
|
||||
|
||||
if [[ ${OUTPUT} == ${SPEAKER} ]]; then
|
||||
wpctl set-default 52
|
||||
elif [[ ${OUTPUT} == ${HEADPHONES} ]]; then
|
||||
wpctl set-default 53
|
||||
fi
|
||||
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
selected="${1:-$(find ~/* ~/dotfiles/*/ ~/personal/*/*/ ~/personal -mindepth 1 -maxdepth 1 -type d 2>/dev/null | sort -u | fzf)}"
|
||||
[[ -z $selected ]] && exit 0
|
||||
|
||||
session_name=$(basename "$selected" | tr . _)
|
||||
|
||||
if ! tmux has-session -t "$session_name" 2>/dev/null; then
|
||||
tmux new-session -d -s "$session_name" -c "$selected"
|
||||
fi
|
||||
|
||||
if [[ -z $TMUX ]]; then
|
||||
exec tmux attach -t "$session_name"
|
||||
else
|
||||
tmux switch-client -t "$session_name"
|
||||
fi
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
selected="${1:-$(find ~/* ~/dotfiles/*/ ~/personal/*/*/ ~/personal -mindepth 1 -maxdepth 1 -type d 2>/dev/null | sort -u | fzf)}"
|
||||
[[ -z $selected ]] && exit 0
|
||||
|
||||
# Create a new window in the current tmux session
|
||||
tmux new-window -c "$selected"
|
||||
|
||||
# Hydrate with sessionizer if it exists
|
||||
for file in "$selected/.tmux-sessionizer" "$HOME/.tmux-sessionizer"; do
|
||||
[[ -f $file ]] && tmux send-keys -t "$(tmux display-message -p '#S')" "source $file" C-m && break
|
||||
done
|
||||
|
||||
# Attach or switch to the tmux session
|
||||
if [[ -z $TMUX ]]; then
|
||||
exec tmux attach-session
|
||||
else
|
||||
tmux switch-client
|
||||
fi
|
||||
Reference in New Issue
Block a user