Spying on what happens
Most of what these settings editors do can be watched by running
dconf watch /
in a terminal.
Also most of the time, to achieve what you see happening with the command above, these applications will need to edit the
dconf database (further below). This can be done either directly, by using the cli options of dconf (which is not preferred), or by running the corresponding
gsettings commands, like the one you mention.
To run these commands, no terminal window is needed, as you can see in the examples.
About, gsettings, dconf and the dconf database
gsettings is the cli frontend to
dconf, which in its turn edits the
dconf database, where most of the settings are stored, in binary format. See also this nice answer.
dconfdatabase, by the way, can also be edited from the GUI by
dconf editor, which is in the repositories:
a. In python
To show you what happens under the hood, below a working sample to toggle your launcher position from GUI in a single (toggle) button:
from gi.repository import Gtk
key = ["com.canonical.Unity.Launcher", "launcher-position"]
button = Gtk.Button("Toggle launcherposition")
def toggle(self, *args):
# read the current setting on launcher position
current = subprocess.check_output([
"gsettings", "get", key, key
# toggle to the other option
new = "'Left'" if current == "'Bottom'" else "'Bottom'"
"gsettings", "set", key, key, new
window = ToggleWin()
...and have fun.
b. Launcher icon
Even a simple launcher can do the job from the GUI:
Exec=zenity --info --text="Right- click to set launcher position"
Actions=Launcher to bottom;Launcher on the left;
[Desktop Action Launcher to bottom]
Name=Launcher to bottom
# right click option to set launcher to bottom
Exec=gsettings set com.canonical.Unity.Launcher launcher-position Bottom
[Desktop Action Launcher on the left]
Name=Launcher on the left
# right click option to set launcher to left
Exec=gsettings set com.canonical.Unity.Launcher launcher-position Left
- Paste the code into an empty file, save it as
- Drag it on to the launcher and right-click
For permanent use, store it in
~/.local/share/applications (for local use) or
~/usr/share/applications for all users.