[PATCH] /etc/acpi/videobtn.sh: optionally run a graphical UI to RandR
intrigeri
intrigeri at boum.org
Tue Feb 17 17:39:36 UTC 2009
... if USE_RANDR_UI is enabled in /etc/default/acpi-support. Unless the
preferred UI software is configured in /etc/default/acpi-support, a sensible one
is guessed at runtime.
---
acpi-support | 7 +++++++
debian/changelog | 9 +++++++++
videobtn.sh | 21 ++++++++++++++++++++-
3 files changed, 36 insertions(+), 1 deletions(-)
diff --git a/acpi-support b/acpi-support
index e6faffb..b176a98 100644
--- a/acpi-support
+++ b/acpi-support
@@ -138,6 +138,13 @@ RESTART_IRDA=false
# a prefix given in this list is skipped)
SKIP_INTERFACES="dummy qemu"
+# Uncomment this line to have a RandR GUI run when the video button is pressed
+# USE_RANDR_UI=true
+
+# Path to your preferred RandR graphical frontend - guessed if not specified
+# RANDR_UI=/usr/bin/grandr
+
+
# Note: to enable "laptop mode" (to spin down your hard drive for longer
# periods of time), install the laptop-mode-tools package and configure
# it in /etc/laptop-mode/laptop-mode.conf.
diff --git a/debian/changelog b/debian/changelog
index efddd5e..7861c3c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+acpi-support (0.109-11+intri2) unstable; urgency=low
+
+ * /etc/acpi/videobtn.sh: run a graphical UI to RandR if USE_RANDR_UI is
+ enabled in /etc/default/acpi-support. Unless the preferred UI software
+ is configured in /etc/default/acpi-support, a sensible one is guessed
+ at runtime.
+
+ -- intrigeri <intrigeri at boum.org> Tue, 17 Feb 2009 18:24:49 +0100
+
acpi-support (0.109-11+intri1) unstable; urgency=low
* /etc/acpi/events/ibm-videobtn: run /etc/acpi/videobtn.sh, as do
diff --git a/videobtn.sh b/videobtn.sh
index ab5e548..3ce8a27 100644
--- a/videobtn.sh
+++ b/videobtn.sh
@@ -1,5 +1,24 @@
#!/bin/sh
[ -f /usr/share/acpi-support/key-constants ] || exit 0
+. /etc/default/acpi-support
. /usr/share/acpi-support/key-constants
-acpi_fakekey $KEY_VIDEOOUT
+
+if [ "$USE_RANDR_UI" = true ]; then
+ getXconsole;
+ if [ x"$XAUTHORITY" != x"" ]; then
+ export DISPLAY=":$displaynum"
+ if [ -z "$RANDR_UI" ]; then
+ if [ -x /usr/bin/grandr ]; then
+ RANDR_UI=/usr/bin/grandr
+ elif [ -x /usr/bin/arandr ]; then
+ RANDR_UI=/usr/bin/arandr
+ fi
+ fi
+ if [ -n "$RANDR_UI" -a -x "$RANDR_UI" ]; then
+ su $XUSER -c "$RANDR_UI"
+ fi
+ fi
+else
+ acpi_fakekey $KEY_VIDEOOUT
+fi
--
1.5.6.5
--=-=-=--
------------=_1272206528-3749-0
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Received: (at 515796-done) by bugs.debian.org; 25 Apr 2010 14:39:21 +0000
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
(2008-06-10) on busoni.debian.org
X-Spam-Level:
X-Spam-Bayes: score:0.0000 Tokens: new, 11; hammy, 115; neutral, 37; spammy,
0. spammytokens: hammytokens:0.000-+--H*u:1.5.20, 0.000-+--H*UA:1.5.20,
0.000-+--H*u:2009-06-14, 0.000-+--H*UA:2009-06-14, 0.000-+--H*r:ADH-AES256-SHA
X-Spam-Status: No, score=-6.6 required=4.0 tests=AWL,BAYES_00,CLOSE,
FROMDEVELOPER,ONEWORD autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Return-path: <michael at fam-meskes.de>
Received: from gauss.credativ.com ([91.190.177.186])
by busoni.debian.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
(Exim 4.69)
(envelope-from <michael at fam-meskes.de>)
id 1O62zQ-0000V2-9N; Sun, 25 Apr 2010 14:39:20 +0000
Received: from feivel (p54BBF9F3.dip.t-dialin.net [84.187.249.243])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
(Authenticated sender: mme at gauss.credativ.com)
by gauss.credativ.com (Postfix) with ESMTPSA id 2BDD85501EB;
Sun, 25 Apr 2010 16:39:05 +0200 (CEST)
Received: by feivel (Postfix, from userid 1000)
id 264D210A09A; Sun, 25 Apr 2010 16:39:10 +0200 (CEST)
Date: Sun, 25 Apr 2010 16:39:09 +0200
From: Michael Meskes <meskes at debian.org>
To: 515796-done at bugs.debian.org, 524318-done at bugs.debian.org
Subject: Closing
Message-ID: <20100425143909.GA3426 at feivel.credativ.lan>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
User-Agent: Mutt/1.5.20 (2009-06-14)
Content-Transfer-Encoding: quoted-printable
I close these bugs in an effort to clean up because they are wontfix anyw=
ay.
Michael
--=20
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ 179140304, AIM/Yahoo/Skype michaelmeskes, Jabber meskes at jabber.org
VfL Borussia! For=C3=A7a Bar=C3=A7a! Go SF 49ers! Use Debian GNU/Linux, P=
ostgreSQL
------------=_1272206528-3749-0--
More information about the Pkg-acpi-devel
mailing list