You are not logged in.
Hi,
first: Did I just not find it or is there no forum part where my crontab question would fit better than into the Workstation User part?
Maybe the captions to the forum parts should be reconsidered.
Anyway,
my problem is. I want to kill a program and start it again right away.
my crontab looks the following
# Ksmoothdock beenden
* * * * * killall ksmoothdock
# Ksmoothdock starten
* * * * * /bin/ksmoothdock
thing is, my wallpaper changes every other minute and ksmoothdock is sort of semi transparent, i.e. when you start it, it takes the background as it's own background but when my background changes ksmoothdock stays the same so it looks sort of stupid
killall ksmoothdock works like a charm, I just don't seem to be able to start it..
any idea?
ArchLinux (x86_64) w/ kdemod
Offline
Are you sure your ksmoothdock is installed in /bin ? Maybe it's in /usr/bin or /opt/kde.....somewhere.
Offline
mith@middleearth|[~]:~ > whereis ksmoothdock
ksmoothdock: /bin/ksmoothdock
ArchLinux (x86_64) w/ kdemod
Offline
hmm..likely half the time it is being killed as it is being started.lol
I would recommend makin a shell script to do it, and crontabbing your shell script.
ie.
#!/bin/bash
####script located at ~/bin/fixdock
killall ksmoothdock
/bin/ksmoothdock &
then making your crontab:
* * * * * ~/bin/fixdock > /dev/null 2>&1
That restarts it every minute. Depending on which part of the minute the background changes (if they both change on the minute, you might end up with a race condition. If swoothdock restart completes before background rotation, well, then...your dock background will always be using the last rotation as a background. lol)
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
thx Cactus,
BUT :twisted: .. the script is executed and ksmoothdock is killed but not started.. funny thing is. I added a "sleep 1" so there is a bit of a time difference between killing and starting.. running the script by hand it kills ksmoothdock and starts it again.. running it with crontab just kills and not restarts, now does that make any sense?
ArchLinux (x86_64) w/ kdemod
Offline
That just means that crontab doesn't set your DISPLAY variable.
I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal
Offline
That just means that crontab doesn't set your DISPLAY variable.
That sounds good, but how can I fix this? Do you know that too?
ArchLinux (x86_64) w/ kdemod
Offline
#!/bin/bash
####script located at ~/bin/fixdock
export DISPLAY=":0.0"
killall ksmoothdock
/bin/ksmoothdock &
try that.
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
#!/bin/bash
####script located at ~/bin/fixdock
export DISPLAY=":0.0"
killall ksmoothdock
/bin/ksmoothdock &
try that.
thank you very much. Now it works!
:twisted:
ArchLinux (x86_64) w/ kdemod
Offline
8)
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline