seduction
 Language:
Welcome, Guest. Please login or register.
Did you miss your activation email?
2019/07/19, 18:18:20


Help

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: nosuspend - avoid computer suspend as long a app is running  (Read 1269 times)

0 Members and 1 Guest are viewing this topic.

Offline brummer

  • User
  • Posts: 270
    • http://guitarix.sourceforge.net/
I've set my box to blank screen after 5min idle, and suspend after 10min.
This works well for me, so when leaving my PC alone, I could be assured that it switch itself into suspend to save some energy.

Just sometimes, I like to hear some music, or hang out in a IRC channel, or doing a take long time compile, then, I don't wont that my PC goes into suspend mode, even when I leave it alone for some time.

True, I could switch suspend on/off in the energy settings, but I found it unpractical.
So I wrote a little tool to avoid suspend or shutdown on privileged level (e.g. root) when a running user process shouldn't be interrupted. It's nosuspend.

Usage nosuspend, simply run before another command as in: nosuspend appname -parameter for appname
Full bash completion is supported for easy command substitution.
nosuspend use a PolKit rule allowing active users to set the systemd-inhibit flag with UID 0/root priority and avoid this way that the PC could suspend or shutdown during the given app is running .

It has a "secure" mode, where you must enter the root password in order to run it, and a "relaxed" mode, which ain't require password. The mode needs to be selected during compile time.

Maybe it is of some use for the one or the other here, you can get it here:
https://github.com/brummer10/nosuspend



regards

Offline devil

  • Administrator
  • User
  • *****
  • Posts: 4.341
Re: nosuspend - avoid computer suspend as long a app is running
« Reply #1 on: 2017/07/31, 12:38:06 »
Hi,


nützliches Tool. Ich hab es mal beim Linux User zur Kurzvorstellung eingereicht.




Offline brummer

  • User
  • Posts: 270
    • http://guitarix.sourceforge.net/
Re: nosuspend - avoid computer suspend as long a app is running
« Reply #2 on: 2017/08/02, 05:34:06 »
Hi Devil

Thanks.  :)

I'm glade you find it useful.

Offline David

  • Gamer Aristocrat
  • User
  • Posts: 73
  • MAKE QUAKE GREAT AGAIN
Re: nosuspend - avoid computer suspend as long a app is running
« Reply #3 on: 2019/02/28, 02:10:37 »
the real question: why do you need a tool to switch off sleep mode in the first place


why isnt there a button for that in a menu somewhere, or a line in a config file
every GNU/Linux distro should come with quake (shareware floppy contents) running on a sourceport. If this happens, quake will quickly become the world's #1 first person shooter once again

Quake for GOTY 2020

Offline brummer

  • User
  • Posts: 270
    • http://guitarix.sourceforge.net/
Re: nosuspend - avoid computer suspend as long a app is running
« Reply #4 on: 2019/02/28, 07:36:29 »
the real question: why do you need a tool to switch off sleep mode in the first place


why isnt there a button for that in a menu somewhere, or a line in a config file
You could en/disable suspend in the energy settings.
nosuspend is for those who usually prefer the terminal to do stuff, instead clicking around in a menu and a GUI. 

Offline piper

  • Global Moderator
  • User
  • *****
  • Posts: 1.642
  • we are the priests ... of the temples of syrinx
Re: nosuspend - avoid computer suspend as long a app is running
« Reply #5 on: 2019/02/28, 12:13:43 »
Yeppers, terminal kills gui again ;)

I love yakauke  :P
"We're all grown up and don't freak out when a piece of text contains the word 'fuck'. I still don't understand why people think that the word 'fuck' is what would keep certain groups from contributing to the Linux kernel. In all seriousness, it doesn't."

John Paul Adrian Glaubitz

Offline David

  • Gamer Aristocrat
  • User
  • Posts: 73
  • MAKE QUAKE GREAT AGAIN
Re: nosuspend - avoid computer suspend as long a app is running
« Reply #6 on: 2019/03/02, 18:00:48 »
yes I 100% agree that being able to use the terminal is more important on linux.


still curious why there isn't a command you could run to disable it in a program's configs, or edit the configs directly without having some script run in the background all the time
every GNU/Linux distro should come with quake (shareware floppy contents) running on a sourceport. If this happens, quake will quickly become the world's #1 first person shooter once again

Quake for GOTY 2020

Offline brummer

  • User
  • Posts: 270
    • http://guitarix.sourceforge.net/
Re: nosuspend - avoid computer suspend as long a app is running
« Reply #7 on: 2019/03/02, 19:25:01 »
yes I 100% agree that being able to use the terminal is more important on linux.


still curious why there isn't a command you could run to disable it in a program's configs, or edit the configs directly without having some script run in the background all the time
nosuspend isn't a script, it's a console program written in C. It ain't running all the time, only, when you run it in the console, it hand over the process name from the program you ain't want to be interrupted by suspend, set the needed flags in systemd-inhibit , and exit itself.  That takes less then a micro second. That is all the time the program run.When the program/process stops, which you've selected to ain't be interrupted, anything go's back to normal by itself, no interaction of nosuspend is needed therefore.
So, it's exactly the command you wonder about why it ain't exist.