0

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.

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
    Commented Nov 25, 2017 at 11:48

2 Answers 2

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/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .