This forum has been archived. All content is frozen. Please use KDE Discuss instead.

"RunCommand when finished"

Tags: None
(comma "," separated)
daviddoria
Registered Member
Posts
46
Karma
0
OS

"RunCommand when finished"

Sun Jul 05, 2009 1:18 am
Often I will start a long command running, and then realize that it's time to leave for the day before it is finished. It seems like a nice feature would be "file -> Run command when done" where you could tell konsole to run something like "shutdown -h now" whenever the current command finished and returned to the shell prompt. Does anyone know of a way to do that (after the command has started, ie. not after the fact, like command1; shutdown;)? Or does it seem like a reasonable feature request?

Thanks,
Dave
User avatar
Ignacio Serantes
Registered Member
Posts
453
Karma
1
OS

Re: "RunCommand when finished"

Sun Jul 05, 2009 10:40 am
Go to "System Settings", "Advanced" and try Autostart option.

I'm not used it but there is a combo in Script File with 3 options: "Startup", "Pre-KDE startup" and "Shutdown".
daviddoria
Registered Member
Posts
46
Karma
0
OS

Re: "RunCommand when finished"

Sun Jul 05, 2009 10:56 am
hm, I'm using gnome so I don't see this "autostart" - I'm assuming it's a KDE thing. Either way, that doesn't sound like what I'm looking for - I would imagine it would have to be a function of the terminal emulator, not the windowing system?
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS

Re: "RunCommand when finished"

Sun Jul 05, 2009 11:10 am
What kind of commands is it? Maybe you could use the "Monitor for silence" feature (you can set it to run a custom script in Settings -> Configure Notifications.

I'm not sure it's possible for Konsole to know when a command has finished.
Daniel_Boff
Registered Member
Posts
82
Karma
0

Re: "RunCommand when finished"

Mon Jul 13, 2009 12:03 pm
why don't you just to something like this:

yourcommand && shutdown -h now ?


or write a "control script", like

while [ 1 ]
do
sleep 1000

ps -aux | grep "your program name"

if [ $? --eq 1 ];then
shutdown -h now
fi
done

you could give "your program name" with a parameter to this script

it's not the perfect solution, but at least it works like this


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]