brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: gsettings monitor prints a GNOME setting the moment it changes

Linux
~/tips/tip-gnome-gsettings-monitor-changes

gsettings monitor SCHEMA [KEY]

Watches a gsettings schema or key and prints each new value as it changes.

Desktop settings on GNOME-style systems live in schemas with long names, and nobody remembers which key a checkbox flips. Instead of grepping through gsettings list-recursively, I’d let the system tell me.

gsettings monitor SCHEMA [KEY]

The man page says it monitors the key for changes and prints the changed values. If you leave out the key, every key in the schema is watched. It keeps running until you stop it, so Ctrl+C ends it.

gsettings list-schemas
gsettings monitor org.gtk.Settings.FileChooser

The first line lists the schemas installed on the machine. On a minimal Ubuntu 24.04 install without a desktop it printed only four org.gtk.Settings.* entries, among them org.gtk.Settings.FileChooser, so the schemas you see depend on what is installed. Pick one that matches the area you care about, start the monitor, and then change the setting in the settings app. The new value appears in the terminal. That gives you the schema and key name to use with gsettings get and gsettings set later.

You can also trigger the change from a second terminal with gsettings set, which is a fast way to check that the monitor works at all.

Caveats: the man page notes that gsettings needs a D-Bus session bus connection to write changes to the dconf database. On a machine without one, gsettings set printed failed to commit changes to dconf: Cannot autolaunch D-Bus without X11 $DISPLAY. So run it inside a logged-in desktop session. Some schemas are relocatable and need a path after the schema name, written as SCHEMA:PATH.

Further reading: gsettings(1) man page

Going deeper: Guide: advanced tmux, a config that grows with you, formats, layouts and more

More Linux tips notify-send -r "$id" "Backup" "Done" pgrep -af 'sleep 301' smbstatus -L msmtp --serverinfo --tls --tls-certcheck=off --host=smtp.example.com --port=587 smbclient //server/share -U user -Tc backup.tar "*" All Linux tips (283) All topics

Link