ClockTemp
A TUI clock that displays time, date, temperature and more.
Install / Use
/learn @arthur-dnts/ClockTempREADME
Installation
[!IMPORTANT] Prerequisites: Python version 3.x and requests library
- Clone the repository to have local access to all the necessary files. You can do this using the following command:
git clone https://github.com/arthur-dnts/ClockTemp.git
- On your terminal navigate to the project directory
cd YOUR/DIRECTORY/ClockTemp/script
- Run the <code>install.sh</code> file to install ClockTemp into your environment variables
sudo ./install.sh
- Now whenever you run the <code>clocktemp</code> command in your terminal the script will work
clocktemp
[!TIP] Since ClockTemp has many customization options, you can create an alias in Bashrc / Zshrc to set the desired options once.
- On your terminal open bashrc / zshrc
nano ~/.bashrc # If Bash is your shell
nano ~/.zshrc # If ZSH is your shell
- At the end of the file add your custom configuration
alias clocktemp='clocktemp -tf YOUR_TIME_FORMAT -df YOUR_DATE_FORMAT -tu YOUR_TEMPERATURE_UNIT -s SHOW_OR_HIDE_SECONDS -lat YOUR_LATITUDE -lon YOUR_LONGITUDE -c YOUR_TEXT_COLOR -b YOUR_BACKGROUND_COLOR'
-
Save your changes pressing <code>CTRL + O</code> > <code>ENTER</code> and exit with <code>CTRL + X</code>
-
Apply changes on your terminal
source ~/.bashrc # If Bash is your shell
source ~/.zshrc # If ZSH is your shell
- Now whenever you run the <code>clocktemp</code> command without arguments the alias will cause the previously saved settings to be loaded.
clocktemp
Remove ClockTemp
[!NOTE] If you want to remove ClockTemp from your environment variables, follow these steps:
- Run this command to remove the clocktemp folder from local/bin
sudo rm /usr/local/bin/clocktemp
- Run this another command to remove the clocktemp folder from local/share
sudo rm -r /usr/local/share/clocktemp
Commands and Interactive Keys list
| COMMAND | CHOICES | DEFAULT | FUNCTION | |:-------:|:-------:|:-------:|:--------:| | -h, --help | None | None | Show help message and exit | | -v, --version | None | None | Show program's version and exit | | -tf | 12 / 24 | 12 | Change time format between 12-hour and 24-hour | | -df | mm/dd / dd/mm | mm/dd | Change date format between MM/DD/YYYY and DD/MM/YYYY | | -tu | c / f | c | Change temperature unit between Celsius and Fahrenheit | | -bd | true / false | false | Use bold characters | | -s | true / false | true | Show or hide seconds | | -a | true / false | true | Stop timer/stopwatch after reset | | -c | white / black / red / yellow / green / cyan / blue / magenta | white | Change text color | | -b | default / white / black / red / yellow / green / cyan / blue / magenta | default | Change background color | | -lat | Any latitude | 0 | Use the user's latitude to get weather data from Open-Meteo API | | -lon | Any longitude | 0 | Use the user's longitude to get weather data from Open-Meteo API |
Example command:
clocktemp -tf 24 -df dd/mm -tu c -s true -lat 12.345 -lon -67.891 -c cyan -b default
| KEYS | FUNCTION | |:--------:|:--------:| | w | Switch to clock mode | | c | Switch to calendar mode | | s | Switch to stopwatch mode | | t | Switch to timer mode | | h | Switch to help menu | | r | Reset (only in stopwatch or timer modes) | | SPACEBAR | Pause/Resume (only in stopwatch or timer modes) | | < / , | Previous month (only in calendar mode) | | > / . | Next month (only in calendar mode) | | q or ESC | Quit program |
Credits
The digit display matrix of <code>clock.py</code> archive was adapted from tty-clock, licensed under the BSD-3 Clause:
Copyright (c) 2009-2018 tty-clock contributors
Copyright (c) 2008-2009 Martin Duquesnoy <xorg62@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the tty-clock nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Resources used
This project was made using <code>Python</code> version 3.10.12, the <code>Requests</code> library and <code>Open-Meteo</code> API to collect weather data.
License
The <code>ClockTemp</code> project as a whole is licensed under the GNU General Public License v3 (GPLv3). See the <a href="https://github.com/arthur-dnts/ClockTemp/blob/main/LICENSE">LICENSE</a> file for details.
Contributors
| <div><img width=100 src="https://avatars.githubusercontent.com/u/73240555?v=4"><br><span>Arthur D.</span></div> | <div><img width=100 src="https://avatars.githubusercontent.com/u/193435795?v=4"><br><span>binsld</span></div> | <div><img width=100 src="https://avatars.githubusercontent.com/u/132654506?v=4"><br><span>Keithse</span></div> | |:-------:|:-------:|:-------:|
