Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: How do I change the icon for particular file, not the file type.

  1. #1
    Join Date
    Aug 2014
    Beans
    53

    How do I change the icon for particular file, not the file type.

    In Kubuntu i would like to change single .n64 file icons. But only accessing icons of a file type seems possible.
    Is there a solution?

    Greetings

  2. #2
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    4,941

    Re: How do I change the icon for particular file, not the file type.

    If you want to change the icon of a text file, I am pretty sure you have to change the icon for all text files. Otherwise, there would have to be some database of files registering the icon of each one.
    Last edited by Dennis N; July 6th, 2017 at 11:59 PM.

  3. #3
    Join Date
    Aug 2014
    Beans
    53

    Re: How do I change the icon for particular file, not the file type.

    so, my panel with .n64 files having individual icons (game covers) will remain a vision?

  4. #4
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    8,339
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: How do I change the icon for particular file, not the file type.

    I don't know about KDE, but in Gnome clicking on the icon in the Properties for the file does change the icon just for that file. Perhaps KDE does the same?

    Otherwise,
    Quote Originally Posted by alexander46 View Post
    my panel with .n64 files having individual icons (game covers)
    could be easily done by putting launchers on a panel rather than the files themselves.
    None but ourselves can free our minds

  5. #5
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    4,941

    Re: How do I change the icon for particular file, not the file type.

    Quote Originally Posted by CatKiller View Post
    I don't know about KDE, but in Gnome clicking on the icon in the Properties for the file does change the icon just for that file. Perhaps KDE does the same? Otherwise, could be easily done by putting launchers on a panel rather than the files themselves.
    Very interesting. I verified in Gnome by changing a single .rtf file to have a libreoffice-writer icon. That worked, and all other .rtf files continued to display the file type's icon.

    But I found my icon change was not recognized when opening the same file in XFCE (even when the icon I changed to was available). It reverted to the icon for the file type. Also, in XFCE desktop, there is no option to change the icon for a file in Properties - it simply displays the icon. Don't know the facts about KDE.

    How is it done in Gnome? Does Gnome record some metadata in the file itself? Or some database of files with custom icons that is checked?

  6. #6
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    8,339
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: How do I change the icon for particular file, not the file type.

    Quote Originally Posted by Dennis N View Post
    How is it done in Gnome? Does Gnome record some metadata in the file itself? Or some database of files with custom icons that is checked?
    I'm afraid I don't know. Gnome does keep information about files all over the place. It does keep thumbnails for media files, so it's possible that it's tied in to that in some fashion.

    It might be a Nautilus thing rather than strictly a Gnome thing, too.
    None but ourselves can free our minds

  7. #7
    Join Date
    Aug 2014
    Beans
    53

    Re: How do I change the icon for particular file, not the file type.

    Perhaps KDE does the same?
    Nope..

    could be easily done by putting launchers on a panel rather than the files themselves
    You mean, there is something like a dummy that points to the file in a manner to open it?
    Where can i find this 'launcher'?

    Greetings

  8. #8
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    8,339
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: How do I change the icon for particular file, not the file type.

    Quote Originally Posted by alexander46 View Post
    You mean, there is something like a dummy that points to the file in a manner to open it?
    Where can i find this 'launcher'?
    It's done through .desktop files. They're simply text files with the correct filename extension and header. They're used for menu entries and such. You can specify the command that gets run (in this case, your emulator with a particular file, presumably) and the icon that gets displayed and a whole bunch of other stuff. If you're curious about the details, you can read through the freedesktop.org specification. .desktop files are specifically cross-platform: that's what the freedesktop organisation is for.

    Per-user applications are generally stored in ~/.local/share/applications. System-wide applications are generally stored in /usr/share/applications. Copying one of those files and modifying it with a text editor to suit your needs would probably be the easiest way.

    I haven't used KDE, so I don't know the best way to display a panel of specific application launchers, but I'm sure you can figure that bit out yourself now that you know the facility exists. In Gnome you can generally just drag-and-drop launchers around.
    Last edited by CatKiller; July 7th, 2017 at 09:10 PM.
    None but ourselves can free our minds

  9. #9
    Join Date
    Aug 2013
    Beans
    4,395

    Re: How do I change the icon for particular file, not the file type.

    Write a script to open the file, make it executable and then make a .desktop file with whatever icon you choose pointing to the script (instead of the file itself)

  10. #10
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    8,339
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: How do I change the icon for particular file, not the file type.

    No need to write a script; the Exec= line would have
    Code:
    Exec=myN64emulator /path/to/particular/N64-game-file.n64
    Obviously you'd use whatever syntax the program you're launching would use.

    For example, here's my launcher for the Steam game Guns of Icarus, that I happened to include in a different post:

    Code:
    [Desktop Entry]
    Name=Guns of Icarus Online
    Comment=Play this game on Steam
    Exec=steam steam://rungameid/209080
    Icon=steam_icon_209080
    Terminal=false
    Type=Application
    Categories=Game;ActionGame;
    As you can see, it launches steam with the GameID passed as a parameter, using steam's own syntax. Anything that you can run from the command line you could also put into a .desktop file.
    Last edited by CatKiller; July 7th, 2017 at 09:23 PM.
    None but ourselves can free our minds

Page 1 of 4 123 ... LastLast

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
  •