Skip to content

Instantly share code, notes, and snippets.

@gwpl
Last active December 15, 2017 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwpl/a00e18bc150f1e3518335d13c5e46ad7 to your computer and use it in GitHub Desktop.
Save gwpl/a00e18bc150f1e3518335d13c5e46ad7 to your computer and use it in GitHub Desktop.
2017-12-15 xattr command line Semantic Desktop Style File Tagging
# 2017-12-15 xattr command line Semantic Desktop Style File Tagging
# this gist: https://gist.github.com/gwpl/a00e18bc150f1e3518335d13c5e46ad7
# Perform on xattr filesystem:
setfattr -n user.xdg.tags -v "foo,bar" file.png
setfattr -n user.xdg.comment -v "example comment" file.png
setfattr -n user.baloo.rating -v "10" file.png
getfattr -d file.png
# Screenshot how it looks like in Dolphin GUI : https://imgur.com/oguuJNm
# Returns:
# # file: file.png
# user.baloo.rating="10"
# user.xdg.comment="example comment"
# user.xdg.origin.url="https://example.com/file.png"
# user.xdg.referrer.url="https://example.com/page.html"
# user.xdg.tags="foo,bar"
# P.S. other usefull key-value pairs set by your browser when you download files:
# setfattr -n user.xdg.origin.url -v "https://example.com/file.png" file.png
# setfattr -n user.xdg.referrer.url -v "https://example.com/page.html" file.png
# References:
# https://www.freedesktop.org/wiki/CommonExtendedAttributes/
# http://vhanda.in/blog/2014/07/tagging-your-files/
# https://unix.stackexchange.com/a/44400/9689
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment