Skip to content

Renaming ".desktop"-Files #523

Closed
Closed

Description

@ManIVIctorious

There is some inconsistency in file renaming regarding .desktop files.

When i rename a DESKTOP-File the filename extension ".desktop" gets added.
if i rename xyz.desktop to abc.desktop and hit enter the filename becomes to
abc.desktop.desktop

Please change this behaviour, it is really anoying

Activity

  1. gauravjuvekar commented on Jan 29, 2014

    @gauravjuvekar
    Contributor

    Actually, when creating a new abc.desktop file by right-click->Create new document-> empty document, a (blank )text file with filename "abc.desktop" and no extension gets created. When renaming it, the extension ".desktop" is added and

    [Desktop Entry]
    Name[en_US]=abc
    

    gets added to the file.

  2. cjvolkert commented on Jan 30, 2014

    @cjvolkert

    When I'm creating a .desktop file by terminal with "gedit test.desktop &" and save this file with some text I can't rename the file at all. But when I'm saving the file empty renaming is possible.

  3. highwindmx commented on Mar 28, 2014

    @highwindmx

    I have a related issue, not only can't rename but there is even no way to review the name of this desktop file in nemo
    screenshot e
    Just take a look at above.
    I think may be the method of editing desktop file should be improved in nemo.

    Thank

  4. xenopeek commented on Oct 8, 2016

    @xenopeek

    Bug reproduced with Nemo 3.0.6 on Linux Mint 18 Cinnamon. When renaming a .desktop file, the .desktop extension is always added. So if you don't delete it when renaming the file the extension becomes ".desktop.desktop". It will add ".desktop" to the end each time you rename the file.

  5. DigitalArchon commented on Dec 2, 2025

    @DigitalArchon

    I just ran into this now, it still seems to be an issue despite being closed many years ago. You can't get rid of the .desktop when renaming a file once it has that extension, it just puts it right back.

  6. added a commit that references this issue on Oct 14, 2026
    26f76b2
  7. AngelSherry commented on Nov 10, 2026

    @AngelSherry

    Ten years later, it’s impressive how well this "fix" aged.

    Because nemo_file_rename() still assumes any file with application/x-desktop is an icon label waiting to be rewritten rather than an actual file on disk, trying to disable an autostart entry by renaming foo.desktop to foo.desktop~ (or .bak) still results in Nemo helpfully stapling .desktop right back on (foo.desktop~.desktop).

    Even better: before mangling the extension, nemo_link_local_set_text() unconditionally follows symlinks and injects Name[<locale>]=foo.desktop~ into the target .desktop file (e.g., under ~/.local/share/applications/), silently corrupting the launcher menu entry as a bonus.

    A file manager shouldn't forbid users from changing a file extension just because it couldn't tell a trusted desktop shortcut apart from a regular file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions