![]() Registered Member ![]()
|
OK, this *HAS* to be something simple I am missing, but for the life of me I cannot figure out what.
I have a very simple shell script which refuses to work, giving me grief about the display. Extremely similar scripts run just fine. Here is the script: #! /bin/bash amarok --pause xset dpms force on That's it. When I run the script, I get: AlarmClock:~# AlarmSnooze : cannot connect to X server :0.0 xset: unable to open display ":0.0" I've tried setting the DISPLAY variable explicitly as well as exporting it, I've tried it under both Konsole and an ordinary xterm as well as in a system call from a binary application, and I've tried using the "display=" command line option. An extremely similar script in the very same directory runs just fine: #! /bin/bash amarok -p xset dpms force on kill -USR1 `cat /var/run/Alarm_Clock.pid` AlarmStop & The permissions and ownership are identical. I'm stumped. |
![]() Administrator ![]()
|
Can you check the permissions of the ~/.XAuthority* files? Try removing all of them outside of a X session also if more than just ~/.XAuthority exists.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
two tries:
1) DISPLAY=:0 2) xhost + the first sets the DISPLAY variable to :0, which should be your x-based running session. the second allows to launch x-based programs to the existing session, but from another user (which in this case seems to be root "AlarmClock:~# AlarmSnooze") i would say the second option will work for sure, so launch it as your normal user before, and if it does, add it to the autostart program list
mzneverdies, proud to be a member of KDE forums since 2008-Dec.
|
![]() Registered Member ![]()
|
I found the differential, but I don't know why, exactly. It turns out one of the processes was running as root, the other as an ordinary user. The ordinary user's process was able to access the display just fine, but any time one of the scripts is run as root, it croaks, complaining about not being able to access the display. I'll look into xhost+.
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]