syncthing-gtk icon indicating copy to clipboard operation
syncthing-gtk copied to clipboard

Overlay icons on Nautilus/Ubuntu 18.04 does not reflect .stignore

Open TechupBusiness opened this issue 4 years ago • 7 comments

When I exclude files and folders from Syncthing, they still have a normal Syncthing overlay icon which is confusing. Is it possible to have a different icon for excluded files/folders?

System: Nautilus/Ubuntu 18.04

TechupBusiness avatar Sep 06 '19 14:09 TechupBusiness

In theory, yes, but it would be pretty complicated thing to do, requiring nautilus plugin to parse and understand stignore files.

kozec avatar Sep 07 '19 06:09 kozec

Hmm.. Yes of course this doesn't really make sense. IMHO this should be a functionality/retur of the syncthing daemon/api, it parses already the file and has the information about excluded files... Otherwise the logic needs to be implemented twice (and the GTK implementation will be always outdated if there are changes). Do you think this is a possible option?

TechupBusiness avatar Sep 10 '19 14:09 TechupBusiness

@kozec https://forum.syncthing.net/t/make-parsed-stignore-result-available-via-api-daemon/13810 In case you can add something :)

TechupBusiness avatar Sep 27 '19 14:09 TechupBusiness

@kozec I started looking into the implementation:

  • https://github.com/syncthing/syncthing-gtk/blob/master/syncthing_gtk/daemon.py
  • https://github.com/syncthing/syncthing-gtk/blob/master/syncthing_gtk/nautilusplugin.py

As far as I can see you use also the REST API? There would be a REST-API command for files/folders to find out if they are ignored: https://docs.syncthing.net/rest/db-file-get.html Do you think this may makes sense from a performance perspective?

Probably implementing the ignore parsing would be the more performant approach? Eventually adapt the go parsing of syncthing to python? https://github.com/syncthing/syncthing/blob/master/lib/ignore/ignore.go#L361

TechupBusiness avatar Oct 15 '19 16:10 TechupBusiness

Do you think this may makes sense from a performance perspective?

Definitely not, it could take minutes to query all files in large directory and IIRC, Nautilus would lock-up for that time.

Probably implementing the ignore parsing would be the more performant approach? Eventually adapt the go parsing of syncthing to python?

That would be correct way to do it, but it would also require ST-GTK parser to keep with any changes in format.

kozec avatar Oct 15 '19 20:10 kozec

I agree that it's confusing how it works.

Also displaying which files and folders are currently syncing would be nice (as Nextcloud integration does). And maybe smaller icons, but that's just a personal opinion. :)

tamas646 avatar Dec 15 '22 10:12 tamas646

@tamas646 You can check https://github.com/kozec/syncthing-gtk/pull/538 in case you can contribute or need to change something with the overlay icons.

Syncing indication is not possible, only eventually by using the API instead.

TechupBusiness avatar Dec 15 '22 13:12 TechupBusiness