I’ve made an application launcher for myself that uses fzf to pick the application. Currently, it launches in an Alacritty window with a special config - it’s a small rectangle that has the fzf dialog, you pick the application and it goes away. That’s all the interaction needed. If I wanted to try to make this “GUI” more generic, what would I use?

  • Ramin Honary@lemmy.ml
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    11 months ago

    I guess it depends on your goals. If this is just for yourself, the solution you are using now sounds just fine, use Alacritty as the GUI.

    If you want to package it as an app all wrapped up in a single binary that you might want to distribute to other people, you could just write a simple C program that imports both FZF and a tiny terminal emulator like ST (the Suckless Terminal), and configure ST in the C program to launch FZF with your unique FZF config, instead of launching /bin/sh. You could even dump your configs as constant strings into your C program so you don’t need any external config files.

      • Ramin Honary@lemmy.ml
        link
        fedilink
        English
        arrow-up
        1
        ·
        11 months ago

        I don’t think ST works on Wayland except through the ordinary Wayland X11 server they have to suppor legacy software. You might want to ask the Suckless people what their opinion is of Wayland and whether they will support it in the future.

        Or you can use any other terminal emulator that does support Wayland, I only recommend ST because it is the simplest one and is specifically designed to be easy to hack.

      • ShadowA
        link
        fedilink
        arrow-up
        1
        ·
        11 months ago

        Can you be more clear about what you’re looking to do? It sounds like you want to draw a dialog?

        You can look into ncurses too, there’s probably a bunch of bash wrappers for it.

        • driveway@lemmy.zipOP
          link
          fedilink
          arrow-up
          1
          ·
          11 months ago

          They both look good and can do the job, but as far as I can tell, I cant just call fzf into one of them and be done with it? I don’t want to write extra code for the GUI. This question is for research purposes mostly, I don’t intend to distribute this application - it has far too many functionality specific to me, hence why I don’t use one of the popular launchers.

          Mainly, I haven’t found a way to disable animations just for this specific window in KDE. That’s where the initial search started. Other launchers are not affected by opening/closing animations so I was curious how they do that.

    • Hexarei@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      11 months ago

      Ok legit I’ve been writing terminal applications for years and seen this everywhere without being able to find it. Thanks!

  • I mean, I would use fzf if I were already in a terminal, but if I wanted a pop-up window, rofi is the right tool. Forking a terminal to run fzf seems a round-about way to solve this.

    I don’t know what you’re asking, though. It sounds as if it does what you want, even if it isn’t the way I’d do it… are you asking because you want to make it easier for other people to use?

  • chayleaf@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    11 months ago

    I wouldn’t change anything, maybe make it more generic so the user could e.g. pick dmenu or rofi instead of alacritty+fzf