0

NOT A DUPLICATE

Behavior of zsh.desktop placed in /home/user/.local/share/applications :

It opens fine when I double-click and execute, but after a few seconds the custom icon I set for zsh.desktop launcher disappears from launcher and the default icon for gnome-terminal.desktop located at /usr/share/applications appears instead and in case a gnome-terminal window was open previously they merge.

My zsh.desktop :

[Desktop Entry]
X-AppInstall-Package=gnome-terminal-y
X-AppInstall-Section=main

Name=ZSH-Terminal
Comment=Use zsh in the command line
TryExec=zsh
Exec=zsh
Terminal=true
Icon=/home/lucifer/.oh-my-zsh/zsh.png
Type=Application
StartupNotify=true
X-GNOME-SingleWindow=true
OnlyShowIn=GNOME;Unity;
Actions=New

Name[en_US]=ZSH-Terminal

[Desktop Action New]
Name=New Terminal
Exec=/usr/bin/zsh

EDIT :

What behavior is not good : If firefox stable and firefox nightly are installed side by side, you see that when you execute either one it automatically transfers into the firefox icon and this results in a common icon for both nightly and stable.

Something similar happens here for two different .desktop

How I'm hack-solving this :

There isn't a workable solution for segregating the two, what I did is to install Tilix from https://gnunn1.github.io/tilix-web/ (previously Terminix) and it runs as a separate process (PID) than gnome-terminal and then run zsh from there.

1
  • You're asking how to show different icons for same the command, but started with different arguments (plain gnome-terminal and gnome-terminal with zsh (here started automatically because Terminal=true). There are plenty of questions here asking the same for Java, for example, and other such commands which can be used to launch different programs. So yes, there's not just a possibility that this is a dupe, but it's highly likely to be one. I just can't be arsed to look one up... – muru Nov 25 '17 at 11:48
1

Replace your Exec lines with the following :

Exec=gnome-terminal --class=zsh -e zsh

use :

Terminal=false

and add the line :

StartupWMClass=zsh

The file should look like this :

[Desktop Entry]
X-AppInstall-Package=gnome-terminal-y
X-AppInstall-Section=main

Name=ZSH-Terminal
Comment=Use zsh in the command line
TryExec=zsh
Exec=gnome-terminal --class=zsh -e zsh
Terminal=false
Icon=/home/lucifer/.oh-my-zsh/zsh.png
Type=Application
StartupNotify=true
X-GNOME-SingleWindow=true
OnlyShowIn=GNOME;Unity;
Actions=New
StartupWMClass=zsh

Name[en_US]=ZSH-Terminal

[Desktop Action New]
Name=New Terminal
Exec=gnome-terminal --class=zsh -e zsh
0
1

The best way would be to run a separate Terminal Emulator (Tilix) since it will be using a separate PID and process and not the gnome-terminal one, then use zsh from there and you have a totally separate icon that works for zsh.

Tilix: https://gnunn1.github.io/tilix-web/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.