10 ms·
Show HN: TUI for managing XDG default applications
Author here. I made this little TUI program for managing default applications on the Linux desktop.
Maybe some of you will find it useful.
Happy to answer any questions.
- cda2100 8mo ago[flagged]
- JonAtkinson 8mo agoWho are you to tell people what to be proud of, and and what to want to share?
- juggernot 8mo ago[flagged]
- ranger_danger 8mo agoWhat have you shown that's better?
- forgotpwd16 8mo agoAckchyually XDG default applications aren't set via env vars but through the `${XDG_CONFIG_HOME}/mimeapps.list` file manipulated (either via text editor if track desktop files yourself or, better) via `xdg-mime {query|default}` tool. This TUI is a replacement (doesn't wrap it) to this tool for this functionality, with twist that does multiple-defaults category-wise rather one-by-one ("word processor documents" rather odt/doc/docx). Compared to what slopcalypse has brought, this one (project; vibe coded maybe, certainly not slop) at very least is useful (also is quite short; within a sea of thousand LOC generated in 1s this is refreshing).
- rolymath 8mo ago[flagged]
- untech 8mo agoLooks neat!
- sourcegrift 8mo agoNo one on earth has so far managed to get xdg default apps work on Linux. I've been failing since 19 years personally. If you've really succeded then congratulations!
- nickjj 8mo ago> No one on earth has so far managed to get xdg default apps work on Linux. I've only been using Linux for a few weeks but what am I missing here? I set a bunch of mime types in `~/.config/mimeapps.list` which are assigned to desktop apps and they all open perfectly with `xdg-open` or when I launch them through a file manager. It is documented in the XDG specification https://specifications.freedesktop.org/mime-apps/latest/file.html https://specifications.freedesktop.org/mime-apps/latest/file....
- forgotpwd16 8mo agoFor me currently, when trying to open a `text/markdown` file, there's a disassociation between what my file manager (Caja) runs (own bin/emacs script; was under the impression it was auto-creating a .desktop file), what mimeapps.list have (emacs.desktop), and what `xdg-open` runs (Firefox for some reason).
- TingPing 8mo agoOlder desktops don’t follow the specs and xdg-open does different things based on the desktop, so they indeed can get out of sync. I’d have to look into your specific case but `gio mime` and `gio open` do the right things.
- sam_lowry_ 8mo ago> what am I missing here? There are gotchas, for instance Chrom,{e,ium} insists on XDG_DESKTOP_DIR != XDG_DOWNLOAD_DIR. See this bug report from a confused user: https://issues.chromium.org/issues/41076564 https://issues.chromium.org/issues/41076564
- 8mo ago
- jwrallie 8mo agoJust by reading the title, I’m sold! This should be very useful specially if you are not using a desktop environment that manages the default apps. I always alias open to xdg-open, it’s so useful to open a file directly from the terminal.
- mitjafelicijan 8mo agoThat was the exact reason for it. I made my own window manager for fun and was missing a simple way of changing default apps.
- roman_soldier 8mo agoNice, but problem with all these AI coded TUI's is we will have hundreds of them, best to stick to the built in linux commands, add aliases/abbreviations (fish) if required, do you need a TUI for everything? Sometimes the answer to "Should I write this?" Is no
- mitjafelicijan 8mo agoI do agree with some of your sentiment. But by that logic, nothing would ever be made. The same goes with aliases. Why not just use the actual commands. You give it your best shot, and sometimes something good comes out. And sometimes it's crap. That's life. And I made it for fun and to learn something. And it wasn't AI coded. It's like 200 lines. I wanted to learn termbox2.h a bit more than I already had.
- brw 8mo agoYea I was pleasantly surprised by how simple the code is when I read it. Honestly a great example of what termbox2 is capable of. Very nice! And now I know about termbox2, which looks very cool. Looking through the example projects[1] in the README I also found ictree[2], which does exactly what I was looking for yesterday (turning the output of `find` into an ncdu-like/interactive tree interface). I didn't manage to find something for that through googling around or asking LLMs, but thanks to you posting this here I did, so thanks! [1] https://github.com/termbox/termbox2#examples https://github.com/termbox/termbox2#examples [2] https://github.com/NikitaIvanovV/ictree https://github.com/NikitaIvanovV/ictree
- mitjafelicijan 8mo agoThis whole tool is much more a display of what termbox2 can do in couple of lines tbh :) You are so right about that. It's an amazing library. And all that juice in one stb-style header file. You just gotta love it. And if you are interested in such small libraries, I have a Github list with a bunch of them that I found. https://github.com/stars/mitjafelicijan/lists/stb-style-minimal-libraries https://github.com/stars/mitjafelicijan/lists/stb-style-mini...
- ranger_danger 8mo agoFeature suggestion: The ability to add/remove more specific mime entries such as video/mp4
- mitjafelicijan 8mo agoI haven't thought about this. That makes sense. I will add this.
- fouc 8mo agoAt first I thought it was going to be some kind of solution to force all linux apps to adhere to the XDG Base Directory Specification, until I realized this related to a different specification altogether (XDG MIME Applications specification).
- jedahan 8mo agoMaking home read-only can get there, and I can't find the project that forced using XDG paths. I think it used LD_PRELOAD or somesuch trick. edit: https://soc.me/standards/defending-home https://soc.me/standards/defending-home
- ekipan 8mo agoStrange. Middle-clicking the link opens a HackerNews frontpage, but copypasting into a new tab shows the article. Presumably the server shoos away referer links? To reduce load maybe somehow? Or maybe something's weird in my own configuration idk.
- mitjafelicijan 8mo agoI had the same issue as you. Had to copy and paste the link.
- IAmLiterallyAB 8mo agoThey explicitly check if the referrer is hackernews and do that.
- piskov 8mo agoThank god it’s not another React, Solid, Typescript, what have you, web abomination inside the terminal (claude code, opencode, I’m looking at you). Bravo!
- thehamkercat 8mo agoThat's where codex-cli shines (rust) the startup time is crazy, you can start writing as soon as you hit the command (I don't use codex, just noticed that it's crazy fast)
- DrammBA 8mo agoSadly the fast startup time is overshadowed by the slow response time of the codex agent
- piskov 8mo agoI don't get it. Even in ChatGPT I always use Pro model with maxed-out thinking budget (selectors available only on web and windows). Let them cook as much as they can.
- forgotpwd16 8mo agoLooks like there're two main approaches to AI-first development: (i) favor slow responses to produce an upfront high-quality result, (ii) favor quick responses to enable faster response-test-query iteration. And, based on comments read here, seems Codex isn't too fit for the later. Optimally a developer should be able switch between the two approaches depending on problem at hand.
- codethief 8mo ago> claude code, opencode, I’m looking at you Could you elaborate? I mean, I get the usual criticism of web/Electron-based desktop applications (slow, includes a whole Chrome engine, non-native UI, …) but Claude Code isn't one of them?
- renewiltord 8mo agoThese days I pretty much write this kind of software in ratatui with LLM when I need it. But the idea is nice. I like that. LLMs are the return of the value of the ideas guy! But this seems human-written? Then it is interesting. Thank you for sharing.
- mitjafelicijan 8mo agoYeah, I did write it myself, yes. It's actually a very simple program. I heard so many great things about ratatui. I am, however, not well versed in Rust. Only did a couple of toy little things in it.
- coppsilgold 8mo agoI usually just edit ~/.config/mimeapps.list directly. I can see how that tool can be useful, but only if it's included in official repos. Editing mimeapps.list is simpler than the hassle of downloading and building this tool.
- undume 8mo agoThere are also replacements for xdg-open with more sane (in my opinion) configuration, like jaro: https://github.com/isamert/jaro https://github.com/isamert/jaro