(scripts) added script to switch audio sink, renamed scripts to "*.sh"

This commit is contained in:
quak
2025-05-28 21:44:32 +02:00
parent f446c6ed8d
commit 3cebb6014d
6 changed files with 39 additions and 4 deletions

View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
function __search-history {
current_line="${READLINE_LINE}"
if [[ -n $current_line ]]; then
command=($(fc -lnr 1 | fzf --scheme=history --tmux --expect=tab,right -q ${current_line}))
else
command=($(fc -lnr 1 | fzf --scheme=history --tmux --expect=tab,right))
fi
# print command to terminal for editting
if [[ ${command[0]} = "tab" || ${command[0]} = "right" ]]; then
edit="true"
command=(${command[@]:1:${#command[@]}})
fi
# strip white space
command="${command[@]}"
READLINE_LINE="${command}"
READLINE_POINT=$(( 0 + ${#command} ))
}
if command -v fzf 2>&1 >/dev/null; then
bind -r "\C-r"
bind -x '"\C-r": __search-history'
fi