Script for automaticaly lock/unlock screen
This commit is contained in:
32
bin/lock-screen
Executable file
32
bin/lock-screen
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
readonly SCHEMA="org.gnome.desktop.lockdown"
|
||||||
|
readonly KEY="disable-lock-screen"
|
||||||
|
readonly action="$1"
|
||||||
|
|
||||||
|
case "$action" in
|
||||||
|
enable)
|
||||||
|
gsettings set $SCHEMA $KEY false
|
||||||
|
;;
|
||||||
|
|
||||||
|
disable)
|
||||||
|
gsettings set $SCHEMA $KEY true
|
||||||
|
;;
|
||||||
|
|
||||||
|
status)
|
||||||
|
readonly value=$(gsettings get $SCHEMA $KEY)
|
||||||
|
if [[ "$value" == "true" ]]; then
|
||||||
|
state=disable
|
||||||
|
else
|
||||||
|
state=enable
|
||||||
|
fi
|
||||||
|
echo "Auto lock screen is $state"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "No parameter!"
|
||||||
|
echo "Use lock-screen enable|disable|status"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
Reference in New Issue
Block a user