Eclectic Media Git caffeine / 5130142
Expanded docs in README.rst Ariana Giroux 4 months ago
1 changed file(s) with 37 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
00 About
11 =====
22
3 Prevents TMUX from starting its screensaver, then displays a *cheeky little ascii-art cup of coffee as rendered by aview*.
3 Executes a user script that either enables or disables a screensaver, then "gives the user a coffee" by rendering an image of a coffeecup as ascii art.
4
5 The script uses the pixabay.com developer API to obtain random images of coffee cups, then uses ``asciiview``/``aview`` to display that image as asciiart in the terminal. To obtain your own developer key, please see https://pixabay.com/api/docs/.
6
7 .. note:: The repository provides a utility script to enroll new key's securely, so the user does not need to enter their API key every time. See ``utils/enroll-key.sh`` for more.
48
59 Installation
610 ============
1822 sudo apt-get install aview imagemagick # imagemagick is a helper library for aview
1923
2024
25 It is also useful to save your API key to local storage and ensure that the file is only read access to you and no other users. To do so, use the utility script: ::
26
27 ./utils/enroll-key.sh # saves key to ~/.config/caffeine/keyfile
28
29
30 The software will always attempt to run a script, and will fail if no script can be found. The software looks for scripts on the following paths: ::
31
32 /etc/caffeine/caffeine_script,
33 ~/.config/caffeine/caffeine_script,
34 /opt/caffeine/caffeine_script,
35 ./caffeine_script
36
37
38 .. note:: for the software to discover the script properly, it must be executable and contain a shebang line.
39
40
41 The software will call your script with one of two arguments: ::
42
43 enable --OR-- disable
44
45 Your script should handle these argument states, where ``enable`` tells the script to enable the screensaver. Aside from handling the argument and being executable, there are no specific requirements for what the script should do. This is so that you can patch in whatever method you need for screensaver interaction. Therefore, to complete the setup you will need to set up your script and include it on one of the above paths. For example scripts, check the ``examples/`` directory.
46
47
48 Usage
49 =====
50
51 Once the module has been installed via Pypi/pip, you can simply run: ::
52
53 caffeine # disables screen saver (passes 'disable' to script)
54 decaf # enables screen saver (passes 'enable' to script)
55
56
2157 LICENSE
2258 =======
2359