If you have a script similar to below and you change the emblem in another folder you'll not see changes when navigating back to that folder by using the Forward or Back buttons.
Seems counter-intuitive.
Here's that test script. Drag and drop files from different folders and you'll see. What I mean.:
#!/bin/bashFOLDER=$(basename "$(pwd)")for folderOrFilename in "$@"; do gio set -t stringv "$folderOrFilename" metadata::emblems "emblem-favorite"done# Refresh the Thunar window so emblems appearfor win in `wmctrl -lx | tr -s ' ' | grep -i "thunar" | grep --fixed-strings "$FOLDER_NAME" | cut -d' ' -f1`do wmctrl -i -a $win && xdotool key F5done
Edited
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
Metadata such as the used emblem is stored via gvfs.
Files in thunar are monitored for changes via g_file_monitor. I dont know if there is a possibility to automatically track and notify as well on metadata changes.
To simplify testing:
gio set -t stringv MyTestFile 'metadata::emblems' 'emblem-debian'gio set -t stringv MyTestFile 'metadata::emblems' 'emblem-xapp-favorite'
To check current emblem-name: gio info -a 'metadata::*' MyTestFile
Alexander Schwinnchanged title from Forward and back buttons don't trigger refreshing of emblem display. to No auto-refresh of files when metadata (e.g. emblem) changed via console
changed title from Forward and back buttons don't trigger refreshing of emblem display. to No auto-refresh of files when metadata (e.g. emblem) changed via console
g_file_monitor seems not to support such a service, and I dont want to add any complex extra-logic to file-monitor inside thunar, for the exotic case of changing metadata via console. ... so I'll close this issue.
So if you want to further push that feature, best ask the gio devs if they are willing to add support for that into g_file_monitor ... maybe some additional flag which makes that possible.
(Though it probably would require to add a second monitor for each file, using the gvfs-location of the file .. ptobably rather expensive in performance)
It looks to me like anyone wanting to add emblems in some other way that is not Thunar is going to run into this issue.
The renaming of this ticket is changing the meaning. I'm not asking for an auto-refresh, just a refresh when a person enters a folder. The title of this ticket can be shortened to "Emblem changes done without Thunar not showing when entering folder".
I say this because I was just doing some extra work and I'm sorry to say things are a bit worse than I even initially thought.
I thought it was just the Forward and Back buttons not working but it turns out that even navigating to that folder, eg. by clicking it, doesn't show the current emblems. Then tried closing the Thunar window and opening a new one, then navigating to the folder, but no cigar. Ouch.
I understand if you don't want to check something in the background constantly, but when a person goes to a folder it sounds sensible to check the emblems. Would the latter really be as you've said, "expensive"? I'm interested to know.
Also wondering if other apps like rabbitvcs and syncthing, whose icons are in my emblems list for some reason, are having to work overtime to resolve this issue. I'd think they'd need to.
Do you still think this is best solved by gio devs?
M Dinichanged title from No auto-refresh of files when metadata (e.g. emblem) changed via console to Emblem changes done without Thunar not showing when entering folder
changed title from No auto-refresh of files when metadata (e.g. emblem) changed via console to Emblem changes done without Thunar not showing when entering folder
Then tried closing the Thunar window and opening a new one, then navigating to the folder, but no cigar. Ouch.
You probably only closed the window, while thunar was still running in the background. Try with ./thunar/thunar -q;./thunar/thunar .. works fine here. Or just press f5 to refresh. That as well will update the emblem.
I understand if you don't want to check something in the background constantly, but when a person goes to a folder it sounds sensible to check the emblems. Would the latter really be as you've said, "expensive"? I'm interested to know.
Emblems are saved in as "gvfs metadata" somewhere inside the blobs in ~/.local/share/gvfs-metadata. So it would be required to track the correct binary blob there for changes, which belongs to the file.
Though possibly I am wrong regarding the performance aspect. I suppose it is not necesarry to track the blob. Maybe sufficcient to just notify g_file_monitor of the file whenever some gio set operation was triggered using that file. Not sure if that is possible .. these are assumptions on glib internals.
Also wondering if other apps like rabbitvcs and syncthing, whose icons are in my emblems list for some reason, are having to work overtime to resolve this issue. I'd think they'd need to.
For thunar, rabbitcvs can be installed as a thunar-plugin. Suppose plugins can trigger a "update" on a specific file, so that it is reloaded. (Afaik thunar has no API yet to let plugins set special emblems)
Do you still think this is best solved by gio devs?
Yes. Just check some other gtk file-managers. Same problem with caja, nautilus pcmanfm. IMO that's something which should be fixed by the toolkit.