Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 4719  / 1 Year ago, sun, april 23, 2023, 1:20:27

I want to enable screen timeout and locking when my laptop is located in the LAN of my company and I want to disable this when I'm at home. For location detection I use whereami with a simple detection like this:



default unknown
testdhcp '172.16.*.*' work
testdhcp '192.168.36.*' home


Now I need to set the corresponding settings when I enter or leave the "work" network. But I have problems finding out where Gnome stores this stuff. I already found out where to toggle the "Lock" button in the screen configuration dialog. I do it like this in the whereami configuration:



!work su -c "dconf write /org/gnome/desktop/screensaver/lock-enabled false" k
=work su -c "dconf write /org/gnome/desktop/screensaver/lock-enabled true" k


This works so far. But I also need to configure the "Turn off after" setting in the screen configuration dialog. I found these three keys in dconf which are influences by it:



/org/gnome/desktop/session/idle-delay
/org/gnome/settings-daemon/plugins/power/sleep-display-battery
/org/gnome/settings-daemon/plugins/power/sleep-display-ac


But when I change them manually then it doesn't work and the screen dialog doesn't read the new value either. So I guess there are more keys I have to change but I can't find them (I search feature in this new dconf stuff would be nice).



So what settings have I to change to disable/enable the screen timeout?


More From » gnome

 Answers
6

Found it. idle-delay must be of type uint32 and not a string like the other two values. So this works for me:



=work su -c "dconf write /org/gnome/desktop/screensaver/lock-enabled true" k
=work su -c "dconf write /org/gnome/desktop/session/idle-delay 'uint32 120'" k
=work su -c "dconf write /org/gnome/settings-daemon/plugins/power/sleep-display-ac 120" k
=work su -c "dconf write /org/gnome/settings-daemon/plugins/power/sleep-display-battery 120" k
!work su -c "dconf write /org/gnome/desktop/screensaver/lock-enabled false" k
!work su -c "dconf write /org/gnome/desktop/session/idle-delay 'uint32 0'" k
!work su -c "dconf write /org/gnome/settings-daemon/plugins/power/sleep-display-ac 0" k
!work su -c "dconf write /org/gnome/settings-daemon/plugins/power/sleep-display-battery 0" k

[#40671] Sunday, April 23, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
olltea

Total Points: 238
Total Questions: 115
Total Answers: 107

Location: Moldova
Member since Tue, Feb 7, 2023
1 Year ago
;