Created
March 3, 2020 18:10
-
-
Save NICHOLAS85/c599f5f3db5666dd28ac980d8d87cef1 to your computer and use it in GitHub Desktop.
Automatically boot into OS after hibernation when using rEFInd
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
| #!/bin/sh | |
| dir="/boot/efi/EFI/refind/timeout.conf" | |
| timeout="5" | |
| if [ "$2" = "hibernate" ]; then | |
| case "$1" in | |
| pre) | |
| echo "refindhibernate.sh: Setting timeout to -1" | |
| sed 's/timeout.*/timeout -1/g' "$dir" > "$dir"~ | |
| ;; | |
| post) | |
| echo "refindhibernate.sh: Setting timeout to $timeout" | |
| sed "s/timeout.*/timeout $timeout/g" "$dir" > "$dir"~ | |
| ;; | |
| esac | |
| mv "$dir"~ "$dir" | |
| fi |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Drop this file into
/usr/lib/systemd/system-sleep/Add
include timeout.confto yourrefind.confand adjust the$dirand$timeoutvariables accordingly.Create the timeout.conf file at the directory indicated by the
$dirvariable with the config value you want, ietimeout 5