diff options
author | Till Kamppeter <tkamppeter@mandriva.com> | 2005-08-16 16:47:41 +0000 |
---|---|---|
committer | Till Kamppeter <tkamppeter@mandriva.com> | 2005-08-16 16:47:41 +0000 |
commit | cc1a6dccfa92a78d6a359c49037855b9ce156142 (patch) | |
tree | 2dfc1f4aa0ced7ca33dc39db274ee052a0310e24 /perl-install/standalone | |
parent | bf044465f939f95bb14c3507e762e8195bf3fe0a (diff) | |
download | drakx-cc1a6dccfa92a78d6a359c49037855b9ce156142.tar drakx-cc1a6dccfa92a78d6a359c49037855b9ce156142.tar.gz drakx-cc1a6dccfa92a78d6a359c49037855b9ce156142.tar.bz2 drakx-cc1a6dccfa92a78d6a359c49037855b9ce156142.tar.xz drakx-cc1a6dccfa92a78d6a359c49037855b9ce156142.zip |
- Improved the auto queue setup pop-up window display on the user's
desktop according to the suggestions in bug #17370.
- Ask the user whether he wants really have a new printer set up
before doing the auto queue setup.
- Do always a fully non-interactive auto queue setup when X is not
installed
- First-time dialog could show garbage as printer model name for some
models. Fixed.
- Separated "Print no test pages" entry on the wizard page for
printing test pages.
- Changed the defaults for automatic re-enabling of disabled queues to
"no", due to the new CUPS backend wrapper queues should not get
disabled automatically any more.
- Typo corrections.
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-x | perl-install/standalone/autosetupprintqueues | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/perl-install/standalone/autosetupprintqueues b/perl-install/standalone/autosetupprintqueues index 45684cfac..50e906e87 100755 --- a/perl-install/standalone/autosetupprintqueues +++ b/perl-install/standalone/autosetupprintqueues @@ -30,6 +30,8 @@ $commandline =~ /-(auto|nogui|gui|waitforgui)\b/; my $gui = $1; $gui ||= "auto"; +$gui = "nogui" if (! -x "/usr/X11R6/bin/X"); + if ($gui ne "nogui") { # Auto-detect whether we go in non-X mode or not my $desktopuser = `cat /var/run/console.lock 2>/dev/null`; @@ -58,8 +60,15 @@ if ($gui ne "nogui") { # Allow root's windows to be opened on the user's display and # start printerdrake then, in a mode to do nothing else than # automatically setting up print queues. + my $userhome = + `getent passwd $desktopuser|awk -F: '{print \$6}' 2>&1`; + chomp $userhome; my $errfile = "/dev/null"; - system "export DISPLAY=\"localhost:0.0\"; USER=$desktopuser; /bin/su $desktopuser -c \"/usr/X11R6/bin/xhost +localhost > $errfile 2>&1\"; /usr/sbin/printerdrake --onlyautoqueue >> $errfile 2>&1; /bin/su $desktopuser -c \"/usr/X11R6/bin/xhost -localhost >> $errfile 2>&1\""; + if (-r "$userhome/.Xauthority") { + system "export DISPLAY=\"localhost:0.0\"; export USER=$desktopuser; [ -r $userhome/.i18n ] >> $errfile 2>&1 && for l in `cat $userhome/.i18n`; do export \$l; done >> $errfile 2>&1; export XAUTHORITY=$userhome/.Xauthority; /usr/sbin/printerdrake --onlyautoqueue >> $errfile 2>&1;"; + } else { + system "export DISPLAY=\"localhost:0.0\"; export USER=$desktopuser; [ -r $userhome/.i18n ] >> $errfile 2>&1 && for l in `cat $userhome/.i18n`; do export \$l; done >> $errfile 2>&1; /bin/su $desktopuser -c \"/usr/X11R6/bin/xhost +localhost >> $errfile 2>&1\"; /usr/sbin/printerdrake --onlyautoqueue >> $errfile 2>&1; /bin/su $desktopuser -c \"/usr/X11R6/bin/xhost -localhost >> $errfile 2>&1\""; + } exit 0; } } |