Sample Header Ad - 728x90

Can't pin Desktop icon to dock favorites in Pop!_OS

4 votes
3 answers
3418 views
I'm using Pop!_OS 22.04. I just downloaded and installed a new app (PyCharm), but it didn't come with an icon for my dock. I created a new icon using this ~/.local/share/applications/pycharm.desktop file:
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=/opt/pycharm-2022.1.1/bin/pycharm.sh
Name=PyCharm
Icon=/home/USERNAME/Pictures/icons/pycharm.png
This seems to work great. I can see the icon I chose when I look for the app, and it opens in my dock. The only problem is that I can't seem to pin it to my dock's favorites. The "Add to Favorites" button that every other dock icon has when I right click on them doesn't appear in my new icon at all. Am I doing something wrong? Am I missing something? Is this a bug? Update: I've seen this on other apps too, but for PyCharm, turns out there's an option in the GUI to create the desktop launcher. It appears to do exactly the same thing I did (place a .desktop file in the same folder), but it also adds a few extra keys. The biggest one seems to be StartupWMClass. If that key is included, the "Add to Favorites" option appears when you right-click the icon in the dock. If the StartupWMClass key is not present, the "Add to Favorites" option is not there. Why is that? What does that option do? enter image description here
Asked by John (487 rep)
May 25, 2022, 06:04 PM
Last activity: Jul 4, 2024, 08:12 PM