GNOME has a wonderful feature of grouping applications in the Alt+Tab menu. Pressing Alt+Tab lets you quickly switch from Terminal to Firefox, without having to iterate through each of your multiple Terminal or Firefox windows.

The issue is that not all Terminal windows are equal. Perhaps you’ve got specific dev tools you want separated from other Terminals. In my case, I use mutt for email, and I want to be able to quickly Alt+Tab to my email without having to sift through a half-dozen terminals I’m using for other things.

Think of it like when a browser lets you install a website as an “App” – You can Alt+Tab directly to a GMail window, instead of having to find a specific browser tab in a specific browser window. GMail also gets it’s own icon on your task bar.

Brief History

I’ve written about this before, but the short version is:

  • Most GNOME software does this simply with --class and --name for older X11 applications, and --gapplication-app-id for newer GNOME wayland applications (I’m sure KDE has similar args, but I’m not using that)
  • gnome-terminal < GNOME 3.8 requires some extra steps to bypass the client-server model used to manage terminal processes (--disable-factory)
  • gnome-terminal >= GNOME 3.8 switched to using some sortof dbus activation, which required additional hacks to configure a new DBUS service
  • gnome-terminal at some later date (in late 2016) switched to also using a systemd service that needed to be set up

At some point in the last few releases, the above stopped working again, and I’m tired of troubleshooting.

Though I’ve generally been happy with gnome-terminal for the last 25 years, it’s probably about time to look elsewhere for a working solution.

Ptyxis

Ptyxis is a newer terminal. It has some container features I haven’t investigated (due to not using containers, currently). I guess Ubuntu uses it by default now (but I’m using Fedora). You’ll need to figure out how to pronounce Ptyxis, as well.

But perhaps most importantly, it’s really easy to change it’s app-id.

Note: My example is using a system-installed version of ptyxis. If you’ve installed via flatpak, you may need to adjust the Exec line appropriately.

Here is the .desktop file for my mutt mail:

$ cat ~/.local/share/applications/org.gnome.Ptyxis.pim.desktop 
[Desktop Entry]
Name=Mail & PIM
Comment=Mutt and Calendar
Keywords=mail;mutt;calendar
Exec=ptyxis --standalone --gapplication-app-id org.gnome.Ptyxis.pim --execute "screen -DR PIM -c ~/.screenrc-pim"
Icon=mail-send
Type=Application
StartupNotify=true

Some key details:

  • Providing a --standalone flag to separate it from any existing ptyxis sessions
  • Providing a custom --gapplication-app-id.
  • This needs to match the name of the .desktop file to match correctly
  • Things get funny if you don’t have periods in this, hence why I just added .pim to Ptyxis’ default app-id.
  • custom command with --execute

And, most importantly: THAT’S IT.

  • No custom dbus services

  • No custom systemd units

Just run the “Mail and PIM” application, and it’s got it’s own icon separate from your Terminal.

What does it look like

The actual application looks like mutt in a terminal, so no need to show that.

The Alt+Tab menu shows the separate app entry, though:

Screen Capture of Alt+Tab Menu showing Mail and PIM separate from Terminal

Additionally, it has it’s own icon in the dock, like the above.

GNOME Terminal

🫡

$ sudo dnf remove gnome-terminal

GNOME Console

To be honest, there’s another new GNOME Terminal: Console.

I’ll be honest, I didn’t spend a whole lot of time looking at it for a very silly reason: I’ve got over two decades of typing “T<Enter>” to run a Terminal.

Future Changes

It actually looks like things could possibly get even easier in the future. There’s a freedesktop proposal that includes app-id. I’m not sure if it will get merged, but if it does, this could make my “PIM” (theoretically) run in your default terminal, instead of ptyxis specifically.

Although it looks like little movement has happened on that spec.

Ptyxis is compliant with this spec (how I found it), though I’m not sure how to actually use it yet.