Coder Social home page Coder Social logo

rpi-curious / xscreensaver-hot-potato Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 31 KB

Logs CPU temperature and active screen-saver, and may disable available screen savers

License: GNU Affero General Public License v3.0

Shell 100.00%
raspberry-pi temperature-monitoring xscreensaver cronjob

xscreensaver-hot-potato's Introduction

XScreenSaver Hot Potato

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.

Byte size of xscreensaver-hot-potato.sh Open Issues Open Pull Requests Latest commits


Table of Contents


Quick Start

Git Commands

  1. Make a directory for Git sources

  2. Change current directory to sub-directory path

  3. Clone the source

mkdir -vp "${HOME}/git/hub/rpi-curious"

cd "${HOME}/git/hub/rpi-curious"

git clone --recurse-submodules [email protected]:rpi-curious/xscreensaver-hot-potato.git

Install Commands

  1. Link xscreensaver-hot-potato.sh to a PATH accessible location

  2. Set ownership and executable permissions

  3. 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

  1. Change directory to repository root

  2. Pull changes to source code

  3. Update submodule tracked source code

cd "${HOME}/git/hub/rpi-curious/xscreensaver-hot-potato"

git pull

git submodule update --init --merge --recursive

XScreenSaver Hot Potato API

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


Notes

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.


Attribution

Resources that where helpful in building this project so far.


License

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/>.

xscreensaver-hot-potato's People

Contributors

dependabot-preview[bot] avatar s0ands0 avatar

Watchers

 avatar  avatar

Forkers

anima-os-dev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.