LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   A screen clock. (https://www.linuxquestions.org/questions/linux-newbie-8/a-screen-clock-4175696516/)

fancycarp 06-16-2021 07:44 AM

A screen clock.
 
How can I get a constant display of the time and date on the screen?

I have no task-bar. But I've got cairo-dock.

wpeckham 06-16-2021 08:27 AM

https://packages.debian.org/stable/c...-clock-plug-in

teckk 06-16-2021 01:39 PM

You can have a clock at the top of the terminal.

Basic example:
Code:

#! /usr/bin/env bash

tput clear

clock() {
    while sleep 1; do
        tput sc
        tput cup 0 $(($(tput cols)/3))
        tput rev
        date
        tput rc
    done
}

clock &
clock_pid=$!
echo "clock pid is "$clock_pid""

Or make yourself a little graphical digital clock.
Code:

#!/usr/bin/python

from tkinter import *
from time import strftime
 
root = Tk()
root.title('Clock')

def time():
    string = strftime('%H:%M:%S %p')
    lbl.config(text = string)
    lbl.after(1000, time)
 
lbl = Label(root, font = ('arial', 50, 'bold'),
            background = 'black',
            foreground = 'white')

lbl.pack(anchor = 'center')
time()
 
mainloop()

Edit: Correct fontname

ArfaSmif 06-16-2021 06:51 PM

You can also try conky.

frankbell 06-16-2021 07:53 PM

GKrellM includes date and time.

Also. the venerable application xclock can be configured to show date and time. I use xclock


All times are GMT -5. The time now is 02:39 AM.