this post was submitted on 31 Dec 2023
51 points (96.4% liked)

Linux

48323 readers
919 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

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?

all 13 comments
sorted by: hot top controversial new old
[–] Ramin_HAL9001@lemmy.ml 6 points 10 months ago* (last edited 10 months ago) (1 children)

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.

[–] driveway@lemmy.zip 2 points 10 months ago (1 children)

Sounds like a good idea. ST doesn't work on wayland, does itm?

[–] Ramin_HAL9001@lemmy.ml 1 points 10 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.

[–] Shadow@lemmy.ca 4 points 10 months ago* (last edited 10 months ago) (2 children)
[–] Hexarei@programming.dev 1 points 10 months ago

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

[–] driveway@lemmy.zip 1 points 10 months ago (1 children)

doesn't do what I'm asking

[–] Shadow@lemmy.ca 1 points 10 months ago (1 children)

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.zip 1 points 10 months ago (1 children)

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.

[–] d3Xt3r@lemmy.nz 1 points 10 months ago

Mainly, I haven't found a way to disable animations just for this specific window in KDE.

This should still work: https://forum.manjaro.org/t/how-to-make-a-window-rule-to-turn-off-compositing-for-a-certain-app/10341

[–] sxan@midwest.social 2 points 10 months ago

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 1 points 10 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

[–] kbal@fedia.io 1 points 10 months ago

Tcl is one option.