Skip to content

Instantly share code, notes, and snippets.

@Odyno
Created April 13, 2020 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Odyno/5b16e3eef0a557066cef8bddf912383a to your computer and use it in GitHub Desktop.
Save Odyno/5b16e3eef0a557066cef8bddf912383a to your computer and use it in GitHub Desktop.
Disable tty screen in occording of lid state
#!/bin/bash
grep -q close /proc/acpi/button/lid/*/state
if [ $? = 0 ]; then
/usr/sbin/vbetool dpms off
fi
grep -q open /proc/acpi/button/lid/*/state
if [ $? = 0 ]; then
/usr/sbin/vbetool dpms on
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment