How to run a command when any process starts?
up vote
0
down vote
favorite
I have an sh script to update my wallpaper which uses pscircle in order to display running processes. The script runs every five seconds to update the wallpaper, but I would like it so that the script runs whenever any process starts or stops. Is this possible?
Edit 1: Could also just make it check the number of processes running under my user name
Edit 2: Might have to add an exception for pscircle itself
linux bash script sh
|
show 1 more comment
up vote
0
down vote
favorite
I have an sh script to update my wallpaper which uses pscircle in order to display running processes. The script runs every five seconds to update the wallpaper, but I would like it so that the script runs whenever any process starts or stops. Is this possible?
Edit 1: Could also just make it check the number of processes running under my user name
Edit 2: Might have to add an exception for pscircle itself
linux bash script sh
While it might be possible, it would also be a big mistake: When thepscircle
process starts it would create another trigger, which would startpscircle
...
– Eugen Rieck
Dec 1 at 20:13
Ah yea I didn't realize that. Might have to create an exception of some sort
– The Forgotten King
Dec 1 at 20:14
2
And of course you startpscircle
with abash
script, so there is another exception, and the wallpaper change starts a dbus session, creating another process, plus what cron and friends do ... you'd end up with your system being quite busy just changing wallpapers.
– Eugen Rieck
Dec 1 at 20:16
What stops you from using a load indicator applet and do the pscircle magic only every few seconds?
– Eugen Rieck
Dec 1 at 20:17
@EugenRieck is completely right here. In just a second over 100 processes can start and stop in that same second (processes like forking web servers). Changing your wallpaper that frequently will just crash your system.
– Fanatique
Dec 1 at 21:18
|
show 1 more comment
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have an sh script to update my wallpaper which uses pscircle in order to display running processes. The script runs every five seconds to update the wallpaper, but I would like it so that the script runs whenever any process starts or stops. Is this possible?
Edit 1: Could also just make it check the number of processes running under my user name
Edit 2: Might have to add an exception for pscircle itself
linux bash script sh
I have an sh script to update my wallpaper which uses pscircle in order to display running processes. The script runs every five seconds to update the wallpaper, but I would like it so that the script runs whenever any process starts or stops. Is this possible?
Edit 1: Could also just make it check the number of processes running under my user name
Edit 2: Might have to add an exception for pscircle itself
linux bash script sh
linux bash script sh
edited Dec 1 at 20:14
asked Dec 1 at 20:10
The Forgotten King
11
11
While it might be possible, it would also be a big mistake: When thepscircle
process starts it would create another trigger, which would startpscircle
...
– Eugen Rieck
Dec 1 at 20:13
Ah yea I didn't realize that. Might have to create an exception of some sort
– The Forgotten King
Dec 1 at 20:14
2
And of course you startpscircle
with abash
script, so there is another exception, and the wallpaper change starts a dbus session, creating another process, plus what cron and friends do ... you'd end up with your system being quite busy just changing wallpapers.
– Eugen Rieck
Dec 1 at 20:16
What stops you from using a load indicator applet and do the pscircle magic only every few seconds?
– Eugen Rieck
Dec 1 at 20:17
@EugenRieck is completely right here. In just a second over 100 processes can start and stop in that same second (processes like forking web servers). Changing your wallpaper that frequently will just crash your system.
– Fanatique
Dec 1 at 21:18
|
show 1 more comment
While it might be possible, it would also be a big mistake: When thepscircle
process starts it would create another trigger, which would startpscircle
...
– Eugen Rieck
Dec 1 at 20:13
Ah yea I didn't realize that. Might have to create an exception of some sort
– The Forgotten King
Dec 1 at 20:14
2
And of course you startpscircle
with abash
script, so there is another exception, and the wallpaper change starts a dbus session, creating another process, plus what cron and friends do ... you'd end up with your system being quite busy just changing wallpapers.
– Eugen Rieck
Dec 1 at 20:16
What stops you from using a load indicator applet and do the pscircle magic only every few seconds?
– Eugen Rieck
Dec 1 at 20:17
@EugenRieck is completely right here. In just a second over 100 processes can start and stop in that same second (processes like forking web servers). Changing your wallpaper that frequently will just crash your system.
– Fanatique
Dec 1 at 21:18
While it might be possible, it would also be a big mistake: When the
pscircle
process starts it would create another trigger, which would start pscircle
...– Eugen Rieck
Dec 1 at 20:13
While it might be possible, it would also be a big mistake: When the
pscircle
process starts it would create another trigger, which would start pscircle
...– Eugen Rieck
Dec 1 at 20:13
Ah yea I didn't realize that. Might have to create an exception of some sort
– The Forgotten King
Dec 1 at 20:14
Ah yea I didn't realize that. Might have to create an exception of some sort
– The Forgotten King
Dec 1 at 20:14
2
2
And of course you start
pscircle
with a bash
script, so there is another exception, and the wallpaper change starts a dbus session, creating another process, plus what cron and friends do ... you'd end up with your system being quite busy just changing wallpapers.– Eugen Rieck
Dec 1 at 20:16
And of course you start
pscircle
with a bash
script, so there is another exception, and the wallpaper change starts a dbus session, creating another process, plus what cron and friends do ... you'd end up with your system being quite busy just changing wallpapers.– Eugen Rieck
Dec 1 at 20:16
What stops you from using a load indicator applet and do the pscircle magic only every few seconds?
– Eugen Rieck
Dec 1 at 20:17
What stops you from using a load indicator applet and do the pscircle magic only every few seconds?
– Eugen Rieck
Dec 1 at 20:17
@EugenRieck is completely right here. In just a second over 100 processes can start and stop in that same second (processes like forking web servers). Changing your wallpaper that frequently will just crash your system.
– Fanatique
Dec 1 at 21:18
@EugenRieck is completely right here. In just a second over 100 processes can start and stop in that same second (processes like forking web servers). Changing your wallpaper that frequently will just crash your system.
– Fanatique
Dec 1 at 21:18
|
show 1 more comment
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1380036%2fhow-to-run-a-command-when-any-process-starts%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
While it might be possible, it would also be a big mistake: When the
pscircle
process starts it would create another trigger, which would startpscircle
...– Eugen Rieck
Dec 1 at 20:13
Ah yea I didn't realize that. Might have to create an exception of some sort
– The Forgotten King
Dec 1 at 20:14
2
And of course you start
pscircle
with abash
script, so there is another exception, and the wallpaper change starts a dbus session, creating another process, plus what cron and friends do ... you'd end up with your system being quite busy just changing wallpapers.– Eugen Rieck
Dec 1 at 20:16
What stops you from using a load indicator applet and do the pscircle magic only every few seconds?
– Eugen Rieck
Dec 1 at 20:17
@EugenRieck is completely right here. In just a second over 100 processes can start and stop in that same second (processes like forking web servers). Changing your wallpaper that frequently will just crash your system.
– Fanatique
Dec 1 at 21:18