That's what I thought and it broke the links, so don't do that! And given the accepted answer, you might (like I did) expect the equivalent would be: donotdothisssudo update-alternatives -install /etc/alternatives/gnome-text-editor gnome-text-editor /usr/bin/geany 10 Too late for that I guess.Īnyway for nautilus (aka files) on gnome under Ubuntu 14.04. If the question was changed to specify the CLI and the queries for the GUI moved to a new thread this would clear up the confusion. ![]() Replace "gedit" with "sublime_text" and add the entries to the "Default Applications" section of my personal defaults.list application/x-perl=sublime_sktopīecause there are comments indicating that the accepted answer was not correct I feel I should point out this question can not have a single answer. I wanted to changed the default "file opening" application in Nautilus from "gedit" -> "sublime text".įind the system defaults for gedit with: $less /usr/share/applications/defaults.list | grep gedit Knowing this, here is my particular problem and how I solved it. Message/rfc822=sktopĪpplication/x-extension-eml=sktop Looking at the users personal file after running the command, we can see all the file-associations set for the sktop application: Text/plain text/x-chdr text/x-csrc text/x-c++hdr text/x-c++src text/x-java text/x-dsrc text/x-pascal text/x-perl text/x-python application/x-php application/x-httpd-php3 application/x-httpd-php4 application/x-httpd-php5 application/xml text/html text/css text/x-sql text/x-diff takes all mime-types from the sktop file.Looking at $(grep MimeType /usr/share/applications/sktop | sed 's/MimeType=//' | sed 's/ / /g') $(grep MimeType /usr/share/applications/sktop | sed 's/MimeType=//' | sed 's/ / /g') Set sktop as the default application for the mime-type outputted by command adds entries to the users personal list.Ĭommand: xdg-mime default sktop $(grep MimeType /usr/share/applications/sktop | sed 's/MimeType=//' | sed 's/ / /g') ~/.local/share/applications/mimeapps.list - the users personal desktop session defaults listįrom the xdg-mime man page (man xdg-mime) xdg-mime - command line tool for querying information about file type handling and adding descriptions for new file type usr/share/applications/defaults.list - the system defaults list. you type "editor myFile.txt" in the console.Īt file level, there are two lists of importance:.the result means you can your chosen default will be used to open the file when for example:.I always thought that editor was usually reserved for text-based editors like vi, vim, nano, etc, but I have just checked and this seems to work as well.adds geany (a GUI application) to the alternative editor list and sets it as default. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |