Home
Softono
ClockTemp

ClockTemp

Open source Python
102
Stars
7
Forks
0
Issues
2
Watchers
3 months
Last Commit

About ClockTemp

A TUI clock that displays time, date, temperature and more.

Platforms

Web Self-hosted

Languages

Python

Links

ClockTemp is a TUI clock inspired by tty-clock that displays the time, date, temperature and more.


InstallationUninstallCommands and KeysCreditsResources Used Contributors

Installation

[!IMPORTANT] Prerequisites: Python version 3.x and requests library

  1. 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
  2. On your terminal navigate to the project directory

    cd YOUR/DIRECTORY/ClockTemp/script
  3. Run the install.sh file to install ClockTemp into your environment variables

    sudo ./install.sh
  4. Now whenever you run the clocktemp 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.

  1. On your terminal open bashrc / zshrc
    nano ~/.bashrc # If Bash is your shell
 nano ~/.zshrc # If ZSH is your shell
  1. 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'
  2. Save your changes pressing CTRL + O > ENTER and exit with CTRL + X

  3. Apply changes on your terminal

    source ~/.bashrc # If Bash is your shell
 source ~/.zshrc # If ZSH is your shell
  1. Now whenever you run the clocktemp 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:

  1. Run this command to remove the clocktemp folder from local/bin
    sudo rm /usr/local/bin/clocktemp
  2. 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 clock.py 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 <[email protected]>
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 Python version 3.10.12, the Requests library and Open-Meteo API to collect weather data.

License

The ClockTemp project as a whole is licensed under the GNU General Public License v3 (GPLv3). See the LICENSE file for details.

Contributors


Arthur D.

binsld

Keithse

Star History

Star History Chart