LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - News > Syndicated Linux News
User Name
Password
Syndicated Linux News This forum is for the discussion of Syndicated Linux News stories.

Notices


Reply
  Search this Thread
Old 01-22-2008, 10:20 PM   #1
LXer
LXer NewsBot
 
Registered: Dec 2005
Posts: 128,282

Rep: Reputation: 118Reputation: 118
LXer: CLI Magic: Use ANSI escape sequences to display a clock in your terminal


Published at LXer:

When I'm in a Linux terminal, I often find myself typing date just to see the time. To make life a bit easier, I wrote a script to always display a clock in the top right corner of the screen. The script saves the current cursor position with an ANSI escape sequence instruction. Then, using the tput command, the cursor is sent to row 0 (the top of the screen) and the last column minus 19 characters (19 is the length of HH:MM:SS YYYY-MM-DD). The formatted date command is displayed in green inverted color. The cursor is then sent back to its original position with another ANSI sequence that restores the original saved position.

Read More...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Less outputs ANSI escape sequences sprocketboy Mandriva 2 08-05-2009 08:22 PM
LXer: CLI Magic: The five Ws LXer Syndicated Linux News 0 07-24-2006 07:21 PM
LXer: CLI Magic: When LXer Syndicated Linux News 0 04-03-2006 02:33 PM
How to stop terminal escape sequences ? Mike Davies Linux - Newbie 1 08-08-2004 11:37 AM
Xterm escape sequences GrayGh0st Linux - Software 3 07-19-2003 12:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - News > Syndicated Linux News

All times are GMT -5. The time now is 07:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration