LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-26-2017, 01:01 PM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Rep: Reputation: 255Reputation: 255Reputation: 255
Very Tiny Xclock programme?


Hello,

I have several xclock (x11 clock) from GIT, but I am still looking for the tiniest one.

I would like of course to learn from it, and it has a learning step for me in mind.

Would you have a tiny xclock in mind, whatever analog or digital, the tiniest the best.

The idea would to put it down, as well, as does the xlock (x11 by default). xclock -digital -geometry -0-0

Thank you.

(My desktop: evilwm forked)
 
Old 04-26-2017, 06:56 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Xeratul View Post
Hello,

I have several xclock (x11 clock) from GIT, but I am still looking for the tiniest one.

I would like of course to learn from it, and it has a learning step for me in mind.

Would you have a tiny xclock in mind, whatever analog or digital, the tiniest the best.

The idea would to put it down, as well, as does the xlock (x11 by default). xclock -digital -geometry -0-0

Thank you.

(My desktop: evilwm forked)

why do you not get the source code for the smallest one you got, then find the dimensions and change them to make it smaller, then recompile it?

Last edited by BW-userx; 04-26-2017 at 07:06 PM.
 
1 members found this post helpful.
Old 04-27-2017, 12:55 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
http://projects.l3ib.org/lal/
 
1 members found this post helpful.
Old 04-27-2017, 12:59 AM   #4
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
apt-get source x11-apps
and into xclock

I changed one part of Clock.c to the following:
Quote:
static char *
TimeString (ClockWidget w, struct tm *tm)
{
static char brief[6];
sprintf (brief, "TEST %02d:%02d", tm->tm_hour, tm->tm_min);
return brief;
}
loaded with xclock -digital -geometry -0-0

it gives what I want.

I wonder why such a simple clock, digital, in less than 150 -1000 lines is not yet existing. This is a simple X11 lib use and gcc.
 
Old 04-27-2017, 01:11 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
http://projects.l3ib.org/lal/files/lal-1.1.tar.gz
300 lines, including empty lines, nice formatting, and a summary of the GPL.
i'm sure you could squeeze that to less than 150.
 
Old 04-27-2017, 10:33 AM   #6
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by ondoho View Post
http://projects.l3ib.org/lal/files/lal-1.1.tar.gz
300 lines, including empty lines, nice formatting, and a summary of the GPL.
i'm sure you could squeeze that to less than 150.
likely, pitty that it is not so simpler, ... just x11 text...

Anytime, thank you very muuccccchhh

Strange that there isnt a tiny simple clock for education prgramming purpose, yet (sprintf), since Xfree86 and co. exists.

eg:
Code:
         XFillRectangle(d, w, DefaultGC(d, s), 20, 20, 10, 10);
         XDrawString(d, w, DefaultGC(d, s), 10, 50, msgtime , strlen(msgtime));
         usleep( 20e-6 );
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: RSS Guard 3.0.0 adds Tiny Tiny RSS support LXer Syndicated Linux News 0 12-17-2015 09:01 AM
[SOLVED] [PHP][Tiny Tiny RSS] Run a php updater daemon Nh3xus Slackware 3 10-27-2015 09:29 AM
LXer: Tiny Tiny RSS - Best google reader alternative LXer Syndicated Linux News 0 09-02-2012 01:43 AM
LXer: Tiny Core- A 10 MB Tiny Linux Desktop LXer Syndicated Linux News 0 02-28-2010 07:00 PM
LXer: Tiny PC, relatively tiny price (but the exchange rate's killing us) LXer Syndicated Linux News 0 01-29-2008 02:11 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:46 PM.

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