Allow for custom choice listings

This commit is contained in:
Sage Vaillancourt 2024-02-24 12:04:44 -05:00
parent d90b7dc63c
commit 5a7057a9bb
1 changed files with 18 additions and 12 deletions

View File

@ -68,6 +68,11 @@ read_snap_apps() {
fi
}
apps() {
read_apps
read_snap_apps
}
open_app() {
app="$(echo "$1" | cut -c 5-)"
# shellcheck disable=SC2086
@ -99,22 +104,23 @@ if [[ "$1" == "--print-only" ]]; then
<(system_info) \
<(windows) \
<($HOME/.rofi-list-git-repos.py --no-icon) \
<(read_apps) \
<(read_snap_apps) \
<(apps) \
<(list_files) \
$HOME/.emojis
exit 1
fi
choice="$(cat \
<(system_info) \
<(windows) \
<($HOME/.rofi-list-git-repos.py --no-icon) \
<(read_apps) \
<(read_snap_apps) \
<(list_files) \
"$HOME/.emojis" \
| fzf --print-query --preview="$HOME/.sofi-preview.sh {} {q}")"
if [[ "$1" == "" ]]; then
choice="$(cat \
<(system_info) \
<(windows) \
<($HOME/.rofi-list-git-repos.py --no-icon) \
<(apps) \
<(list_files) \
"$HOME/.emojis" \
| fzf --print-query --preview="$HOME/.sofi-preview.sh {} {q}")"
else
choice="$(cat <($1) | fzf --print-query --preview="$HOME/.sofi-preview.sh {} {q}")"
fi
echo
qstring="$(echo "$choice" | head -n 1)"
choice="$(echo "$choice" | tail -n 1)"