Results 1 to 9 of 9

Thread: .desktop files

  1. #1
    Join Date
    Aug 2013
    Beans
    84

    .desktop files

    Hi all,

    I'm trying to create a .desktop file to run Minecraft. The exec line works, but for some reason, using an absolute path for the icon no longer works in 13.10 (it used to in previous releases).

    Consequently, I need to know where a .desktop file 'looks' for its icon (i.e. what it does if no absolute path is specified). My current way of creating a .desktop is to cp skype.desktop over, edit for minecraft, then mv back into /usr/share/applications. By default, Skype just specifies:

    Code:
    Icon=skype.png
    In my created minecraft.desktop file, it reads:

    Code:
    Icon='/home/user/.minecraft/favicon.png'
    (I got my favicon.png from extracting the .jar, opening the folder and copying it over).

    Currently, I've gone an unappealing grey box.

    Help appreciated!

    EDIT: I found this via Google (see here):

    Icon – specifies the icon to be used. This entry supports both icons supported under the FreeDesktop Icon Theme Specification (which I haven’t yet fully grokked) as well as absolute paths.
    This doesn't seem to be true? Am I making some really dopey mistake?
    Last edited by Andrew_Lucas; December 23rd, 2013 at 11:43 PM.

  2. #2
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: .desktop files

    I hope the line Icon='/home/user/.minecraft/favicon.png' is not actually what you typed in the .desktop file? You need to use your real username, not the word user.

    Apologies if you know this already, but I thought it worth mentioning.
    Last edited by ajgreeny; December 24th, 2013 at 12:49 AM.

  3. #3
    Join Date
    Aug 2013
    Beans
    84

    Re: .desktop files

    Quote Originally Posted by Andrew_Lucas View Post

    Code:
    Icon='/home/user/.minecraft/favicon.png'
    Quote Originally Posted by ajgreeny View Post
    I hope the line Icon='/home/user/.minecraft/favicon.png' is not actually what you typed in the .desktop file? You need to use your real username, not the word user.

    Apologies if you know this already, but I thought it worth mentioning.
    Yeah of course. Just felt a bit weird about posting the username of my little sister.

  4. #4
    Join Date
    Aug 2013
    Beans
    84

    Re: .desktop files

    Found my sound solution. For some reason, 'path' or "path" breaks it, whereas path alone is fine.

    Anyone think this is worth filing a bug report over?

  5. #5
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: .desktop files

    Hm! Interesting.

    I admit I did not notice the 'path' quote marks, apostrophes, backticks, or whatever they were in your file, but it would be interesting to see what happens if you used double quote marks instead, ie "path" rather than 'path'.

    I shall try it now and report back.

    OK, I have just tried that out. No, it will not work with double quotes either.

  6. #6
    Join Date
    Dec 2007
    Beans
    12,521

    Re: .desktop files

    @Andrew, this thread is marked "Solved". Maybe you can reverse that if you still don't have a solution?

  7. #7
    Join Date
    Aug 2013
    Beans
    4,941

    Re: .desktop files

    Quote Originally Posted by vasa1 View Post
    @Andrew, this thread is marked "Solved". Maybe you can reverse that if you still don't have a solution?
    He has a solution: remove the quotations around the path.

  8. #8
    Join Date
    Dec 2007
    Beans
    12,521

    Re: .desktop files

    And looking at .desktop files in /usr/share/applications, the line for icons doesn't have any quotes or backticks:
    Icon=/usr/share/xombrero/xombreroicon64.png
    Icon=transmission
    Icon=google-chrome

    Also see table 2 here: http://standards.freedesktop.org/des...ec-latest.html

    I'm interested in an answer as well because I want Leafpad to have a unique icon like Geany and Medit have.

  9. #9
    Join Date
    Dec 2007
    Beans
    12,521

    Re: .desktop files

    Quote Originally Posted by monkeybrain20122 View Post
    He has a solution: remove the quotations around the path.
    Makes sense. They weren't needed.

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
  •