Bug#471510: acpi-support: getXuser doesn't work if using startx
+ if [ x$user = x ]; then + startx=`pgrep startx` Minor nit: if it's possible to have multiple startx instances running (is there anything that prevents this?), I think this should be either pgrep -o startx or pgrep -n startx (oldest or newest). Nothing to prevent it: startx ... startx -- :1 ... startx -- :11 ... I love linux :) If only you could do that on legacy operating systems like Solaris. -- TimC Radioactive cats have 18 half-lives. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#471510: acpi-support: getXuser doesn't work if using startx
Hi Csaba, Csaba Halasz wrote: getXuser fails to find user name if the X session is started using startx. I'm aware of the problem, and this is definitely an promising approach. Consider it accepted, thanks for the contribution. + if [ x$user = x ]; then + startx=`pgrep startx` Minor nit: if it's possible to have multiple startx instances running (is there anything that prevents this?), I think this should be either pgrep -o startx or pgrep -n startx (oldest or newest). Cheers, Bart -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#471510: acpi-support: getXuser doesn't work if using startx
Package: acpi-support Version: 0.90-4 Severity: normal Tags: patch getXuser fails to find user name if the X session is started using startx. --- power-funcs.orig2007-12-13 20:50:00.0 +0100 +++ power-funcs 2008-03-18 16:49:27.0 +0100 @@ -10,6 +10,12 @@ if [ x$user = x ]; then user=`finger| grep -m1 :$displaynum | awk '{print $1}'` fi + if [ x$user = x ]; then + startx=`pgrep startx` + if [ x$startx != x ]; then + user=`ps -o user --no-headers $startx` + fi + fi if [ x$user != x ]; then userhome=`getent passwd $user | cut -d: -f6` export XAUTHORITY=$userhome/.Xauthority -- System Information: Debian Release: 4.0 APT prefers stable APT policy: (500, 'stable') Architecture: amd64 (x86_64) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.24.3 Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Versions of packages acpi-support depends on: ii acpid 1.0.4-5 Utilities for using ACPI power man ii dmidecode 2.8-4 Dump Desktop Management Interface ii finger 0.17-10 user information lookup program ii hdparm 6.9-2 tune hard disk parameters for high ii laptop-detect 0.12.1attempt to detect a laptop ii libc6 2.7-6 GNU C Library: Shared libraries ii lsb-base 3.1-23.2etch1 Linux Standard Base 3.1 init scrip ii powermgmt-base 1.29 Common utils and configs for power pi radeontool 1.5-5 utility to control ATI Radeon back pi vbetool0.7-1.1 run real-mode video BIOS code to a ii xbase-clients 1:7.1.ds1-2 miscellaneous X clients Versions of packages acpi-support recommends: pn laptop-mode-tools none (no description available) -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]