Can you set an application to use a custom icon in Task Switcher?

I tried to create a .desktop file and it changed the icon in Task Manager. I saw someone online saying I also needed to specify the class of the app for the task switcher to pick it up and reboot the machine. It didn’t work for me.

Icon=/home/ShellShine/Pictures/Icons/myapp.png
StartupWMClass=myapp

Easiest way to change the icon for an application is to have a desktop entry file with the icon (see below for quick way to create one), then create a window rule to assign that to the application that you want:

  1. Launch the application you want to change
  2. In the applicate launcher type “Rules”
  3. Open the Window Rules configuration panel
  4. Click “Add New”
  5. Click “Detect Window Properties”:
  6. The cursor will change to a cross hair, use that to click on the application you want to change (that you launched in step 1)
  7. The window property popup will appear, in which click the :heavy_check_mark: for the “Window class (application)” then click the :heavy_multiplication_x: to close the popup

    In this example I’m fiddling with Dolphin, but most anything would work the same.
  8. Click “Add Property”:
  9. In the “Add property” popup that opens, search for “desktop” and click on “Desktop file name”
    image
  10. After the popup closes, edit the text of the “Desktop file name” to be the name of the desktop entry file you created before (just the file name, without the .desktop extension and without a directory path). You can leave the “Apply initially” setting or change it to “Force” - either will work
    image
  11. Click “Apply” and close the configuration panel.

Now when you launch the application again it will have the icon from your custom desktop entry file - in its window icon as well as in the task manager and wherever application icons are showing.

Custom Desktop Entry File

  1. In the application launcher search and run the “Menu Editor” application.
  2. From the tree on the left side of the menu editor, select a category you don’t care about - I recommend “Lost & Found” - then click “New Item”.
  3. In the popup that opens, type in the unique name that you want to use for your custom desktop entry file - just the name, don’t put in an extension and do not put any spaces or funky characters. Things that look like domain names in reverse are best suited for this purpose, like Dolphin in the above example is “org.kde.dolphin”.
  4. The editor on the right side of the window will open with your new desktop entry file. Click the large square button on the top right and select an icon you want to use.
  5. Click “Save” and close the Menu Editor.

The name that you typed in step 3 is what you need to use for the “Desktop file name” window rule property.

2 Likes

did you try using right click on your creation and Edit Application from the Application menu?

it’s super easy to change an icon that way.

Awesome! Worked like a charm! Now I can enjoy a non-pixelated icon when running an older application that hasn’t kept up with the times.

Thank you for the help. This is why I enjoy KDE. Great options to customize things and a great community.

Hi, I tried right clicking on the application.
And I got into the Edit Application, then
General , Permissions, Application, Details.
Then
I went to Application,
and then Advanced Options
but i cannot find how to change the icon.
Can you please kindly be more specific ?
I am new to Linux. And the previous post was totally convoluted to follow.
Thanks.

BNeo, I think it’s the 1st screen when u click edit application, just click the Icon and it will bring up a window where u can search for the one you want to use

1 Like

go back onto the general tab and just click on the icon.

a file choose dialog will allow you to pick another icon file anywhere on your system.

1 Like