Looking for a good app launcher for Linux. Currently looking for something for Arch and I see there’s a lot of options liks rofi and wofi. What are your favourite app launchers and why?

  • ctr1@fl0w.cc
    link
    fedilink
    English
    arrow-up
    2
    ·
    6 hours ago

    I use fzf with a popup terminal:

    # example for i3
    bindsym $mod+Return exec --no-startup-id kitty -T _menu_ -e bash -c 'ls $HOME/.local/bin/ | fzf | xargs -r -I{} i3-msg -t command exec $HOME/.local/bin/{}'
    for_window [title="_menu_"] floating enable
    for_window [title="_menu_"] resize set 600 800
    

    I like this approach because it’s simple and configurable. I prefer to see only the symlinks/scripts that I put in my local bin folder, but it can easily be extended to support .desktop files, multiple folders, filtering, etc.

    • thingsiplay@beehaw.org
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      3 hours ago

      I like these self made scripts. Some ideas to improve this: a) instead ls, use find command if you want use its output as input in another program (will yield fullpath too), b) fzf has a preview functionality, which I like a lot to use when it comes to directories or script files. As for the run command, I’m not sure why you use xargs and what i3-msg is needed for. Here is an alternative way.

      (Edit: I always forget that beehaw will convert my ampersand to &. Have this in mind if you read the below code.)

      bash -c 'cd "${HOME}/.local/bin"; path="$(find . -maxdepth 1 -type f -executable -printf "%f\n" | fzf --preview "cat {}")" && "${path}"'
      

      below same command in a bit more readable standalone script:

      #!/usr/bin/env bash
      cd "${HOME}/.local/bin" || exit 1
      path="$( \
          find . -maxdepth 1 -type f -executable -printf "%f\n" | \
          fzf --preview "cat {}" \
      )" && "${path}"
      

      The biggest problem with fzf is, that scripts that need an argument are not covered here. One could either use the input string from fzf as arguments or like that, or an optional input after fzf selection.