summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2023-12-21 16:28:17 +0100
committerSimon Rettberg2023-12-21 16:28:17 +0100
commit2f2dbec6025154ea4f5b3f2cddc4a46d21ab2905 (patch)
tree253cb751080c095bdfac07ee1b64017eab05ac0e
parent[xorg] Add libinput config to enable click-on-tap (diff)
downloadmltk-2f2dbec6025154ea4f5b3f2cddc4a46d21ab2905.tar.gz
mltk-2f2dbec6025154ea4f5b3f2cddc4a46d21ab2905.tar.xz
mltk-2f2dbec6025154ea4f5b3f2cddc4a46d21ab2905.zip
[bwlp-desktop-tweaks] New module
For now, locks the xfce4 power management settings, and makes sure the minimum backlight brightness has a sane value (1%).
-rw-r--r--core/modules/bwlp-desktop-tweaks/data/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml15
-rwxr-xr-xcore/modules/bwlp-desktop-tweaks/data/opt/openslx/scripts/systemd-general_system_tweaks.d/xfce4-adjust-min-brightness.sh24
-rw-r--r--core/modules/bwlp-desktop-tweaks/module.build2
-rw-r--r--core/modules/bwlp-desktop-tweaks/module.conf0
4 files changed, 41 insertions, 0 deletions
diff --git a/core/modules/bwlp-desktop-tweaks/data/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml b/core/modules/bwlp-desktop-tweaks/data/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml
new file mode 100644
index 00000000..63c547f0
--- /dev/null
+++ b/core/modules/bwlp-desktop-tweaks/data/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<channel name="xfce4-power-manager" version="1.0" locked="*" unlocked="root">
+ <property name="xfce4-power-manager" type="empty">
+ <property name="power-button-action" type="uint" value="3"/>
+ <property name="brightness-switch" type="int" value="0"/>
+ <property name="brightness-switch-restore-on-exit" type="int" value="1"/>
+ <property name="brightness-step-count" type="uint" value="15"/>
+ <property name="brightness-slider-min-level" type="int" value="10"/>
+ <property name="handle-brightness-keys" type="bool" value="true"/>
+ <property name="general-notification" type="bool" value="false"/>
+ <property name="show-tray-icon" type="bool" value="true"/>
+ <property name="dpms-enabled" type="bool" value="false"/>
+ </property>
+</channel>
diff --git a/core/modules/bwlp-desktop-tweaks/data/opt/openslx/scripts/systemd-general_system_tweaks.d/xfce4-adjust-min-brightness.sh b/core/modules/bwlp-desktop-tweaks/data/opt/openslx/scripts/systemd-general_system_tweaks.d/xfce4-adjust-min-brightness.sh
new file mode 100755
index 00000000..5852edc9
--- /dev/null
+++ b/core/modules/bwlp-desktop-tweaks/data/opt/openslx/scripts/systemd-general_system_tweaks.d/xfce4-adjust-min-brightness.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+xml="/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml"
+
+[ -s "$xml" ] || exit 0
+
+file="/sys/class/backlight/intel_backlight/max_brightness"
+
+if ! [ -e "$file" ]; then
+ for file in /sys/class/backlight/*/max_brightness; do
+ break
+ done
+fi
+
+[ -e "$file" ] || exit 0
+
+min=$( cat "$file" )
+min=$(( min / 100 ))
+[ "$min" -gt 10 ] || min=10
+
+xmlstarlet ed -u '/channel/property/property[@name="brightness-slider-min-level"]/@value' \
+ -v "$min" "$xml" > "$xml.tmp"
+
+mv -f "$xml.tmp" "$xml"
diff --git a/core/modules/bwlp-desktop-tweaks/module.build b/core/modules/bwlp-desktop-tweaks/module.build
new file mode 100644
index 00000000..05a7907c
--- /dev/null
+++ b/core/modules/bwlp-desktop-tweaks/module.build
@@ -0,0 +1,2 @@
+#!/bin/bash
+
diff --git a/core/modules/bwlp-desktop-tweaks/module.conf b/core/modules/bwlp-desktop-tweaks/module.conf
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/core/modules/bwlp-desktop-tweaks/module.conf