artix_disable_suspend_on_lid_close.sh 427 B

12345678910111213141516
  1. #!/bin/bash
  2. # fail if any commands fails
  3. set -e
  4. # debug log
  5. #set -x
  6. # Set superuser privileges command if not set
  7. if [[ -z $su ]]; then
  8. export su="sudo"
  9. fi
  10. $su cp /etc/elogind/logind.conf /etc/elogind/logind.conf.bak
  11. $su cat /etc/elogind/logind.conf | $su sed -e "s/#HandleLidSwitch=suspend/HandleLidSwitch=ignore/" | $su tee /etc/elogind/logind.conf.edited
  12. $su mv /etc/elogind/logind.conf.edited /etc/elogind/logind.conf