xscreensaver-hot-potato.sh
, for passively cooled devices with limited resources. Logs CPU temperature and active screen-saver, and depending upon configurations and logs may toggle available screen savers.
The following covers how to install this branch as a crontab job, and parameters that
xscreensaver-hot-potato.sh
currently responds to.
Git Commands
-
Make a directory for Git sources
-
Change current directory to sub-directory path
-
Clone the source
mkdir -vp "${HOME}/git/hub/rpi-curious"
cd "${HOME}/git/hub/rpi-curious"
git clone --recurse-submodules git@github.com:rpi-curious/xscreensaver-hot-potato.git
Install Commands
-
Link
xscreensaver-hot-potato.sh
to aPATH
accessible location -
Set ownership and executable permissions
-
Write a
crontab
entry
sudo ln -s "${HOME}/git/hub/rpi-curious/xscreensaver-hot-potato/xscreensaver-hot-potato.sh" '/usr/local/sbin/'
sudo chown ${USER}:${GROUPS} '/usr/local/sbin/xscreensaver-hot-potato.sh'
chmod u+x "${HOME}/git/hub/rpi-curious/xscreensaver-hot-potato/xscreensaver-hot-potato.sh"
sudo crontab -e
Example: crontab
entry
*/2 * * * * su pi -c "/usr/local/sbin/xscreensaver-hot-potato.sh --max-temp-c 75 --log-path /tmp/xscreensaver-hot-potato.log --config-path /home/pi/.xscreensaver"
Example: logged hacks
# 2019-08-05 Monday 15:22:01 - Screensaver 206 ringradius - Temperature: 76
# 2019-08-05 Monday 23:22:02 - Screensaver 147 mirrorblob - Temperature: 76
# 2019-08-05 Monday 23:24:01 - Screensaver 70 bumps - Temperature: 77
# 2019-08-05 Monday 23:26:01 - Screensaver 159 interaggregate - Temperature: 76
# 2019-08-06 Tuesday 00:10:01 - Screensaver 151 popsquares - Temperature: 76
Note a more substantial example may be found under
.examples/xscreensaver_hot_potato.log
Example: disable xscreensaver
hacks that overheat device
xscreensaver-hot-potato.sh\
--log-path /tmp/xscreensaver-hot-potato.log\
--config-path ~/.xscreensaver\
--offence-limit 3
Update
-
Change directory to repository root
-
Pull changes to source code
-
Update submodule tracked source code
cd "${HOME}/git/hub/rpi-curious/xscreensaver-hot-potato"
git pull
git submodule update --init --merge --recursive
Arguments | Type | Description |
---|---|---|
-h --help help |
boolean | Prints possibly helpful message and exits |
-l --license license |
boolean | Prints license and exits |
--max-temp-c max-temp-c |
number | Max temperature in Celsius before logging of xscreensaver hack name is triggered |
--max-temp-f max-temp-f |
number | Max temperature in Fahrenheit before logging of xscreensaver hack name is triggered |
--log-path --log |
path | File path that temperature and xscreensaver hack names are logged to |
--config-path --config config-path |
path | File path that xscreensaver configurations are read from |
--offence-limit --limit offence-limit |
number | Max number any individual xscreensaver hack name may be logged, after which |
Throws Parameter_Error: no configuration file found
, when --config-path
is not defined
Tested on Raspberry Pi revisions 2 and 3, and may operate on other Linux based system on a chip devices.
The --help
option may be used in combination with other options to check that things are assigned as expected.
Setting --max-temp-f
instead of --max-temp-c
will cost a bit more in computation, because conversions are required.
Until run with --offence-limit
the xscreensaver-hot-potato.sh
script will not disable any xscreensaver
hacks.
Timing for crontab
should capture 2 to 3 samples at minimum per default cycle, and xscreensaver
should be configured to cycle through available hacks.
Resources that where helpful in building this project so far.
-
Stack Overflow
-
Unix Stack Exchange
XScreenSaver Hot Potato submodule quick start documentation
Copyright (C) 2019 S0AndS0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation; version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.