Folder icons with a green dot. How to do it?
Folder icons with a green dot. How to do it?
Hello. In ROX filer, I wonder if there is some easy way to "mark" folders with colors, like in the Dropbox folder I have, the sync. items are marked with a green dot, even if I move the folders to another directory, the icon keeps that green dot.
I'm running tharpup and the default file manager.
I'm running tharpup and the default file manager.
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
Hallo, fernan.
Mm. Well, I'm no expert in this.....but I believe you would need to have something like the transparent overlay that goes over your 'home' partition (to be found in /usr/local/lib/X11/pixmaps - with the little house icon in the top-right corner) and then 'link' that to each folder that's marked as being a Dropbox-synced folder).
The icon's easy enough to do. Just copy, then modify the icon marked 'locked_outline48.png' with something like mtPaint (which can work with SVG transparent images). You'd need to remove the house image, and then add a green dot (or whatever you want to use for the 'synced' folders. Then give it a unique name (something like, oh, I don't know.....'dropbox_marker48.png', perhaps)..?
The '48' identifier is simply because ROX automatically resizes standard system icons to 48x48 pixels...
The tricky part would be how to 'add' this to the 'synced' folder's icons. A script would be needed to identify these (linked somehow to the Dropbox config file, I would guess), so that it would 'stick' to them, even when moved around in the file-system. And that's the part I can't help with, I'm afraid. I wouldn't even know where to start...
But that's how I would tackle it, personally. It's quite possible somebody else can think of a simpler solution than mine. Hang in there. We'll probably think of something..!
Mike.
Mm. Well, I'm no expert in this.....but I believe you would need to have something like the transparent overlay that goes over your 'home' partition (to be found in /usr/local/lib/X11/pixmaps - with the little house icon in the top-right corner) and then 'link' that to each folder that's marked as being a Dropbox-synced folder).
The icon's easy enough to do. Just copy, then modify the icon marked 'locked_outline48.png' with something like mtPaint (which can work with SVG transparent images). You'd need to remove the house image, and then add a green dot (or whatever you want to use for the 'synced' folders. Then give it a unique name (something like, oh, I don't know.....'dropbox_marker48.png', perhaps)..?
The '48' identifier is simply because ROX automatically resizes standard system icons to 48x48 pixels...
The tricky part would be how to 'add' this to the 'synced' folder's icons. A script would be needed to identify these (linked somehow to the Dropbox config file, I would guess), so that it would 'stick' to them, even when moved around in the file-system. And that's the part I can't help with, I'm afraid. I wouldn't even know where to start...
But that's how I would tackle it, personally. It's quite possible somebody else can think of a simpler solution than mine. Hang in there. We'll probably think of something..!
Mike.
Last edited by Mike Walsh on Fri 03 Nov 2017, 00:04, edited 1 time in total.
Hello Mike.
What I tried to ask, was to do what "Dropbox" already does. The syncronyzed files and folders are marked automatically with that green dot. I think if we could see how this is done, we could "mark" folders by hand, as you do in Mac OSX, with colored dots.
What I tried to ask, was to do what "Dropbox" already does. The syncronyzed files and folders are marked automatically with that green dot. I think if we could see how this is done, we could "mark" folders by hand, as you do in Mac OSX, with colored dots.
- Attachments
-
- capture32535.png
- (24.92 KiB) Downloaded 256 times
-
- capture923.png
- (51.95 KiB) Downloaded 71 times
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
Hi again, fernan.
Upon reflection, there is another method you could use. It's not so obvious (no 'green dots'), but it would keep all your Dropbox-synced folders together in one place.....and you would know which they are.
It's one I use myself for the Syncthing local file-syncing application I use on my small LAN. You would put all your Dropbox folders into a 'common' folder (marked 'Dropbox', obviously), which can then be placed at /mnt/home. Or better still, on a separate DATA partition (if you use one). Or, even better, on a flash-drive, plugged permanently into your computer, and set to auto-mount at boot.
You'd then sym-link these into /root. That way, Puppy would 'see' them', but they wouldn't be filling up your save-file/folder. You could then re-name the sym-links with a '-D', or '(D)', or something similar, at the end of the name, in /root. (You can do this with sym-links, without it affecting the name of the item it's linked to).
For instance, 'my-documents(D)'.
'Downloads(D)'.
Etc., etc.
Not perhaps such an elegant solution, but it wouldn't need all that messing around with the icons, nor require new scripts to be created (or existing ones modified).....and could be implemented fairly quickly & simply.
Just an idea.....
Mike.
Upon reflection, there is another method you could use. It's not so obvious (no 'green dots'), but it would keep all your Dropbox-synced folders together in one place.....and you would know which they are.
It's one I use myself for the Syncthing local file-syncing application I use on my small LAN. You would put all your Dropbox folders into a 'common' folder (marked 'Dropbox', obviously), which can then be placed at /mnt/home. Or better still, on a separate DATA partition (if you use one). Or, even better, on a flash-drive, plugged permanently into your computer, and set to auto-mount at boot.
You'd then sym-link these into /root. That way, Puppy would 'see' them', but they wouldn't be filling up your save-file/folder. You could then re-name the sym-links with a '-D', or '(D)', or something similar, at the end of the name, in /root. (You can do this with sym-links, without it affecting the name of the item it's linked to).
For instance, 'my-documents(D)'.
'Downloads(D)'.
Etc., etc.
Not perhaps such an elegant solution, but it wouldn't need all that messing around with the icons, nor require new scripts to be created (or existing ones modified).....and could be implemented fairly quickly & simply.
Just an idea.....
Mike.
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
Mm. Oh, I grant you, it looks simple enough.....but I can almost guarantee it'll require modifications to existing scripts, plus the use of icon 'overlays'.fernan wrote:Hello Mike.
What I tried to ask, was to do what "Dropbox" already does. The syncronyzed files and folders are marked automatically with that green dot. I think if we could see how this is done, we could "mark" folders by hand, as you do in Mac OSX, with colored dots.
In your ROX screenshot, you say Dropbox is already doing that.....automatically? In that case, I'm a wee bit lost; what exactly is it that you want to do, again?
Mike.
Hello.
I'd like to "mark" folders with the file manager, outside the "Dropbox" folder. Since Dropbox software does it automatically, I think it's possible to do it by hand on other files and folders.
I'd like to know how this is done by Dropbox, to see a way to implement it. As said , this marked files keep the green dot even when moved outside the original folder to any other place in the filesystem.
I'd like to "mark" folders with the file manager, outside the "Dropbox" folder. Since Dropbox software does it automatically, I think it's possible to do it by hand on other files and folders.
I'd like to know how this is done by Dropbox, to see a way to implement it. As said , this marked files keep the green dot even when moved outside the original folder to any other place in the filesystem.
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
It appears that these tiny green dots are automatically applied by ROX-Filer to directories/files that have extended attributes set. I've never seen these dots, mainly because my filesystem does not support extended attributes and I can't verify which, if any, attributes trigger these dots.fernan wrote:The syncronyzed files and folders are marked automatically with that green dot. I think if we could see how this is done, we could "mark" folders by hand
ROX stores its overlay icons in /usr/local/apps/ROX-Filer/images and rox-xattr.png would be the one you are interested in. More common are rox-mounted.png or symlink.png. ROX lays these icons over icons representing files of certain mime types. If you change these overlay icons to bigger icons, ROX will scale them down so that they don't cover the underlying main icons. You need to restart ROX to see the effects. I don't know dropbox, but I assume that it makes use of extended attributes and that ROX consequently adds the dots. You could experiment with extended attributes (using chattr ) and see if ROX reacts or you could use lsattr to examine the attributes of your "dotted" files.
A completely different approach would be to "mark" directories (not regular files) with special icons. A .DirIcon file would have to be added to each directory. This would be relatively easy and more flexible but would require some scripting.
- Attachments
-
- ROX_compound_icons.png
- (70.74 KiB) Downloaded 225 times
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
@MochiMoppel:-
In fact, I can'r discover this particular directory in a single one of more than 10 Pups.....with the exception of Tahr 32 (but there's no 'images' there.) Are you sure your location's correct, Mochi?
(Hm. Even more curious; what the hell is 'quickpet_precise' doing in Tahr64's /usr/local directory? What on earth did Phil do here?)
Mike.
Interesting. I'm currently in Tahr64.....and the directory you mention doesn't even exist. In /usr/local/apps are the app-links.....and nothing else. There is no directory titled 'ROX-Filer'(just a ROX-Filer runlink), so.....where might these overlays be hiding in Tahr64?MochiMoppel wrote:ROX stores its overlay icons in /usr/local/apps/ROX-Filer/images and rox-xattr.png would be the one you are interested in.
In fact, I can'r discover this particular directory in a single one of more than 10 Pups.....with the exception of Tahr 32 (but there's no 'images' there.) Are you sure your location's correct, Mochi?
(Hm. Even more curious; what the hell is 'quickpet_precise' doing in Tahr64's /usr/local directory? What on earth did Phil do here?)
Mike.
You need to "right click" on the directory titled 'ROX-Filer', and choose "look inside".Mike Walsh wrote:@MochiMoppel:-
Interesting. I'm currently in Tahr64.....and the directory you mention doesn't even exist. In /usr/local/apps are the app-links.....and nothing else. There is no directory titled 'ROX-Filer'(just a ROX-Filer runlink), so.....where might these overlays be hiding in Tahr64?MochiMoppel wrote:ROX stores its overlay icons in /usr/local/apps/ROX-Filer/images and rox-xattr.png would be the one you are interested in.
In fact, I can'r discover this particular directory in a single one of more than 10 Pups.....with the exception of Tahr 32 (but there's no 'images' there.) Are you sure your location's correct, Mochi?
(Hm. Even more curious; what the hell is 'quickpet_precise' doing in Tahr64's /usr/local directory? What on earth did Phil do here?)
Mike.
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Adding to MochiMoppel's info, extended attributes can refer to ext2 file system attributes (man lsattr) and, confusingly, extended attribute name-value pais (man xattr). Those are different, and many puppies don't include the latter. Fatdog64:
Rox adds the rox-xattr.png overlay icon when xattrs are set (setfattr).
Code: Select all
# lsattr ~/Downloads/a.iso
-------------e-- /root/Downloads/a.iso
# getfattr ~/Downloads/a.iso
getfattr: Removing leading '/' from absolute path names
# file: root/Downloads/a.iso
user.xdg.origin.url
user.xdg.referrer.url
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]
Lets' backup two steps. Those icons with the green (or red) dot are created internally by ROX, by overlaying a normal directory icon with a separate small image of the dot. ROX does this automatically for *mount points* -using a green dot for 'mounted' and a red dot for 'unmounted'
Prove it to yourself:
Create an ordinary directory and leave it empty. Browse to the location with ROX and you'll see it shows a normal directory icon. Now, temporarily mount some drive you have connected to that dir -I mean mount it to that directory. Refresh ROX, if necessary -for old versions you might have to browse away from the location and back to it to do this. Anyway, once ROX has refreshed, you'll see that the dir icon now has a green dot. Then, if you unmount the drive the icon probably will disappear. ROX reads mtab and/or fstab, so any mount-points/drives listed in fstab will retain their icons. I mean, that if there's an entry in fstab for a drive -rox will show it as a mount-point -with a red dot if currently unmounted, green dot if mounted.
Prove it to yourself:
Create an ordinary directory and leave it empty. Browse to the location with ROX and you'll see it shows a normal directory icon. Now, temporarily mount some drive you have connected to that dir -I mean mount it to that directory. Refresh ROX, if necessary -for old versions you might have to browse away from the location and back to it to do this. Anyway, once ROX has refreshed, you'll see that the dir icon now has a green dot. Then, if you unmount the drive the icon probably will disappear. ROX reads mtab and/or fstab, so any mount-points/drives listed in fstab will retain their icons. I mean, that if there's an entry in fstab for a drive -rox will show it as a mount-point -with a red dot if currently unmounted, green dot if mounted.
I see, looking at file properties , it says "extended attributes: present" on the files with the green dot, and not present in the regular files.
Now the question is: can I manage those attributes, and what attributes should I set to make Rox to overlay some image?, let's say colored dots or change to colored icons.
Now the question is: can I manage those attributes, and what attributes should I set to make Rox to overlay some image?, let's say colored dots or change to colored icons.
Sorry -sort of. That's something new, I believe in newer versions of rox than the one I use and have studied the sources.
Anyway, xattr (extended attributes) support is filesystem-dependent. Not all FS's support it, and not all software will use it. attr and xattr libraries may be hard requirements of some basic system software, likeacl, fdisk, extfs-tools and others, so they may be present and necessary on your system.
For changing normal attributes, use the tool 'attr', 'getfattr' and 'setfattr'. I'll speculate that 'xattr' & Co. is what you are looking for.
I'm pretty sure that anything on an sfs -which is much of P, will not support this, but try and tell us what happens.
You could also use mount to 'bind' those dirs so rox would see them as mount points and use dots. You could also create a .DirIcon (hidden *.png or *.xpm) inside the directory which will make it display any image you like. For anything more then you'd need to make the dir into a ROX AppDIr -with an icon, an AppInfo.xml and an AppRun script (which could even be a dummy).
Anyway, xattr (extended attributes) support is filesystem-dependent. Not all FS's support it, and not all software will use it. attr and xattr libraries may be hard requirements of some basic system software, likeacl, fdisk, extfs-tools and others, so they may be present and necessary on your system.
For changing normal attributes, use the tool 'attr', 'getfattr' and 'setfattr'. I'll speculate that 'xattr' & Co. is what you are looking for.
I'm pretty sure that anything on an sfs -which is much of P, will not support this, but try and tell us what happens.
You could also use mount to 'bind' those dirs so rox would see them as mount points and use dots. You could also create a .DirIcon (hidden *.png or *.xpm) inside the directory which will make it display any image you like. For anything more then you'd need to make the dir into a ROX AppDIr -with an icon, an AppInfo.xml and an AppRun script (which could even be a dummy).
Indeed, .DirIcon is the way to do colorful icon folders in rox. I suggest that you create a master folder with all your icons, then for each folder that should show a different icon symlink its .DirIcon to a suitable icon in the master folder.fernan wrote:What I'd like to do is the same I do in OSX, to have different folder colors to choose and organize things. Perhaps the ".Diricon" file is the easiest way, just taking the time to make colored icons once, and then choose them from the "Set icon" contextual menu.
Code: Select all
master/
├── blue.png
└── red.png
project_1
└── .DirIcon -> ../master/red.png
project_2
└── .DirIcon -> ../master/blue.png
project_3
└── .DirIcon -> ../master/red.png
Code: Select all
/root/master
├── blue.png
└── red.png
/root/project_1
└── .DirIcon -> /root/master/red.png
/root/project_2
└── .DirIcon -> /root/master/blue.png
/root/project_3
└── .DirIcon -> /root/master/red.png
Back to your last xattr question, you can't use xattrs to display specific rox emblems. All you can do is to show the rox-xattr.png emblem. That's it. Just set _any_ xattr and rox will display the rox-xattr.png emblem on the regular file/folder icon. Remove _all_ xattrs for the file/folder and rox will hide the emblem.
Emblems aren't a substitute for .DirIcons. They look different and serve a different purpose.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Should work with any png file. How did you do it? If you use the context menu and choose "Copy image into directory" it should place a copy of your edited image, already renamed to .DirIcon, into the selected directory. The only time when this does not work for me is when I try to "diriconify" a mount point. The directory icon would not change. May be a bug. However what always works is to use the option "Only for the file <directory name>". This method does not place any icon file into the marked directory. Some advantages over .DirIcons, some disadvantages, eventually depends on your needsfernan wrote:Changed the color of one Rox icon, saved as png with a different name, and tried to use it as .DirIcon, but it doesn't work.