Skip to content
Andreas Angerer edited this page Aug 19, 2015 · 27 revisions

First step: Modify the database file

We use a csv database file that contains: The application name, the application database file, the application path, and the Sni-Qt prefix

  • The application name; is shown to the user whenever an icon is modified
  • The application database file; contains the icon names and the symbolic link names.
  • The application path; for normal hardcoded applications this must be the path to the hardcoded icons. If it's a Qt application this can be a file/folder to verify that the application is installed
  • Sni-qt Prefix; See Qt Applications

Second step: Create the application database file

The database file must have the same name as the one added in the script database file. This file has the format of a csv file but does not have any extensions to avoid bad looking in Github since we don't respect line/columns numbers in some files.

1. Normal hardcoded applications

For this type of hardcoded applications, the file has to contain two columns. The icon name in the hardcoded path, and the symbolic icon name. The symbolic icon name does not need to have the extension. Example : available_19.png, hangouts-available

2. Qt applications

How do Qt indicators works?

Qt applications use the /tmp folder to store the icons, and the icons are automatically removed once the application is closed. This makes changing those icons impossible as the folders have a different name whenever you restart the application. That's why we use the patched version of sni-qt, this patched version allows us to store the icons that are in /tmp in $HOME/.local/share/sni-qt/icons.

What should I add to the database file

Each application folder in /tmp has a name like sni-qt_x-y-z the y,z changes whenever you restart the application, the x is the folder name that we need to create in $HOME/.local/share/sni-qt/icons. Inside this folder /tmp/sni-qt_x-y-z/icons/hicolor/24x24/apps you will find the icons. Each icon has a name like x-w-icon_name.png the x is the same as in the folder name, the w changes whenever the application restarts and the icon_name is the icon that you should add in $HOME/.local/share/icons/x/icon_name.png If the database file has a different name than x, the Sni-Qt prefix should have x as a value. Otherwise, you can keep it empty. PS: you can only use png icons. The database file in this case must contain: the icon name, the symbolic icon name, and the Qt script name. The qt script name is stored in /database/scripts/ and used to convert svg icons to png and copy them to the right folder name in $HOME/.local/share/sni-qt/icons/.Example : a7645681bdc53a4f4e8080546ccbb93d.png, bitcoin-indicator, qt-tray

3. Special application

Some applications like Spotify, Google Chrome or Chromium have icons hardcoded in a zip folder or a binary file. You can fix those icons by creating a script that will handle the pack, copy, unpack part. You can take a look at Spotify script to have an idea how that works. The database file in this case must contain the icon name, the symbolic icon name, the script name, and the zip/binary file. For example : spotify-linux-512.png, spotify-indicator, spotify, resources.zip

#Last step: Create a pull request If you don't know how to use git, you can open a new issue with the right information as mentioned in the first and the second step and we will do the rest for you.

Clone this wiki locally