[sway] Add new launcher to quickly pick a document

This commit is contained in:
Sebastian Schulze 2022-04-05 10:18:06 +02:00
parent f04b69d912
commit 8338f18839
No known key found for this signature in database
GPG Key ID: F6BA63C6A7D3044E
3 changed files with 19 additions and 7 deletions

View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
FIND_FOLDER=${1:-~/Documents}
FOLDER=$(find "${FIND_FOLDER}" -maxdepth 4 -type d |fzf --preview="exa --tree --icons --level 2 {1}" --preview-window="right")
if [ ! -z "${FOLDER}" ]; then
browse-folder "${FOLDER}"
fi

View File

@ -1,3 +1,3 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
print -rl -- ${(ko)commands} | fzf | xargs -r swaymsg -t command exec
dmenu_path | fzf | xargs -r swaymsg -t command exec

View File

@ -5,10 +5,10 @@ export FZF_DEFAULT_OPTS='
--layout=reverse
--margin=0
--padding=0
--color=fg:#f8f8f2,bg:#282a36,hl:#bd93f9
--color=fg+:#f8f8f2,bg+:#44475a,hl+:#bd93f9
--color=info:#ffb86c,prompt:#50fa7b,pointer:#ff79c6
--color=marker:#ff79c6,spinner:#ffb86c,header:#6272a4
--color=fg:#cbccc6,bg:#1f2430,hl:#707a8c
--color=fg+:#707a8c,bg+:#191e2a,hl+:#ffcc66
--color=info:#73d0ff,prompt:#707a8c,pointer:#cbccc6
--color=marker:#73d0ff,spinner:#73d0ff,header:#d4bfff
'
FOOT_OPTIONS=''
@ -22,6 +22,11 @@ then
FZF_DEFAULT_OPTS="--prompt=' '${FZF_DEFAULT_OPTS}"
COMMAND=~/bin/launcher-bookmarks
FOOT_OPTIONS="-W 120x40 ${FOOT_OPTIONS}"
elif [[ "$1" == "documents" ]]
then
FZF_DEFAULT_OPTS="--prompt='f '${FZF_DEFAULT_OPTS}"
COMMAND=~/bin/launcher-folder
FOOT_OPTIONS="-W 120x40 ${FOOT_OPTIONS}"
elif [[ "$1" == "clipboard" ]]
then
FZF_DEFAULT_OPTS="--prompt='📋 ' --algo=v1 --bind 'tab:up' ${FZF_DEFAULT_OPTS}"
@ -42,5 +47,4 @@ then
else
exec foot --app-id launcher --config ~/.config/foot/foot-launcher.ini ~/bin/launcher-run
fi;
exec foot --app-id launcher ${FOOT_OPTIONS} --config ~/.config/foot/foot-launcher.ini "$COMMAND"