Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HandleLidSwitch=lock
- sudo systemctl restart systemd-logind
- # Export the dbus session address on startup so it can be used by any other environment
- sleep 5
- touch $HOME/.Xdbus
- chmod 600 $HOME/.Xdbus
- env | grep DBUS_SESSION_BUS_ADDRESS > $HOME/.Xdbus
- echo 'export DBUS_SESSION_BUS_ADDRESS' >> $HOME/.Xdbus
- # Export XAUTHORITY value on startup so it can be used by cron
- env | grep XAUTHORITY >> $HOME/.Xdbus
- echo 'export XAUTHORITY' >> $HOME/.Xdbus
- Name:<Any name you want>
- Command:/home/your_user/export_x_info
- #!/bin/bash
- grep closed /proc/acpi/button/lid/LID0/state
- if [ $? = 0 ]
- then
- source /home/user_name/.Xdbus
- DISPLAY=:0.0 su user_name -c "gnome-screensaver-command -l"
- fi
- #! /bin/bash
- while true
- do
- value=`cat /proc/acpi/button/lid/LID0/state |cut -f2 -d:`
- if [ ! $value=open ]; then
- gnome-screensaver-command -l
- fi
- done
- sh /home/kasiya/lid_lock.sh &
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement