summaryrefslogtreecommitdiff
path: root/src/usr/bin
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2024-04-30 17:07:32 -0400
committerB. Stack <bgstack15@gmail.com>2024-04-30 17:07:32 -0400
commitda13d05a83432f2c0c453d19e6b602b9e6bad610 (patch)
tree83e435c8b92dc03e5573d7167d3ecacc702bbc0c /src/usr/bin
parentdeb should be ready now (diff)
downloadstackrpms-acer-chromebook-da13d05a83432f2c0c453d19e6b602b9e6bad610.tar.gz
stackrpms-acer-chromebook-da13d05a83432f2c0c453d19e6b602b9e6bad610.tar.bz2
stackrpms-acer-chromebook-da13d05a83432f2c0c453d19e6b602b9e6bad610.zip
add disable-powerbutton daemon and tools
Diffstat (limited to 'src/usr/bin')
-rwxr-xr-xsrc/usr/bin/disable-powerbutton-daemon34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/usr/bin/disable-powerbutton-daemon b/src/usr/bin/disable-powerbutton-daemon
new file mode 100755
index 0000000..cde67c7
--- /dev/null
+++ b/src/usr/bin/disable-powerbutton-daemon
@@ -0,0 +1,34 @@
+#!/bin/sh
+# File: /usr/bin/disable-powerbutton-daemon
+# Location: stackrpms-acer-chromebook package
+# Author: bgstack15
+# SPDX-License-Identifier: GPL-3.0
+# Startdate: 2024-04-29-2 20:22
+# Title: Power Button Suppressor Daemon
+# Project: disable-powerbutton
+# Purpose: Runs elogind-inhibit so we can use the power button to run logout-manager
+# History:
+# Usage:
+# In ~/.fluxbox/startup: disable-powerbutton-daemon &
+# Which enables this behavior to work:
+# In ~/.fluxbox/keys: 124 :Exec logout-manager-gtk
+# Reference:
+# Enlightenment desktop, man elogind-inhibit
+# Related:
+# /usr/libexec/stackrpms-acer-chromebook/disable-powerbutton-loop
+# /etc/stackrpms-acer-chromebook/fluxbox.keys
+# /etc/stackrpms-acer-chromebook/fluxbox.startup
+# /etc/default/disable-powerbutton
+# Improve:
+# Dependencies:
+# dep-devuan: logout-manager, elogind
+# Documentation:
+# To run this manually:
+# elogind-inhibit --what shutdown:handle-suspend-key:handle-hibernate-key:handle-lid-switch:idle:sleep --who "stackrpms5" --why "i hate the power button" --mode=block '/bin/forever.sh'
+DAEMON_NAME="disable-powerbutton"
+test -f "/etc/default/${DAEMON_NAME}" && . "/etc/default/${DAEMON_NAME}"
+test -f "/etc/sysconfig/${DAEMON_NAME}" && . "/etc/sysconfig/${DAEMON_NAME}"
+test -z "${DP_WHAT}" && DP_WHAT="shutdown:sleep:idle:handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch"
+test -z "${DP_COMMAND}" && DP_COMMAND="/usr/libexec/stackrpms-acer-chromebook/disable-powerbutton-loop"
+export DP_SAFETY_FILE
+elogind-inhibit --what "${DP_WHAT}"--who "disable-powerbutton-daemon" --why "Let power button call logout-manager" --mode=block "${DP_COMMAND}"
bgstack15