Score:0

ssh public key files have ms publisher icon. How do I get rid of that?

de flag

Ssh public key files have ms publisher icon while I didn't install that. It is a fresh Ubuntu installation. It opens with default text editor. Why does it have that icon and how do I get rid of it?

frippe avatar
ug flag
Have you checked the default application setting for the `.pub` file extension?
elechris avatar
de flag
@frippe I cannot find it. In the default application settings tab there is no pub file listed. Only web, mail, calendar etc.
Score:0
ug flag

.pub is associated with Microsoft publisher in /usr/share/mime/packages/freedesktop.org.xml.

You can override it by installing your own mime type and associating it with *.pub under /usr/local/share/mime/packages/<some_name>.xml (system-wide) or ~/.local/share/mime/packages/<some_name>.xml (for a single user). Don't modify stuff in /usr/share/mime.

This contains info and links to how you can add to the mime database

Once the file is created, you need to update the database with:

update-mime-database <path_to_modified_mime_dir>

From man mimetype:

ENVIRONMENT
       XDG_DATA_HOME
       XDG_DATA_DIRS
           These variables can list base directories to search for data files. The shared mime-info will be expected in the "mime" sub directory of one of these directories. If these are not set, there will be searched for the following directories:

                   $HOME/.local/share/mime
                   /usr/local/share/mime
                   /usr/share/mime

           See also the "XDG Base Directory Specification" <http://freedesktop.org/Standards/basedir-spec>

update-mime-database should give you a warning if you modified a database that is in a location where the system doesn't search for mime types.

elechris avatar
de flag
My mime folder is in a different location. It is under /usr/share/mime. Without local. I ended up simply deleting all references to .pub files in there and updating the mime database to the same path. That removed the icon. You said not to modify stuff in usr/share/mime but didn't tell why so I did it anyway and it worked.
frippe avatar
ug flag
I did mention `/usr/share/mime` in my answer, though. Modifying it works temporarily, but the reason/problem is that it'll get overwritten.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.