So I've been researching on how to implement this in Thunar and finally got some resources:
https://www.reddit.com/r/kde/comments/8 ... n/dwd6fbc/
https://forums.linuxmint.com/viewtopic.php?t=308032
https://forum.xfce.org/viewtopic.php?id=14796
https://forum.xfce.org/viewtopic.php?id=11478
and specifically
https://forum.xfce.org/viewtopic.php?id=14708
From this on, I've been trying to build my own approach, which admittedly its a bit tricky and dirty, but that's the way it isβ¦
This script will make it for you by:
* Creating color emblems
* Creating companion color folders
* Creating the necessary .desktop actions under Thunar>SendTo menu
Code: Select all
#!/bin/bash
sendto="$HOME/.local/share/Thunar/sendto"
[ -d "$sendto" ] || mkdir -p "$sendto"
[ -d "$HOME"/.icons/hicolor/scalable/emblems ] || mkdir -p "$HOME"/.icons/hicolor/scalable/emblems
cd "$_" || exit
### from here to the end of the script, change Spotlight to your preferred folder name (Favorites, Starred, Scattergories... )
for color in blue green magenta orange purple red skyblue yellow; do
mkdir -p "$HOME"/Spotlight/$color
cat > emblem-color-$color.svg<<EOF
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="16" height="16">
<circle r="8" cx="8" cy="8" style="fill:$color"/>
</svg>
EOF
cat > "$sendto"/label-$color.desktop<<EOF
[Desktop Entry]
Version=1.0
Name=Label $color
Comment=Tag $color
Exec=sh -c "for file in %F; do gio set -t stringv "\$file" metadata::emblems emblem-color-$color; touch -c -r "\$file" "\$file"; ln -sf "\$file" "\$HOME"/Spotlight/$color/%N; done"
Terminal=false
Icon=emblem-color-$color
Type=Application
EOF
done
4) add a "Directory Menu" plugin/button to the panel and point its "Base Directory" to the new "Spotlight" (Favorites) folder.
*** THINGS LEFT:
* Can't get various color emblems for one file. I.e. setting one color label will reset another.
* Script a full method which allows to (selectively) unlabel too. I.e.:
Code: Select all
[[ $(gio info -a metadata::emblems $file) =~ emblem-color-yellow ]] || gio set $file -t unset metadata::emblems
*** BONUS TRACK:
Although not related to this tagging method itself, we can even add more control by creating a bookmark to recent files in the side panel. These files are xml-listed in the $HOME/.local/share/recently-used.xbel file.
Just open a terminal and type:
Code: Select all
echo recent:/// >> $HOME/.config/gtk-3.0/bookmarks