Make .destop for ZSH such that it launches zsh and remains without transfering to .desktop of gnome-terminal?

My zsh.desktop placed in /home/user/.local/share/applications acts as follows :

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.

zsh.desktop contents :

[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

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 which is not good.

Something similar happens here for two different .desktop

How I am 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.


Solution 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

Solution 2:

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/