This guide applies if you want to override/create the icon for an application on Ubuntu.
Terminator is a popular terminal emulator that comes with a handy screen-split feature if you are not
comfortable with the classic tmux solution. However, one thing of Terminator that put me off is its
dark-red icon -- it feels so out of place with the rest of the icons in the side bar! In contrast the
icon of Ubuntu's own Terminal app has an arguably sleekier look that fits very neatly with neighbors.
Fortunately though, Ubuntu allows replacing the icon.
Copy Terminator's *.desktop file into your home directory's ~/.local/share/applications:
$ cp /usr/share/applications/terminator.desktop ~/.local/share/applications/terminator.desktop
Explanations:
- In GNOME desktop environment (the GUI layer of Ubuntu) a
*.desktopfile configs how an app is to be launched, how it appears in menus, etc. A full specification of the file format is at the web page https://specifications.freedesktop.org/desktop-entry-spec/latest/ The file format is shared among the desktop environments using Wayland, a core component of Linux-based operating systems' GUI support. - If you installed Terminator normally, its
*.desktopfile will be under /usr/share/applications. - Files in directory
~/.local/share/applicationswill override the corresponding*.desktopfiles in/usr/share/applications. - Do not edit the original
usr/share/applications/terminator.desktop, as it will be restored after program upgrades. - By the way, you could create a new
*.desktopconfig in~/.local/share/applicationsfor an app if it doesn't have one already. In this file, you can designate an icon and a launch command, etc.
Edit that latter file, so that its Icon points to Terminal's icon:
$ cat ~/.local/share/applications/terminator.desktop
[Desktop Entry]
Name=Terminator
...
Icon=/usr/share/icons/Yaru/256x256/apps/org.gnome.Terminal.png
...
Explanations:
- Yaru is Ubuntu's default theme and it holds many nice-looking icon files. If the icon is not here,
you can use
/usr/share/icons/hicolor/scalable/apps/org.gnome.Terminal.svginstead. If a theme isn't present in/usr/share/icons, the directoryhicoloris the fallback to look for icons according to specification https://specifications.freedesktop.org/icon-theme-spec/latest/#directory_layout. - Only the "Icon" line needs to be modified. The rest of the file content was copied from Step 1.
- By the way, you can point this
Iconentry to a*.svgor a*.pngfile you created.
Close Terminator. You can see its icon in the side bar flashes and changes look. No reboot necessary.