How can I tell Ubuntu to turn off the screen when I close my Laptop Lid? I don't want to suspend the session, hibernate, or shut down. Simply turn off the screen. AFAIK when I close it, the screen stays on as I can see some light peeking through.
I've tried this suggestion but nothing changed.
(From that above linked site):
[To] Disable screen on lid close
Copy-paste this into the terminal (as a root):
# sudo su echo 'event=button/lid.*' | tee --append /etc/acpi/events/lm_lid echo 'action=/etc/acpi/lid.sh' | tee --append /etc/acpi/events/lm_lid touch /etc/acpi/lid.sh chmod +x /etc/acpi/lid.sh
Edit the /etc/acpi/lid.sh file, paste following content and replace the your_username with your main user name:
#!/bin/bash USER=your_username grep -q close /proc/acpi/button/lid/*/state if [ $? = 0 ]; then su -c "sleep 1 && xset -display :0.0 dpms force off" - $USER fi grep -q open /proc/acpi/button/lid/*/state if [ $? = 0 ]; then su -c "xset -display :0 dpms force on &> /tmp/screen.lid" - $USER fi
If it matters, I'm running on a Dell Inspiron 15, with Ubuntu fully installed on an attached USB.