1

I looked at dconf and locks and I came up with this script to try to enforce screen locking. It doesn't work. I used to have this working under debian but can't seem to get it to work under ubuntu. Can anyone advise me on what I'm doing wrong?

Thanks.

#!/bin/bash -x
umask 0022
mkdir -p /etc/dconf/db/ibus.d/locks
printf "#Defaults set in /usr/share/glib-2.0/schemas/60_charles.gschema.override
#Recompile schemas with:
# glib-compile-schemas /usr/share/glib-2.0/schemas/
#Update dconf with:
# dconf update
/org/gnome/desktop/session/idle-delay
/org/gnome/desktop/screensaver/lock-enabled
/org/gnome/desktop/screensaver/lock-delay
" > /etc/dconf/db/ibus.d/locks/00-default-screen-lock

printf "[org.gnome.desktop.session]
idle-delay=900
[org.gnome.desktop.screensaver]
lock-enabled=true
lock-delay=60
" > /usr/share/glib-2.0/schemas/60_charles.gschema.override

glib-compile-schemas /usr/share/glib-2.0/schemas/
dconf update
  • I had a umask permission problem and I also changed my script to use local.d – Charles Wright May 17 '16 at 2:56
2

I had a umask permission problem and I also changed my script to use local.d

#!/bin/bash -x
# login as root to run this.  make sure umask is default setting

mkdir -p /etc/dconf/db/local.d/locks

printf "#Defaults set in /usr/share/glib-2.0/schemas/60_charles.gschema.override
#Recompile schemas with:
# glib-compile-schemas /usr/share/glib-2.0/schemas/
#Update dconf with:
# dconf update
/org/gnome/desktop/session/idle-delay
/org/gnome/desktop/screensaver/lock-enabled
/org/gnome/desktop/screensaver/lock-delay
" > /etc/dconf/db/local.d/locks/00-default-screen-lock

printf "[org.gnome.desktop.session]
idle-delay=900
[org.gnome.desktop.screensaver]
lock-enabled=true
lock-delay=60
" > /usr/share/glib-2.0/schemas/60_charles.gschema.override

printf "user-db:user
system-db:local
" > /etc/dconf/profile/user

glib-compile-schemas /usr/share/glib-2.0/schemas/
dconf update

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.