9
submitted 1 week ago by GustavoM@lemmy.world to c/linux@lemmy.world

The code can be found by clicking here. Save it as mini95.c, then compile this with "gcc mini95.c -lX11 -o mini95".

top 2 comments
sorted by: hot top controversial new old
[-] JubilantJaguar@lemmy.world 0 points 1 week ago

Tangential. I tried everything to replicate the basic function of an app launcher in a terminal - i.e. launch a GUI app while leaving the terminal unaffected and have the app survive without spontaneous combustion at some random point later - before finally giving up. Yes, background process. Yes, disown. Yes, redirect all output to null. Yes, nohup. Yes, every combination of the above. Nothing really worked. So I now have a mystical reverence for the people who write app launchers.

[-] Remus86@lemmy.zip 1 points 1 week ago* (last edited 1 week ago)

In X11 you can just use 'exec app-name' and it will replace the terminal window with the app. In Wayland, I got it to work with this:

setsid app-name & disown
sleep 1
exit

Without the 'sleep 1', it exits the terminal too quickly for the app to launch, at least when I tried it.

*Edit: In order for it to work as a script, you still need to type exec first. Or, in my case, I aliased "open-app" to "exec open-app".

this post was submitted on 16 Jan 2026
9 points (100.0% liked)

Linux

14837 readers
2 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 2 years ago
MODERATORS