Brett Robinson authored 1 month ago
A colourful binary clock for the terminal.
Peaclock is a customizable binary clock made for the terminal.
Each column represents a single digit. The first two columns are the two hour digits, the next two are the minute digits, and the last two are the seconds digits.
The bottom row is the low-order bit, which makes it worth a value of 1. The next row up is worth 2, then 4, followed by 8. Adding up the on bits gives the value of the digit.
| | | < 8 | || || < 4 || || || < 2 || || || < 1 HH:MM:SS
View the usage and help output with the
The help output also contains the documentation for the key bindings and commands for customization.
The default config locations are
A custom path can also be passed to override the default locations using the
The config directory and file must be created by the user.
If the file does not exist, the program continues as normal.
config, is a plain text file that can contain any of the commands listed in the Commands section of the
Each command must be on its own line.
Lines that begin with the
# character are treated as comments.
An example config file would look like the following:
1 2 3 4 5 6 7 8 9 10
# peaclock config set compact off set char - set hour 24 set bold on set binary on set digital off set active #4feae7 set inactive #2c323c
The default colour output is chosen depending on the presence of the
COLORTERM environment variable.
Most modern terminal emulators that support true colour will automatically set this variable to either
If either of those values are found, peaclock will default to using 24-bit or true colour.
If the variable is empty, or set to anything else, peaclock will default to using 4-bit colours.
The default chosen is for the initial state, one can still set the colours to use another value.
If the terminal doesn't support the value given, it may just end up showing as the colour white.
The following shell command will build the project in release mode:
To build in debug mode, run the script with the
The following shell command will install the project in release mode:
To install in debug mode, run the script with the
This project is licensed under the MIT License.
Copyright (c) 2019 Brett Robinson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.