summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2023-12-21 16:42:38 +0100
committerSimon Rettberg2023-12-21 16:42:38 +0100
commitf63dc663a62b2858d17cba49640f73928507037a (patch)
tree759694c685b33556e2cba02129db9d604c308347
parent[bwlp-desktop-tweaks] New module (diff)
downloadmltk-f63dc663a62b2858d17cba49640f73928507037a.tar.gz
mltk-f63dc663a62b2858d17cba49640f73928507037a.tar.xz
mltk-f63dc663a62b2858d17cba49640f73928507037a.zip
[run-virt] Run xfce4-power-manager if we have a backlight
-rwxr-xr-xcore/modules/bwlp-desktop-tweaks/data/opt/openslx/scripts/start-useful-session-daemons24
-rw-r--r--core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/start_windowmanager.inc4
2 files changed, 28 insertions, 0 deletions
diff --git a/core/modules/bwlp-desktop-tweaks/data/opt/openslx/scripts/start-useful-session-daemons b/core/modules/bwlp-desktop-tweaks/data/opt/openslx/scripts/start-useful-session-daemons
new file mode 100755
index 00000000..bdbc253d
--- /dev/null
+++ b/core/modules/bwlp-desktop-tweaks/data/opt/openslx/scripts/start-useful-session-daemons
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# Check environment
+
+file="/sys/class/backlight/intel_backlight/max_brightness"
+if ! [ -e "$file" ]; then
+ for file in /sys/class/backlight/*/max_brightness; do
+ break
+ done
+fi
+have_backlight=false
+[ -e "$file" ] && have_backlight=true
+
+#
+# Run daemons
+#
+
+# xfce4-power-manager
+
+if $have_backlight; then
+ xfce4-power-manager &
+fi
+
+exit 0
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/start_windowmanager.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/start_windowmanager.inc
index f73a34be..556aafd3 100644
--- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/start_windowmanager.inc
+++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/start_windowmanager.inc
@@ -93,6 +93,10 @@ start_wm() {
declare -g RUNVIRT_TASKBAR_PID="$!"
fi
+ # This script conditionally runs useful stuff, like xfce4's power manager that can handle
+ # backlight control keys, in case it sees there is a backlight
+ /opt/openslx/scripts/start-useful-session-daemons
+
if isempty HAVE_WM_CLEANUP_HOOK; then
add_cleanup stop_wm
declare -rg HAVE_WM_CLEANUP_HOOK=yes