[SOLVED] Read and Store FolderColours

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
AfterEighty
Level 1
Level 1
Posts: 3
Joined: Mon Oct 15, 2018 4:13 pm
Location: Netherlands

[SOLVED] Read and Store FolderColours

Post by AfterEighty » Mon Oct 15, 2018 4:28 pm

I have a large folderstructure and invested time in colourcoding these folders. This works quite neat. Now I have been searching where this information is stored. I would like to read the colours I have set for safety (not losing the info and the work I put into it) and also to use the info in a database. If there was a utility that could just spit out the the folder names hierarchically with the colour that would be wonderfull. If there is a way to read (and set) the foldercolours using python that would be a good start for a challenge for me. Or if there is a file with the the info I could use, that could do it for me. Right now I have no idea where to start. Thanks in advance.
Last edited by AfterEighty on Wed Oct 17, 2018 2:12 pm, edited 2 times in total.

gm10
Level 12
Level 12
Posts: 4192
Joined: Thu Jun 21, 2018 5:11 pm

Re: Read and Store FolderColours

Post by gm10 » Mon Oct 15, 2018 5:23 pm

That's a nemo extension, right? I don't have that one but I would expect it to store the info as an extended file attribute. Try this:

Code: Select all

gio info /path/to/folder
and see if you can spot it, there's likely some metadata:: tag for the colours.

User avatar
smurphos
Level 8
Level 8
Posts: 2050
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Read and Store FolderColours

Post by smurphos » Tue Oct 16, 2018 2:35 am

gm10 wrote:
Mon Oct 15, 2018 5:23 pm
That's a nemo extension, right? I don't have that one but I would expect it to store the info as an extended file attribute. Try this:

Code: Select all

gio info /path/to/folder
Good call, learnt something new :)

Code: Select all

$ gio info ~/plex_server_drive | grep metadata::custom-icon
metadata::custom-icon: file:///usr/share/icons/Mint-Y-Pink/places/48/folder.png
To set via the command line...

gio set ~/plex_server_drive metadata::custom-icon file:///usr/share/icons/Mint-Y-Blue/places/48/folder.png

gm10
Level 12
Level 12
Posts: 4192
Joined: Thu Jun 21, 2018 5:11 pm

Re: Read and Store FolderColours

Post by gm10 » Tue Oct 16, 2018 2:45 am

smurphos wrote:
Tue Oct 16, 2018 2:35 am
Good call, learnt something new :)
Taught something to you? About Cinnamon theming? Just a sec, I'll need to carve the date into my wall. :lol:

And I learned that your extension is just about a Mint-Y icon, not a freely selectable color. Probably the best use you can make of all those Mint-Y icon sets. Should be possible to create an extension that creates a tinted icon from the set you're actually using though, don't you think? Just in case you were looking for a project. ;)

AfterEighty
Level 1
Level 1
Posts: 3
Joined: Mon Oct 15, 2018 4:13 pm
Location: Netherlands

Re: Read and Store FolderColours

Post by AfterEighty » Tue Oct 16, 2018 4:23 pm

Thanks for the replies! The solution seemed so simple and just what i needed. I fired up the terminal and tried. ... okay cannot find gio, that should not be too hard, should it? Well I have been searching and trying for more than an hour and a half. I just cannot find how to install gio. I seem to have some related stuff installed, glib-networking. And a gir1.2-glib-2.0 that seems old, but gio command is not recognized.

gm10
Level 12
Level 12
Posts: 4192
Joined: Thu Jun 21, 2018 5:11 pm

Re: Read and Store FolderColours

Post by gm10 » Tue Oct 16, 2018 4:36 pm

AfterEighty wrote:
Tue Oct 16, 2018 4:23 pm
Thanks for the replies! The solution seemed so simple and just what i needed. I fired up the terminal and tried. ... okay cannot find gio, that should not be too hard, should it? Well I have been searching and trying for more than an hour and a half. I just cannot find how to install gio. I seem to have some related stuff installed, glib-networking. And a gir1.2-glib-2.0 that seems old, but gio command is not recognized.
You must be running a very old version of Mint. You should be able to do this instead then, this was the predecessor of gio:

Code: Select all

gvfs-info /path/to/folder

User avatar
smurphos
Level 8
Level 8
Posts: 2050
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Read and Store FolderColours

Post by smurphos » Tue Oct 16, 2018 11:53 pm

libglib2.0-bin is the package that provides gio in Mint 19. It doesn't exist in the 18.x version of libglib2.0-bin

AfterEighty
Level 1
Level 1
Posts: 3
Joined: Mon Oct 15, 2018 4:13 pm
Location: Netherlands

Re: Read and Store FolderColours

Post by AfterEighty » Wed Oct 17, 2018 2:09 pm

Thanks again!
LOL. I am running 18.3 (Sylvia). That is not that old.
Anyway what counts is that you put me right back on track. Now I know where to look I see additional commands to be discovered and put to use!

gm10
Level 12
Level 12
Posts: 4192
Joined: Thu Jun 21, 2018 5:11 pm

Re: Read and Store FolderColours

Post by gm10 » Wed Oct 17, 2018 2:11 pm

AfterEighty wrote:
Wed Oct 17, 2018 2:09 pm
Thanks again!
LOL. I am running 18.3 (Sylvia). That is not that old.
No, it's not. When posting I could have sworn that gio existed on 18.3 but apparently my memory failed me. I my defense, it's not a command I need often, so I'm glad I even remembered them both. ;)

Post Reply

Return to “Newbie Questions”