r/Ubuntu • • 5d ago

Default app issue

I’m trying to make Geany (APT installed) the default app for .txt files and RStudio (Snap installed) the default for .r files on Ubuntu. Surprisingly, the system classifies both file types as plain text—so whenever I set Geany as the default for .txt, it overrides .r files too, and vice versa with RStudio. How can I configure Ubuntu to handle these two extensions separately (preferably in a GUI way)?

3 Upvotes

3 comments sorted by

2

u/Monoyo- 5d ago

yeah ubuntu groups those by mime type, not the extension, and .r often just sits under plain text so it keeps following the .txt app. if you add a small mime xml for .r under ~/.local/share/mime/packages and run update-mime-database ~/.local/share/mime, the normal open with menu can set rstudio for that type and leave geany on .txt.

1

u/OutdoorSportBoy 5d ago

in this case, does it matter if an app is installed via APT vs. via Snap?

2

u/Monoyo- 4d ago

the mime type part is the same either way, apt vs snap doesn't change .r being treated as plain text. snap can make the open with list a bit messier, but once you add that .r mime type you should still be able to set rstudio for it and leave geany on .txt.