Ubuntu – get a list of SCHEMA / PATH / KEY to use with gsettings

compizdconfgconfgsettings

After doing some research, I found that I can quickly set configuration options using the gsettings command in the terminal, instead of installing dconf-editor or gconf-editor or CCSM.

But we need the SCHEMA/PATH and KEY to set the value.
Syntax is:

gsettings set SCHEMA[:PATH] KEY VALUE

For example to never auto-hide the launcher:

gsettings set com.canonical.Unity2d.Launcher hide-mode 0

And, for windows not to overlap the launcher:

gsettings set com.canonical.Unity2d.Launcher use-strut true 

So, where can I get a list of all the SCHEMA / PATH / KEY that can be set with gsettings?

No, please don't suggest the gsettings list-keys command, because I don't know the possibly hundreds of schema available.

Best Answer

gsettings list-schemas gets you all the schema. You can also use gsettings list-recursively for what you want but this program will list all the values for all the keys for all schemas:
(Lest's call the script gsettings-iterate-all)

#!/bin/bash
# Gnome 3 can be customised from the command line via the gsettings command
# This script should help you to find what you're looking for by
# listing the ranges for all keys for each schema

for schema in $(gsettings list-schemas | sort)
do
    for key in $(gsettings list-keys $schema | sort)
    do
        value="$(gsettings range $schema $key | tr "\n" " ")"
        echo "$schema :: $key :: $value"
    done
done

Expanding on your example gsettings-iterate-all | grep com.canonical.Unity2d.Launcher yields

com.canonical.Unity2d.Launcher :: edge-decayrate :: type i 
com.canonical.Unity2d.Launcher :: edge-overcome-pressure :: type i 
com.canonical.Unity2d.Launcher :: edge-responsiveness :: type d 
com.canonical.Unity2d.Launcher :: edge-reveal-pressure :: type i 
com.canonical.Unity2d.Launcher :: edge-stop-velocity :: type i 
com.canonical.Unity2d.Launcher :: hide-mode :: type i 
com.canonical.Unity2d.Launcher :: only-one-launcher :: type b 
com.canonical.Unity2d.Launcher :: reveal-mode :: type i 
com.canonical.Unity2d.Launcher :: super-key-enable :: type b 

You can reroute the output to a file for easy reading.

And for creative folks out there. Here is a list of possible options to gsettings that might help create other scripts.