3

I want to use Unity-2D's Dodge feature for the dash. I accomplished that by changing the hide-mode value in com.canonical.Unity2d.Launcher in DConf Editor to 2.

However, when I decide to change Ubuntu's wallpaper, the hide-mode value gets reverted to 0. I want to prevent this by making the setting hide-mode read-only. How can I do this?

Jjed
  • 13,874

1 Answers1

3

The directory you need for this is

/etc/dconf/db/local.d/locks

The are not stored there though; this is the place to put them to make one read-only. From dconf admininstration ...

Lockdown

Lockdown is supported by creating a 'locks' subdirectory in the keyfile directory (ie: /etc/dconf/db/local.d/locks). The files contained in this directory contain a list of keys to lock, one per line. Just as with the keyfiles, you may add any number of files to this directory. Here's an example of what one might look like:

# prevent changes to the company wallpaper
/org/gnome/desktop/background/picture-uri

Of course, you need to run the 'dconf update' tool after changing the locks. The tool will notice if the timestamp on the 'locks' directory has changed, so there is no need to touch the ".d" directory as well.


  • The lockdown key for hide-mode should be ...

     /com/canonical/unity-2d/launcher/hide-mode
    

    I would consider it a bug if this does not work.

Alternative ...

  • Command line method:

     dconf write /com/canonical/unity-2d/launcher/hide-mode 1
    

You could add this to some script or ~/bashrc or something else to get it reset.


18.04 used gdm3.

DConf configuration

Some GDM settings are stored in a DConf database. They can be configured either by adding keyfiles to the /etc/dconf/db/gdm.d directory and then recompiling the GDM database by running dconf update as root or by logging into the GDM user on the system and changing the setting directly using the gsettings command line tool. Note that for the former approach, a GDM profile file is required - this must be created manually as it is no longer shipped upstream, see below:

/etc/dconf/profile/gdm
user-db:user
system-db:gdm
file-db:/usr/share/gdm/greeter-dconf-defaults

In /etc/dconf/db/gdm.d you can create a file per key in the sty

rinzwind@schijfwereld:/etc/dconf/db/gdm.d$ ls
02-logo
rinzwind@schijfwereld:/etc/dconf/db/gdm.d$ more 02-logo 
[org/gnome/login-screen]
logo='/discworld/Pictures/Wallpapers/Nier.9.jpg'

And this will preseed the value in dconf.

More examples in the link.

Rinzwind
  • 299,756
  • I made a file called /etc/dconf/db/local.d/locks/unity-2d, containing # keep Unity-2D in dodge /com/canonical/unity-2d/launcher/hide-mode, but that doesn't work. Changing the path to /com/canonical/Unity2d/Launcher/hide-mode doesn't work either. – Exeleration-G May 05 '12 at 22:57
  • 1
    I added in the key it should be (to me). It is the same as you posted here so I would consider it a bug (I also consider it a bug that it gets reset aswell). Posted also an alternative command line method. Maybe you can add that in somewhere. – Rinzwind May 06 '12 at 06:32
  • after some testing: the directory IS checked when running sudo dconf update (I removed locks and created a new dir lock and it complained about it). – Rinzwind May 06 '12 at 06:56
  • Thanks for your help. I've committed a bug at https://bugs.launchpad.net/unity-2d/+bug/995978. – Exeleration-G May 07 '12 at 14:51
  • @Rinzwind . I appreciate this question is from many moons ago. However, I am curious to know if you ever got this to work, as I cannot. I have followed the documentation to the letter, as far as I can see, unfortunately to no avail. Insofar as I can tell, it appears the bug you reported was closed, without resolution, unless I am reading it incorrectly. This has been bugging me for days, any guidance you can give would be greatly appreciated. – Andrew Hardiman May 20 '18 at 16:08
  • @case_2501 18.04 uses gdm3. That one uses a new approach. Can you check if this works for you? The files you create are owned by root so I would assume these preseed the value in gconf and thus locking the key down. – Rinzwind May 20 '18 at 18:08
  • @Rinzwind Apologies as I was not specific enough in my original comment. Although I am looking to utilize the 'lockdown' functionality, I am looking to do so for the automount key, in relation to the 'org.gnome.desktop.media-handling' schema. I am using 16.04. I have created this question: https://askubuntu.com/questions/1038184/how-to-lockdown-system-wide-settings-with-dconf. The only system database I have showing in /etc/dconf/db is 'ibus.d'. I have created a key file and appropriate file in the 'locks' subdirectory, as per the documentation quoted. I cannot see what I am doing wrong? – Andrew Hardiman May 20 '18 at 19:08
  • follow the new link. gdm3 uses another way of doing this (and you can create a locks dir (or a gdm.d dir);the dconf update will scan for those dirs) – Rinzwind May 20 '18 at 19:46