Compare commits
No commits in common. "3799873323a1383a24bb72f2acd956572a9997aa" and "632745c36de74bf54e84538e9c4db7bedca73df1" have entirely different histories.
3799873323
...
632745c36d
@ -16,23 +16,9 @@
|
|||||||
(build-system copy-build-system)
|
(build-system copy-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:install-plan
|
'(#:install-plan
|
||||||
'(("prevent-sleep" "bin/")
|
'(("prevent-sleep" "bin/"))))
|
||||||
("prevent-sleep.desktop" "share/applications/"))
|
(propagated-inputs
|
||||||
#:phases
|
`(("yad" ,yad)))
|
||||||
(modify-phases %standard-phases
|
|
||||||
(add-after 'unpack 'configure
|
|
||||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
|
||||||
(substitute* (list "prevent-sleep")
|
|
||||||
(("@YAD_PATH@")
|
|
||||||
(string-append (assoc-ref inputs "yad")
|
|
||||||
"/bin")))
|
|
||||||
(substitute* (list "prevent-sleep.desktop")
|
|
||||||
(("@EXEC@")
|
|
||||||
(string-append (assoc-ref outputs "out")
|
|
||||||
"/bin/prevent-sleep")))
|
|
||||||
#t)))))
|
|
||||||
(inputs
|
|
||||||
`(("yad" ,yad)))
|
|
||||||
(synopsis "Prevent sleep")
|
(synopsis "Prevent sleep")
|
||||||
(description
|
(description
|
||||||
"Prevent sleep")
|
"Prevent sleep")
|
||||||
|
@ -1,24 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
REASON="$(whoami) said so..."
|
gnome-session-inhibit --reason "$(whoami) said so..." \
|
||||||
TITLE="Prevent Suspend"
|
|
||||||
TEXT="We will NOT sleep, unless you click \"OK\"!"
|
|
||||||
|
|
||||||
YAD_INPUT="@YAD_PATH@/bin/yad"
|
|
||||||
|
|
||||||
if command -v yad &> /dev/null; then
|
|
||||||
COMMAND=(yad --title "$TITLE" \
|
|
||||||
--text "$TEXT" \
|
|
||||||
--button=gtk-ok)
|
|
||||||
elif command -v zenity &> /dev/null; then
|
|
||||||
COMMAND=(zenity --info --title "$TITLE" \
|
|
||||||
--text "$TEXT")
|
|
||||||
elif [ -x $YAD_INPUT ]; then
|
|
||||||
COMMAND=($YAD_INPUT --title "$TITLE" \
|
|
||||||
--text "$TEXT" \
|
|
||||||
--button=gtk-ok)
|
|
||||||
fi
|
|
||||||
|
|
||||||
gnome-session-inhibit --reason "$REASON" \
|
|
||||||
--inhibit suspend \
|
--inhibit suspend \
|
||||||
"${COMMAND[@]}"
|
yad --title "Prevent Suspend" \
|
||||||
|
--text "We will NOT sleep, unless you click \"OK\"!" \
|
||||||
|
--button=gtk-ok \
|
||||||
|
|
||||||
|
echo "OK! Zzzzzzzz"
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Type=Application
|
|
||||||
Name=Suspend Inhibitor
|
|
||||||
Icon=gnome-power-manager
|
|
||||||
Exec=@EXEC@
|
|
||||||
Terminal=false
|
|
Loading…
x
Reference in New Issue
Block a user