Page 1 of 1

Command sleep [solved]

PostPosted: May 10th, '12, 16:48
by petrherynk
I would like to use this command. I used "sleep 5s" without success. I use KDE environment.

Re: Command sleep

PostPosted: May 10th, '12, 21:13
by doktor5000
What do you want to use it with, or what do you think it should do or want it to do? Normally you use it together with something else, e.g. in a terminal sometimes i use
Code: Select all
sleep 10 && ksnapshot

What this basically does is wait ten seconds, then the first command successfully completes, and with the && it executes the second command, which is a screenshot tool.

Re: Command sleep

PostPosted: May 10th, '12, 23:14
by petrherynk
[petrherynk@localhost ~]$ su
Heslo:
[root@localhost petrherynk]# sleep 10 && ksnapshot
ksnapshot(3082)/kdeui (kdelibs): Session bus not found
To circumvent this problem try the following command (with Linux and bash)
export $(dbus-launch)
KCrash: Application 'ksnapshot' crashing...
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/root/.kde4/socket-localhost/kdeinit4__0
Warning: connect() failed: : Adresář nebo soubor neexistuje
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi directly
drkonqi(3083)/kdeui (kdelibs): Session bus not found
To circumvent this problem try the following command (with Linux and bash)
export $(dbus-launch)
[root@localhost petrherynk]# export $(dbus-launch)
[root@localhost petrherynk]# sleep 10 && ksnapshot
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
kbuildsycoca4 running...

Re: Command sleep

PostPosted: May 10th, '12, 23:26
by djennings
[root@localhost petrherynk]# sleep 10 && ksnapshot
ksnapshot(3082)/kdeui (kdelibs): Session bus not found


You are getting this problem because your terminal is running as root user.
To launch a graphical application as root you must use
Code: Select all
su -
Note the '-'

Re: Command sleep

PostPosted: May 10th, '12, 23:46
by Ken-Bergen
djennings wrote:You are getting this problem because your terminal is running as root user.
To launch a graphical application as root you must use
Code: Select all
su -
Note the '-'
Code: Select all
export $(dbus-launch)
does the same thing as using the dash with the added benefit that it doesn't do that annoying (cd /root) that (su -) does.

Re: Command sleep

PostPosted: May 11th, '12, 14:43
by petrherynk
Thank you, for me this problem is solved.

Re: Command sleep

PostPosted: May 11th, '12, 15:48
by isadora
Image