configure_upower_laptop_lid.sh 564 B

12345678910111213141516171819202122232425
  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 sed -i 's/IgnoreLid=false/IgnoreLid=true/g' /etc/UPower/UPower.conf
  11. read -rp "Enter used init sistem name (sysvinit|openrc|runit)" init_system
  12. if [ "$init_system" = "sysvinit" ]; then
  13. #TODO sudo update-rc.d upower restart
  14. fi
  15. if [ "$init_system" = "openrc" ]; then
  16. #TODO $su rc-update del "$login_manager"
  17. fi
  18. if [ "$init_system" = "runit" ]; then
  19. #TODO $su rm /var/service/"$login_manager"
  20. fi