This repos contains building blocks to track and act upon user's shift of attention; specifically to deny standby power to greedy applications - like chrome and firefox - while retaining as much functionnality as possible.
- sudo apt install xdotool
- backup ~/.bashrc
- add content of .bashrc.addon to ~/.bashrc
- copy file .bashrc.checkIT.lib.v1 to ~/
- run
source ~/.bashrc
run checkFirefox
, toggle Firefox window.
Chrome to pause on blur event and to resume on focus event:
checkProcess 'chrome' 'chrome'
Firefox to pause 5 seconds past onblur event unless current tab title matches fond or favorite:
checkProcess 'Firefox' 'firefox' 'unless' '(fond|favorite)' 'with pause surge delays of' 5 0
Slack to pause 5 seconds past onblur event and to awaken for 5 seconds every 30 seconds:
checkProcess 'Slack' 'slack' 'with pause surge delays of' 5 30
checkProcess classMatcher pidofNameArg ['unless' titleMatcher] ['with pause surge delays of' pauseDelay surgeDelay]
Argument | Description |
---|---|
classMatcher | Class matcher of targeted application, run xprop | grep WM_CLASS for hint |
pidofNameArg | Program name for pidof program name to return pid of targeted application |
titleMatcher | Title matcher of targeted application to ignore, run xprop | grep WM_NAME for hint |
pauseDelay | CPU cutoff delay, in seconds |
surgeDelay | CPU cutoff recess delay, in seconds, if greater than 0 |
Proof of concept, MVP, tested on Ubuntu.