On one of my Linux systems, I've got a CPU and GPU core running most of the time. However, for gaming purposes, or when GPU folding interferes with video playback on my browser, I pause the GPU slot. To do this, I have the following custom hotkeys:
Ctrl + F12: FAH Pause:
Code: Select all
sh -c "FAHClient --send-pause; notify-send \"Folding Paused\""
F12: FAH Resume:
Code: Select all
sh -c "FAHClient --send-unpause; notify-send \"Folding Resumed\""
This works just fine. However, I have a lot of hotkeys, many of which toggle on/off states like the above. In an effort to save on available keys, I was wondering if anyone knew how to combine the two commands into one key, so that, for example, pressing F12 the first time will pause, and pressing it a second time will unpause.
Now, considering that FAHControl shows the state of each slot, such as whether it is running, paused, finishing, or failed, there must be a way to get that same information via the command line. Question is, what do I type to obtain the state of slot x? If I can get that data, I should be able to write a simple if/then statement to create a toggle.