diff --git a/fake_home/.sofi.sh b/fake_home/.sofi.sh index 6db585f..d7a11e0 100755 --- a/fake_home/.sofi.sh +++ b/fake_home/.sofi.sh @@ -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)"