You are not logged in.
I expect xdg-open to open text files (like txt, c, cpp) in text editor, for example vscode,
but instead it opens them in firefox every time.
I set xdg-mime specifications and enviroment variables correctly (i think) so im lost at what else is there to do.
xdg-mime specifications:
xdg-mime query default text/plainvscodium.desktopEnvironment variables:
echo $EDITOR $VISUALvscodium vscodiumLast edited by bruh-i-use-arch-cow (2022-03-12 19:16:05)
Offline
Turns out xdg-mime specifications was wrong.
The best way that i figured out how to set default applications (with command line) is:
1) Check Mime type for a file you want to change default application:
xdg-mime query file type example.txtinode/x-empty2) Change default application by file type:
mimelist.list:
[Default Applications]
inode/x-empty=vscodium.desktop
Offline
Ah, what? Is that "example.txt" actually a text file, or did you just create it with `touch`? inode/x-empty is not the mime-type you'd want to use. If example.txt is an actually text file (and not really an empty inode just created by `touch`) then you should debug why xdg-mime query is giving an incorrect result.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Ah, what? Is that "example.txt" actually a text file, or did you just create it with `touch`? inode/x-empty is not the mime-type you'd want to use. If example.txt is an actually text file (and not really an empty inode just created by `touch`) then you should debug why xdg-mime query is giving an incorrect result.
yes, I created example.txt using touch, and yes my xdg-mime is probably broken, but im too lazy to debug it since inode/x-empty approach works.
Better example would probably be with cpp files cause in this case xdg-mime gives me correct results:
xdg-mime query filetype code/minecraft/main.cpptext/x-cOffline
but im too lazy to debug it since inode/x-empty approach works.
Except it will only work with empty files, not real code or text files which is the problem you laid out in the first post.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline