Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: How can I change the icons used to display filetypes in a file manager

  1. #1
    Join Date
    Mar 2008
    Beans
    115

    How can I change the icons used to display filetypes in a file manager

    I recently switched to Arc theme (from default Lubuntu) and like it a lot, but noticed that none of my .iso files show as a disc icon anymore...instead, they show as a document, blurry, and I think it's because that's the default image when there's no other icon. Not sure about that, but regardless, I'd love to edit that so that I can see a nice disc icon.

    I tried looking at the .desktop files but that seems application-based. Like if I wanted to change the VLC "construction cone" icon or something. Which I don't.

    I would like my file manager to show a disc icon whenever it's showing an .iso file. Figure this can't be too hard but haven't figured it out yet.

    Thank you!

  2. #2
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    6,999
    Distro
    Kubuntu 18.04 Bionic Beaver

    Re: How can I change the icons used to display filetypes in a file manager

    The icons that are shown for a given file type are determined by the icon theme. You can either look up the naming for your chosen icon from the freedesktop specification or just poke around with a theme that you know works. You just need icons of the right name in various sizes.

  3. #3
    Join Date
    Mar 2008
    Beans
    115

    Re: How can I change the icons used to display filetypes in a file manager

    Thank you, @CatKiller, that's helpful. So the theme I'm using, (Arc, in this case) doesn't have icons for a disk? That seems odd but is there a way to find that specifically? It's not hard to make icons, so I could manually do the graphics part. But I don't know how to add them to the right place in the theme.

  4. #4
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    6,999
    Distro
    Kubuntu 18.04 Bionic Beaver

    Re: How can I change the icons used to display filetypes in a file manager

    Quote Originally Posted by goemonburo View Post
    But I don't know how to add them to the right place in the theme.
    Icon themes go in either /usr/share/icons (for system-wide themes) or ~/.local/share/icons (for per-user themes).

    You don't necessarily need to create your own icon. If there's one you like you can just copy or symlink it to the theme you're using. Also, all themes inherit hicolor, so icons put in there will always be used if the theming system can't find one elsewhere.

  5. #5
    Join Date
    Mar 2008
    Beans
    115

    Re: How can I change the icons used to display filetypes in a file manager

    Thank you again, @CatKiller. But I am actually asking something different...obviously not explaining it well.

    What specifically do I symlink FROM to get an icon, call it /some/path/to/the/icon.png to show up as the icon when I am using the file manager?

    I understand the locations. But it seems like there's some file, call it, "default-cd-icon.png" that I need to add, change, create, or replace to make this work.

    Currently it seems my theme doesn't include that icon. So I can't symlink to a different one if it doesn't have one to start with.

    If I go to /usr/share/icons there are a dozen different folders, each for a specific theme. Inside those folders are more folders. If I want /some/path/to/the/icon.png to be the icon that's used, which folder do I use? In my "/usr/share/icons/Tango/scalable/devices" folder there are a number of cd-like icons I can use. But I don't know where to link that. I suspect I have to find some file that defines a ".iso" filetype, and change that file to point to /some/path/to/the/icon.png. No? If so...how do I do that.

    I hope that makes more sense?

  6. #6
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    4,343

    Re: How can I change the icons used to display filetypes in a file manager

    The file type icons are derived from the mime type of the file.

    Get mime type of .iso file by right click > Properties. Look for MIME type. The iso files are probably using MIME type application/x-cd-image.

    Look at mimetypes folder in your theme folder to locate the image file for this mime type. My icon theme is Paper:

    Code:
    dmn@Tyana-vm:/usr/share/icons/Paper/48x48/mimetypes$ ls | grep x-cd-image
    application-x-cd-image.png
    This matching .png is what is providing the image. It may exist in various sizes. You can check folders for other icon sizes and scalable (if it exists) as well. Some sizes (like 32x32) won't have an icon. An algorithm selects the best size for the icon from what sizes are available. You could substitute an icon from another theme, or resize an existing size to provide a missing size.

    Note: I used Lubuntu 19.10 for the above information and output
    Last edited by Dennis N; 1 Week Ago at 08:33 PM.

  7. #7
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    6,999
    Distro
    Kubuntu 18.04 Bionic Beaver

    Re: How can I change the icons used to display filetypes in a file manager

    Quote Originally Posted by goemonburo View Post
    Thank you again, @CatKiller. But I am actually asking something different...obviously not explaining it well.

    What specifically do I symlink FROM to get an icon, call it /some/path/to/the/icon.png to show up as the icon when I am using the file manager?
    From whichever theme you were using before, or whichever other theme you like that does provide an icon. That's why I said you should have a look at the other themes to see how it works.

    I understand the locations. But it seems like there's some file, call it, "default-cd-icon.png" that I need to add, change, create, or replace to make this work.
    That's right.

    Currently it seems my theme doesn't include that icon. So I can't symlink to a different one if it doesn't have one to start with.
    Your symlink in that theme would be to the equivalent location in a different theme. Or copied from the other theme. So when the theming system requests the icon, there's one there.

    If I go to /usr/share/icons there are a dozen different folders, each for a specific theme. Inside those folders are more folders.
    That's right. Some themes are organised by type then size, some are organised by size then type. The index.theme file specifies how a particular theme is laid out.

    If I want /some/path/to/the/icon.png to be the icon that's used, which folder do I use? In my "/usr/share/icons/Tango/scalable/devices" folder there are a number of cd-like icons I can use. But I don't know where to link that. I suspect I have to find some file that defines a ".iso" filetype, and change that file to point to /some/path/to/the/icon.png. No? If so...how do I do that.
    No. The filename is already defined. That's all that matters. You don't need to change anything else, just provide a file of the correct name in the directories that your theme is looking in. There is a specification that lays out how the icon is retrieved, but it's terribly dull, so it's just way easier, and way quicker, to simply look at a theme you know works to see what the filename should be.

    Say you've got a launcher for Thunderbird, for example. All that needs to include is "Icon=thunderbird" and it's done. No messing about with hard-coded paths or file extensions; the correct icon at the correct size for your theme can be automatically picked just from that, and if your theme doesn't have an icon one can be chosen from the stylistically-similar ones specified in the Inherits for the theme, all the way back to hicolor. When you change theme, all the icons can just change together.

    I don't know the icon name for your MIME type, although Dennis N has pointed the way, and I'm typing from my phone so I can't check for you. You'll find it, I'm sure.
    Last edited by CatKiller; 1 Week Ago at 09:25 PM.

  8. #8
    Join Date
    Mar 2008
    Beans
    115

    Re: How can I change the icons used to display filetypes in a file manager

    @Dennis N, this was exactly what I needed. Thank you.

    So when I right click and check properties, I don't get anything that says MIME type. I do have a line that says "file type" and it's "raw cd image." So how do I sleuth out the location of that image?

    Thank you again.

    For CatKiller, I still don't understand how to determine the "correct name in the directories [my] theme is looking in." I'll mess around a bit and see if I stumble onto it. And yeah, sorry, phones aren't the best for that stuff. Thank you just the same for trying to help! I appreciate it!!

  9. #9
    Join Date
    Mar 2008
    Beans
    115

    Re: How can I change the icons used to display filetypes in a file manager

    Some further fiddling, I've gotten the INDIVIDUAL icon to change by right-clicking on the file, then going to Properties, then double clicking the icon, and selecting a different icon. (Only works in Nautilus. My main file manager, PCManFM, doesn't have that). Problem is I don't want to do this for each of my gazillion .iso files.

  10. #10
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    6,999
    Distro
    Kubuntu 18.04 Bionic Beaver

    Re: How can I change the icons used to display filetypes in a file manager

    Quote Originally Posted by goemonburo View Post
    For CatKiller, I still don't understand how to determine the "correct name in the directories [my] theme is looking in." I'll mess around a bit and see if I stumble onto it.
    That's exactly how you do it

    You know that whichever theme you were using before (or the theme that theme inherits) definitely includes an icon for that filetype (since you noticed its absence when you switched themes). That theme is either going to be structured as theme/<sizes>/<category> or theme/<category>/<sizes>. The category you're interested in is going to be called something like mimetypes or mimes; those names aren't fixed, they're whatever made sense to the person that made the theme. The file is likely to be called something like application-x-cd-image.

    Once you've identified the files (there'll be one for each size the theme provides) you can copy or symlink them into the structure of your new theme. Or, if that icon doesn't fit into the style of your new theme, find an icon that does, either online, or in a different theme, or wherever.

    There's a command that I can't remember for reloading all of the theme's icons once you've put the new files in, but logging out and logging back in will probably do the same thing.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •