[Debian-eeepc-devel] [SCM] Maintenance of eeepc-acpi-scripts debian package branch, master, updated. 40eab078e10f31316ab00407caa90067c6ebd7f0
Damyan Ivanov
dmn at debian.org
Fri Aug 22 14:52:13 UTC 2008
The following commit has been merged in the master branch:
commit 1e6055241b3e3a1cf0ba5b640f4e9c648a588fbe
Author: Damyan Ivanov <dmn at debian.org>
Date: Fri Aug 22 17:50:06 2008 +0300
move X detection to functions.sh/detect_x_display()
diff --git a/actions/hotkey.sh b/actions/hotkey.sh
index e08dcfb..9af27b5 100755
--- a/actions/hotkey.sh
+++ b/actions/hotkey.sh
@@ -4,16 +4,13 @@
[ -d /usr/share/doc/eeepc-acpi-scripts ] || exit 0
. /etc/default/eeepc-acpi-scripts
+. /usr/share/eeepc-acpi-scripts/functions.sh
code=$3
notify() {
echo "$@" # for /var/log/acpid
if [ -S /tmp/.X11-unix/X0 ]; then
- export DISPLAY=:0
- user=$(who | sed -n '/ (:0[\.0]*)$\| :0 /{s/ .*//p;q}')
- home=$(getent passwd $user | cut -d: -f6)
- XAUTHORITY=$home/.Xauthority
- [ -f $XAUTHORITY ] && export XAUTHORITY
+ detect_x_display
if [ "x$ENABLE_OSD" = "xno" ]; then
return
diff --git a/debian/changelog b/debian/changelog
index 9a989f9..25afd37 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,8 +11,9 @@ eeepc-acpi-scripts (1.0.5) unstable; urgency=low
controlled by LOCK_SCREEN_ON_SUSPEND, defaults to 'yes'
* add common functions.sh with detect_wlan() in it, used by wireless.sh
* rules: simplify a bit using PKG and TMP variables
+ * move X detection to functions.sh/detect_x_display()
- -- Damyan Ivanov <dmn at debian.org> Fri, 22 Aug 2008 17:28:31 +0300
+ -- Damyan Ivanov <dmn at debian.org> Fri, 22 Aug 2008 17:38:16 +0300
eeepc-acpi-scripts (1.0.4) unstable; urgency=low
diff --git a/functions.sh b/functions.sh
index 4fc47c1..8fd187b 100644
--- a/functions.sh
+++ b/functions.sh
@@ -13,3 +13,16 @@ detect_wlan()
echo "Detected WLAN module $WLAN_MOD on $WLAN_IF" >&2
}
+
+detect_x_display()
+{
+ local user
+ local home
+ user=$(who | sed -n '/ (:0[\.0]*)$\| :0 /{s/ .*//p;q}')
+ home=$(getent passwd $user | cut -d: -f6)
+ XAUTHORITY=$home/.Xauthority
+ if [ -f $XAUTHORITY ]; then
+ export XAUTHORITY
+ export DISPLAY=:0
+ fi
+}
--
Maintenance of eeepc-acpi-scripts debian package
More information about the Debian-eeepc-devel
mailing list