Created
April 3, 2018 16:38
-
-
Save mrf345/6996d5ad6a5328d49638d40e84e0ffde to your computer and use it in GitHub Desktop.
Put linux to sleep if emacs idle for 1 hour
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Put system to sleep, if emacs idle for 1 hour | |
(defun gotoSleep () | |
(interactive) | |
(minibuffer-message "Going to Sleep !") | |
(shell-command "systemctl suspend") | |
) | |
(run-with-idle-timer (* 60 60) nil 'gotoSleep) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment