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