0

I'm using Gnome 3.30 and beyond org.gnome.Terminal.desktop, I have two additional .desktop files with Exec=gnome-terminal --window-with-profile=XXX, where profile XXX uses custom command ssh kalle@XXX, so I can easily open terminals to work on my other machines.

What I don't like, especially when working with multiple terminal windows for each of the local and the other machines, is the fact that all windows are associated with the icon of org.gnome.Terminal.desktop.

Is there a way to get each window associated with the icon it belongs to?

BTW: I had the same issue when I started using an Eclipse version that was still under development. To be safe, I kept the previous, stable version and created another .desktop file for the new one. When I started both to copy and paste the software sites from the old to the new one, both windows were associated with the icon of the old one, although, as opposed to the gnome-terminal issue, these were different applications. Even renaming one of the two executables didn't change anything.

1

I found a solution. Since 'org.gnome.Terminal' sounds like a D-Bus service name, I took a look at the syslog after opening a terminal. The important part is:

dbus-daemon: Activating via systemd: service name='org.gnome.Terminal' unit='gnome-terminal-server.service'

I speculated that creating a new service with name 'org.gnome.Terminal.XXX' and renaming the .desktop file for machine XXX to 'org.gnome.Terminal.XXX.desktop' would do the trick, but in fact, the name of the .desktop file doesn't matter. The steps are as follows:

  1. Create new D-Bus service
    • sudo cp /usr/share/dbus-1/services/org.gnome.Terminal{,.XXX}.service
    • Modify entries
      • Name=org.gnome.Terminal.XXX
      • SystemdService=gnome-terminal-server-XXX.service
      • Exec=/usr/lib/gnome-terminal/gnome-terminal-server --app-id org.gnome.Terminal.XXX
  2. Create new Systemd unit
    • sudo cp /usr/lib/systemd/user/gnome-terminal-server{,-XXX}.service
    • Modify entries
      • Description=GNOME Terminal Server XXX
      • BusName=org.gnome.Terminal.XXX
      • ExecStart=/usr/lib/gnome-terminal/gnome-terminal-server --app-id org.gnome.Terminal.XXX
  3. Update .desktop file
    • Exec=gnome-terminal --window-with-profile=XXX --app-id org.gnome.Terminal.XXX

The --app-id option is crucial for our service name to be used instead of the built-in one.

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.