Maintenance

  • Home
  • Log in
  • « Building a template for eXist deployment
  • Wrestling with eXistence »

Linux desktop power user tip

Posted by gregster on 21 Feb 2017 in Announcements

If you want to change the icon of a specific folder/file for some reason, you need to edit the gvfs metadata that is stored in a binary file.
This can be done using built-in gvfs methods like the following:

To get the current, custom icon value
# gvfs-info -a metadata::custom-icon ~/Desktop/foo (file:///home/yournamehere/Desktop/foo also works)

To set a custom icon
# gvfs-set-attribute ~/Desktop/foo metadata::custom-icon file:///usr/share/icons/Humanity/places/48/folder-music.svg

To reset icon to stock
# gvfs-set-attribute ~/Desktop/foo -t unset metadata::custom-icon

Unlike .desktop files, you cannot refer to a canonical FreeDesktop-type icon. You must use an explicit path to the icon you want to use.
NOTE: in a .desktop file you can ref the icon like ICON=folder-open and you'll get the icon theme's icon for folder-open. This icon will change with the theme.

Show other editable attributes for a file
gvfs-info -w ~/Desktop/foo

Which will return something like this
Settable attributes:
standard::symlink-target (bytestring)
time::access (uint64, Keep with file when moved)
time::access-usec (uint32, Keep with file when moved)
time::modified (uint64, Copy with file, Keep with file when moved)
time::modified-usec (uint32, Copy with file, Keep with file when moved)
unix::gid (uint32, Keep with file when moved)
unix::mode (uint32, Copy with file, Keep with file when moved)
unix::uid (uint32, Keep with file when moved)
Writable attribute namespaces:
metadata (string, Copy with file, Keep with file when moved)
xattr (string, Copy with file, Keep with file when moved)
xattr-sys (string, Keep with file when moved)

This entry was posted by Greg and filed under Announcements.

Maintenance

This blog is the location for all work involving software and hardware maintenance, updates, installs, etc., both routine and urgent.
  • Home
  • Recently
  • Archives
  • Categories

Search

Categories

  • All
  • Announcements
  • Hit by a bus
  • Labs
    • Activity log
    • Documentation
  • Notes
  • R & D
    • Activity log
    • Documentation
  • Servers
    • Activity log
    • Documentation
  • Tasks

All blogs

  • Academic
  • AdaptiveDB
  • Admin
  • Announcements
  • CanMys
  • Cascade
  • CGWP
  • ColDesp
  • Depts
  • DVPP
  • Endings
  • HCMC Blogs
  • Landscapes
  • LEMDO
  • Linguistics
  • Maint
  • LondonMap
  • Mariage
  • MoM
  • Moses
  • Pro-D
  • Projects
  • ScanCan
  • HumsSites
  • Wendat

This collection ©2025 by admin • Help • Photo albums software