Slider

Hack Nemo Folder Color Switcher

 The ability to change folder color is a cool option to highlight important folders without using emblems. Nemo the default file manager of the Cinnamon desktop environment comes with the nemo-folder-color-switcher plugin that works well with the default icon theme but does not support any other icon themes. In this article, you will learn a hack to enable folder color switcher for any icon themes you are using.

To keep the changes minimal, the theme you want to use must have multi-color folders. In addition, it should also follow the following naming standard:

For lighter icons: <Theme-Name>-<Color>. For example,  Mint-Y-Blue, Mint-Y-Yellow, etc. For darker icons: <Theme-Name>-Dark-<Color>. For example, Mint-Y-Dark-Blue, Mint-Y-Dark-Yellow, etc. If your icon theme, does not have this naming standard, rename it first.

In this article, we use a modified version of the famous WhiteSur icon theme. The change includes the naming standard and custom folder icons with more colors than the original WhiteSur theme.

Let's start with installing the theme.

Step 01:
Clone the theme repository in your system.

git clone https://github.com/linuxedo/WhiteSur-Icons.git

Instead, you can also use the download button to download the master branch, extract the zip file and rename it to WhiteSur-Icons.

Step 02:
Install all color variations of the theme.
cd WhiteSur-Icons
./install.sh -t all


Step 03:
Now you can choose any of the following WhiteSur icon themes from the Settings dialog.
  • WhiteSur
  • WhiteSur-Aqua
  • WhiteSur-Black
  • WhiteSur-Dark
  • WhiteSur-Dark-Aqua
  • WhiteSur-Dark-Black
  • WhiteSur-Dark-Green
  • WhiteSur-Dark-Grey
  • WhiteSur-Dark-Orange
  • WhiteSur-Dark-Pink
  • WhiteSur-Dark-Purple
  • WhiteSur-Dark-Red
  • WhiteSur-Dark-Sand
  • WhiteSur-Dark-Yellow
  • WhiteSur-Green
  • WhiteSur-Grey
  • WhiteSur-Orange
  • WhiteSur-Pink
  • WhiteSur-Purple
  • WhiteSur-Red
  • WhiteSur-Sand
  • WhiteSur-Yellow


Step 04:
This is the time for the hack. Open the nemo-folder-color-switcher.py script with root privilege.
sudo vi /usr/share/nemo-python/extensions/nemo-folder-color-switcher.py


Step 05:
Search for KNOWN_THEMES. If you are using Vim, type /KNOWN_THEMES and hit Enter.


Step 06:
Append the following key-value pairs to the dictionary as shown below. Change the theme name and default folder color according to your theme.
            'WhiteSur': 'Blue',
            'WhiteSur-Dark': 'Blue'
Note the leading spaces and the comma after the last line. After adding your theme, the KNOWN_THEMES dictionary should look like this:
    KNOWN_THEMES = collections.OrderedDict({
        'Mint-X-Dark': 'Green',
        'Mint-X': 'Green',
        'Mint-Y-Dark': 'Green', # falls back to Mint-Y itself, but has color variants
        'Mint-Y': 'Green',
        'Rave-X-CX': 'Beige',
        'Faience': 'Beige',
        'gnome': 'Beige',
        'Matrinileare': 'Beige',
        'menta': 'Green',
        'mate': 'Beige',
        'oxygen': 'Blue',
        'WhiteSur': 'Blue',
        'WhiteSur-Dark': 'Blue'
    })

Step 07:
Save all the changes and close the editor.
In Vim, type :wq and hit Enter to save the changes and quit the editor.

Step 08:
Quit the Nemo file manager by running the following command and open it again by opening any folders.
nemo -q



Step 09:
Change the icon theme to any of the WhiteSur icon theme. If you are using any other themes following the same naming standard, select that icon theme.

Step 10:
Right-click on any folder; you will see the option to change the color.

If you have any issues with getting this solution working, or if you find this useful, please leave a comment below.

0

No comments

Post a Comment

disqus,linuxedo

DON'T MISS

News,Linuxedo
© all rights reserved