Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deraen/pwrmgr
Simple script to suspend laptop when lid is closed
https://github.com/deraen/pwrmgr
Last synced: about 1 month ago
JSON representation
Simple script to suspend laptop when lid is closed
- Host: GitHub
- URL: https://github.com/deraen/pwrmgr
- Owner: Deraen
- License: mit
- Created: 2013-11-04T16:43:45.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-06-30T13:39:28.000Z (over 10 years ago)
- Last Synced: 2024-10-07T17:49:42.611Z (about 1 month ago)
- Language: Python
- Size: 145 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pwrmgr
Simple script to suspend laptop when lid is closed
I use these with Ubuntu, I have no idea if these work elsewhere
## pwrmgr.py
Run as root (no, this is not optimal) because normal user isn't authorized to access Upower without Xsession.
python -u => disable stdout buffering (glib mainloop brokes it or smth).
Logger can be used to write stdout into syslogrc.local or similar:
```
python -u ./pwrmgr.py | logger -t "pwrmgr" &
```## suspend.py
Suspend computer if
1. Using battery power
2. --force```
suspend.py [--force]
```