Selim Achour.me

Setting nemo folder emblems from the command line

Oct 5, 2024 #linuxmint#cinnamon

First we need an emblem image file. For that any png can work. Just copy it to your ~/.icons folder (that you might wanna create if not found)

cp syncthing.png ~/.icons/emblem-syncthing.png

Then we will use gio to add the emblem to a directory

gio set -t stringv Documents/Bank  metadata::emblems "emblem-syncthing"

If you wanna automate this for all your folders in your home, he’re a script you can save somewhere. Note that a more complete version would alse remove the emblems if no .stfolder is found

#!/bin/bash

find /home/me/ -name ".stfolder" -type d -print0 | while IFS= read -r -d '' i; do
    parent_dir=$(dirname "$i")
    echo "$parent_dir"
    gio set -t stringv "$parent_dir" metadata::emblems "emblem-syncthing"
done