prevent-sleep: new package

This commit is contained in:
Adrian Kuschelyagi Malacoda 2021-10-06 00:27:46 -05:00
parent 2afdcb7ee7
commit 9c3bb7c95c
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,25 @@
(define-module (mason packages prevent-sleep)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix build-system copy)
#:use-module (guix utils)
#:use-module (guix gexp))
(define-public prevent-sleep
(package
(name "prevent-sleep")
(version "0.0.1")
(home-page "https://wiki.mobian-project.org/doku.php?id=tweaks#suspend-sleep")
(source
(local-file (string-append (dirname (current-filename)) "/scripts/prevent-sleep")
#:recursive? #t))
(build-system copy-build-system)
(arguments
'(#:install-plan
'(("prevent-sleep" "bin/"))))
(synopsis "Prevent sleep")
(description
"Prevent sleep")
(license license:cc-by-sa4.0)))
prevent-sleep

View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
gnome-session-inhibit --reason "$(whoami) said so..." \
--inhibit suspend \
yad --title "Prevent Suspend" \
--text "We will NOT sleep, unless you click \"OK\"!" \
--button=gtk-ok \
echo "OK! Zzzzzzzz"