Sending SIGSTOP or SIGCONT signals graphically (similar to xkill)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
1
down vote
favorite
Question
Do you know any tool/script to send SIGSTOP
(to pause a process) or SIGCONT
(to resume it) to a process by clicking on a graphical window generated by the process?
Some context
There is already a tool called xkill
which kills programs by clicking on a window, but it has no options to send a particular signal. This is a pity, because somewhat related command-line tools like kill
have this option.
Usually I do this via command line by manually obtaining the corresponding process names and using tools like kill
, pkill
or killall
but it would be nice to be able to do this graphically, in a way similar to clicking on a window with the xkill
tool.
Applications
I would find such a tool very useful to graphically pause some heavy processes when the CPU is too "stressed" without terminating them and without losing data which cannot be saved (e.g. for partial results of long calculations).
xorg gui process signal xkill
add a comment |Â
up vote
1
down vote
favorite
Question
Do you know any tool/script to send SIGSTOP
(to pause a process) or SIGCONT
(to resume it) to a process by clicking on a graphical window generated by the process?
Some context
There is already a tool called xkill
which kills programs by clicking on a window, but it has no options to send a particular signal. This is a pity, because somewhat related command-line tools like kill
have this option.
Usually I do this via command line by manually obtaining the corresponding process names and using tools like kill
, pkill
or killall
but it would be nice to be able to do this graphically, in a way similar to clicking on a window with the xkill
tool.
Applications
I would find such a tool very useful to graphically pause some heavy processes when the CPU is too "stressed" without terminating them and without losing data which cannot be saved (e.g. for partial results of long calculations).
xorg gui process signal xkill
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Question
Do you know any tool/script to send SIGSTOP
(to pause a process) or SIGCONT
(to resume it) to a process by clicking on a graphical window generated by the process?
Some context
There is already a tool called xkill
which kills programs by clicking on a window, but it has no options to send a particular signal. This is a pity, because somewhat related command-line tools like kill
have this option.
Usually I do this via command line by manually obtaining the corresponding process names and using tools like kill
, pkill
or killall
but it would be nice to be able to do this graphically, in a way similar to clicking on a window with the xkill
tool.
Applications
I would find such a tool very useful to graphically pause some heavy processes when the CPU is too "stressed" without terminating them and without losing data which cannot be saved (e.g. for partial results of long calculations).
xorg gui process signal xkill
Question
Do you know any tool/script to send SIGSTOP
(to pause a process) or SIGCONT
(to resume it) to a process by clicking on a graphical window generated by the process?
Some context
There is already a tool called xkill
which kills programs by clicking on a window, but it has no options to send a particular signal. This is a pity, because somewhat related command-line tools like kill
have this option.
Usually I do this via command line by manually obtaining the corresponding process names and using tools like kill
, pkill
or killall
but it would be nice to be able to do this graphically, in a way similar to clicking on a window with the xkill
tool.
Applications
I would find such a tool very useful to graphically pause some heavy processes when the CPU is too "stressed" without terminating them and without losing data which cannot be saved (e.g. for partial results of long calculations).
xorg gui process signal xkill
edited Apr 23 at 18:56
asked Apr 23 at 18:21
Kubuntuer82
402213
402213
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
You can use xdotool
to allow the user to click a window and obtain its process ID. Then you can use kill
to send e.g. the STOP or CONT signals to that process and freeze/thaw it that way.
First, you probably have to install xdotool
, as it doesn't come preinstalled:
sudo apt install xdotool
Then, the command to get the PID of the process owning a specific window, which can be selected by clicking with the mouse, would be:
xdotool selectwindow getwindowpid
This prints the numeric process ID. You can use supply it as argument to kill -STOP
or kill -CONT
to pause and continue said process. This can be simplified by storing the PID in a variable, like in this little script below, which pauses the clicked window's process for 5 seconds:
#!/bin/bash
wpid="$(xdotool selectwindow getwindowpid)"
kill -STOP "$wpid"
sleep 5
kill -CONT "$wpid"
You could now save this script on your computer and e.g. bind it to a keyboard shortcut.
Note:
man xdotool
says about thegetwindowpid
subcommand:
"This requires effort from the application owning a window and may not work for all windows."
In other words, it might not work at all or at least not exactly as intended with some applications.
It could also happen that multiple windows have the same corresponding process ID, like e.g. all gnome-terminal instances are owned by the same parent. In that case, the command would freeze all of them, which might not be intended.
Just tested, it works perfectly, thanks!
â Kubuntuer82
Apr 23 at 20:45
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
You can use xdotool
to allow the user to click a window and obtain its process ID. Then you can use kill
to send e.g. the STOP or CONT signals to that process and freeze/thaw it that way.
First, you probably have to install xdotool
, as it doesn't come preinstalled:
sudo apt install xdotool
Then, the command to get the PID of the process owning a specific window, which can be selected by clicking with the mouse, would be:
xdotool selectwindow getwindowpid
This prints the numeric process ID. You can use supply it as argument to kill -STOP
or kill -CONT
to pause and continue said process. This can be simplified by storing the PID in a variable, like in this little script below, which pauses the clicked window's process for 5 seconds:
#!/bin/bash
wpid="$(xdotool selectwindow getwindowpid)"
kill -STOP "$wpid"
sleep 5
kill -CONT "$wpid"
You could now save this script on your computer and e.g. bind it to a keyboard shortcut.
Note:
man xdotool
says about thegetwindowpid
subcommand:
"This requires effort from the application owning a window and may not work for all windows."
In other words, it might not work at all or at least not exactly as intended with some applications.
It could also happen that multiple windows have the same corresponding process ID, like e.g. all gnome-terminal instances are owned by the same parent. In that case, the command would freeze all of them, which might not be intended.
Just tested, it works perfectly, thanks!
â Kubuntuer82
Apr 23 at 20:45
add a comment |Â
up vote
1
down vote
accepted
You can use xdotool
to allow the user to click a window and obtain its process ID. Then you can use kill
to send e.g. the STOP or CONT signals to that process and freeze/thaw it that way.
First, you probably have to install xdotool
, as it doesn't come preinstalled:
sudo apt install xdotool
Then, the command to get the PID of the process owning a specific window, which can be selected by clicking with the mouse, would be:
xdotool selectwindow getwindowpid
This prints the numeric process ID. You can use supply it as argument to kill -STOP
or kill -CONT
to pause and continue said process. This can be simplified by storing the PID in a variable, like in this little script below, which pauses the clicked window's process for 5 seconds:
#!/bin/bash
wpid="$(xdotool selectwindow getwindowpid)"
kill -STOP "$wpid"
sleep 5
kill -CONT "$wpid"
You could now save this script on your computer and e.g. bind it to a keyboard shortcut.
Note:
man xdotool
says about thegetwindowpid
subcommand:
"This requires effort from the application owning a window and may not work for all windows."
In other words, it might not work at all or at least not exactly as intended with some applications.
It could also happen that multiple windows have the same corresponding process ID, like e.g. all gnome-terminal instances are owned by the same parent. In that case, the command would freeze all of them, which might not be intended.
Just tested, it works perfectly, thanks!
â Kubuntuer82
Apr 23 at 20:45
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
You can use xdotool
to allow the user to click a window and obtain its process ID. Then you can use kill
to send e.g. the STOP or CONT signals to that process and freeze/thaw it that way.
First, you probably have to install xdotool
, as it doesn't come preinstalled:
sudo apt install xdotool
Then, the command to get the PID of the process owning a specific window, which can be selected by clicking with the mouse, would be:
xdotool selectwindow getwindowpid
This prints the numeric process ID. You can use supply it as argument to kill -STOP
or kill -CONT
to pause and continue said process. This can be simplified by storing the PID in a variable, like in this little script below, which pauses the clicked window's process for 5 seconds:
#!/bin/bash
wpid="$(xdotool selectwindow getwindowpid)"
kill -STOP "$wpid"
sleep 5
kill -CONT "$wpid"
You could now save this script on your computer and e.g. bind it to a keyboard shortcut.
Note:
man xdotool
says about thegetwindowpid
subcommand:
"This requires effort from the application owning a window and may not work for all windows."
In other words, it might not work at all or at least not exactly as intended with some applications.
It could also happen that multiple windows have the same corresponding process ID, like e.g. all gnome-terminal instances are owned by the same parent. In that case, the command would freeze all of them, which might not be intended.
You can use xdotool
to allow the user to click a window and obtain its process ID. Then you can use kill
to send e.g. the STOP or CONT signals to that process and freeze/thaw it that way.
First, you probably have to install xdotool
, as it doesn't come preinstalled:
sudo apt install xdotool
Then, the command to get the PID of the process owning a specific window, which can be selected by clicking with the mouse, would be:
xdotool selectwindow getwindowpid
This prints the numeric process ID. You can use supply it as argument to kill -STOP
or kill -CONT
to pause and continue said process. This can be simplified by storing the PID in a variable, like in this little script below, which pauses the clicked window's process for 5 seconds:
#!/bin/bash
wpid="$(xdotool selectwindow getwindowpid)"
kill -STOP "$wpid"
sleep 5
kill -CONT "$wpid"
You could now save this script on your computer and e.g. bind it to a keyboard shortcut.
Note:
man xdotool
says about thegetwindowpid
subcommand:
"This requires effort from the application owning a window and may not work for all windows."
In other words, it might not work at all or at least not exactly as intended with some applications.
It could also happen that multiple windows have the same corresponding process ID, like e.g. all gnome-terminal instances are owned by the same parent. In that case, the command would freeze all of them, which might not be intended.
answered Apr 23 at 19:25
![](https://i.stack.imgur.com/m8DYH.jpg?s=32&g=1)
![](https://i.stack.imgur.com/m8DYH.jpg?s=32&g=1)
Byte Commander
59.2k26159267
59.2k26159267
Just tested, it works perfectly, thanks!
â Kubuntuer82
Apr 23 at 20:45
add a comment |Â
Just tested, it works perfectly, thanks!
â Kubuntuer82
Apr 23 at 20:45
Just tested, it works perfectly, thanks!
â Kubuntuer82
Apr 23 at 20:45
Just tested, it works perfectly, thanks!
â Kubuntuer82
Apr 23 at 20:45
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1027547%2fsending-sigstop-or-sigcont-signals-graphically-similar-to-xkill%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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