dockapps-7d1ef92/000077500000000000000000000000001256672576700137705ustar00rootroot00000000000000dockapps-7d1ef92/BUGS000066400000000000000000000007461256672576700144620ustar00rootroot00000000000000Known 'features and easter eggs' in WMTime, (or in non M$ talk, BUGS). WMTime 1.0b2 -------------------------------------------------------------- * Pixmap is not properly updated when starting WMTime with the -digital parameter and being 'cycled' to analog mode (not really a bug, but a beta easteregg, this will be removed in the final 1.0 version) :) WMTime 1.0b1 -------------------------------------------------------------- * None 'known' bugs in WMTime so far ;-) dockapps-7d1ef92/CHANGES000066400000000000000000000041011256672576700147570ustar00rootroot00000000000000WMTime changes. Version Description -------------------------------------------------------------- 1.4 - Released 150824 - The dockapp wmtime uses the new version of libdockapp and do not use libwmgeneral. - Add note about libdockapp to INSTALL. 1.3 - Released 150525 - Update to latest version of wmgeneral library. - Fix typos. Ran `codespell -w`. - Tidy #includes based on results of include-what-you-use. - Add -c command line option allowing users to set color. - Fix overflow warning; mask bitmap should be unsigned. - Use #defines to avoid variable length arrays. - Replace C++ style comments. - Fix "ordered comparison of pointer with integer zero" warning. Also take the opportunity to add an error message when iconv_open fails. - Update TODO. In particular, + Remove note about version 1.0 (was never released). + Remove note about LED colors (implemented). + Remove note about language files (unnecessary with locale support). + Update email address. - Add proper copyright header. - Update README. In particular, + Fix typo. + Mention newer command line options. + Drop 17-year-old architecture information. - Update HINTS. In particular, + Add newer command line options. + Update Window Maker instructions. 1.2 - Released 150103 - Remove unused variables. - Use rm -f in make clean. - Update FSF address. - Update GPLv2 from http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. - Update README contact information; remove trailing whitespaces. - Remove trailing whitespace. - Remove unnecessary Imakefile. - Move source files to top directory. - Update Makefile. - Add -l option to specify locale. - Remove unnecessary references to current version number. 1.1 - Released 131013 - Incorporated many patches from Debian, including + Added manual page + Added -geometry and -noseconds options + Improved locale support 1.0b2 - Released 980519 - Locale support has been added. 1.0b1 - Released 980513 - No changes yet, first initial public release. dockapps-7d1ef92/COPYING000066400000000000000000000432541256672576700150330ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. dockapps-7d1ef92/HINTS000066400000000000000000000032171256672576700146030ustar00rootroot00000000000000Hints for WMTime Generic -------------------------------------------------------------- WMTime supports 8 commandline options: -h (help); -v (prints version); -display (display); -d, -digital (digital clock); -geometry (set geometry); -n, -noseconds (disable the second hand); -l (set locale); -c (set color) WMTime can lauch 3 user definable commands for left, middle and right mouse button clicks, which you can define in ~/.wmtimerc, left: mycommand-1 & middle: mycommand-2 & right: mycommand-3 & If wmtime detects a ~/.wmtimerc file, it will launch your defined command(s) when you click in the clock display area. WMtime can realtime 'morph' it's UI from analog <> digital, simply left click in either the DAY or DATE gadget ;-) Be sure to drag WMTime on it's outer edges, WMTime is a bit picky due to the large gfx pixmap it keeps ;-) WindowMaker -------------------------------------------------------------- WindowMaker users simply drag and drop the WMTime dock.app on the WindowMaker Dock (preferred) or on the Clip, click 'Settings...' from the rightmouse button Dock popupmenu, and select 'Start when Window Maker is started'. Afterstep -------------------------------------------------------------- Afterstep users put the following in their .steprc "Wharf wmtime - MaxSwallow "wmtime" wmtime &". Note: AfterStep's Wharf has a problem with pixmaps that are larger than 60x60 pixels. Please tell the AfterStep authors to fix this, this is not our fault, but a Wharf problem! Other WindowManagers -------------------------------------------------------------- For other windowmanagers, WMTime runs nicely as a 64x64 shaped icon on your desktop. dockapps-7d1ef92/INSTALL000066400000000000000000000013121256672576700150160ustar00rootroot00000000000000Installation instructions for WMTime. Requirements -------------------------------------------------------------- Make sure libdockapp (at least version 0.7.0) is installed. It may be obtained at http://windowmaker.org/dockapps/?name=libdockapp Installation -------------------------------------------------------------- 1) % make 2) % make install (as root) 3)* WMTime uses month and weekday abbreviations from the currently set locale. If these abbreviations do not use Latin alphabet characters, then WMTime defaults to US/English. You may change this behavior by using the '-l' command line option, e.g., % wmtime -l es_MX.utf8 Be sure to read the HINTS and TODO files too! dockapps-7d1ef92/Makefile000077500000000000000000000011121256672576700154260ustar00rootroot00000000000000LIBS = -lXpm -lXext -lX11 -lm -ldockapp OBJS = wmtime.o XPMS = wmtime-master.xpm wmtime-mask.xbm PREFIX = /usr/local BINDIR = $(PREFIX)/bin MANDIR = $(PREFIX)/share/man/man1 INSTALL = install CC = gcc CFLAGS = -O2 -Wall .c.o: $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $*.o wmtime: $(OBJS) $(XPMS) $(CC) $(LDFLAGS) -o wmtime $(OBJS) $(LIBS) clean:: for i in $(OBJS) ; do \ rm -f $$i; \ done rm -f wmtime install:: wmtime $(INSTALL) -d $(DESTDIR)$(BINDIR) $(INSTALL) wmtime $(DESTDIR)$(BINDIR) $(INSTALL) -d $(DESTDIR)$(MANDIR) $(INSTALL) -m 644 wmtime.1 $(DESTDIR)$(MANDIR) dockapps-7d1ef92/README000066400000000000000000000041461256672576700146550ustar00rootroot00000000000000WMTime -------------------------------------------------------------- Authors...: Martijn Pieterse (pieterse@xs4all.nl) Antoine Nulle (warp@xs4all.nl) Maintainer: Window Maker Developers Team (wmaker-dev@lists.windowmaker.org) Note......: The official WMTime support website address: http://windowmaker.org/dockapps/?name=wmtime Credits...: Bobby Mezaway (bobby@mezaway.org) for generously hosting the original website Pascal G.Hofstee (daeron@Wit401305.student.utwente.nl) for supplying an Imakefile for *BSD systems Alen Salamun (snowman@hal9000.medinet.si) for supplying the Locale support patches! Description -------------------------------------------------------------- WMTime, guess what, displays the time and date and gives you some nice additional features too... WMTime currently provides: * Time and date; * Realtime morphing UI (analog <> digital mode); * Autoscaling and anti aliased hands; * Locale, can display DAY and DATE in various languages; * Can launch 3 user definable commands through ~/.wmtimerc; * Can be run multiple times; * Commandline options for help (-h), version (-v), digital clock mode (-d, -digital), display (-display), geometry (-geometry), disabling the second hand (-n, -noseconds), setting the locale (-l), and setting the color (-c). Files -------------------------------------------------------------- README This file. INSTALL Installation instructions. HINTS Useful hints and tips about WMTime. BUGS Things you don't want to know ;-) CHANGES Description of changes. TODO Stuff we've planned for future WMTime releases. COPYING GNU General Public License Version 2. Bugs -------------------------------------------------------------- If you discover any bugs in this software, please submit a bugreport to wmaker-dev@lists.windowmaker.org Copyright -------------------------------------------------------------- WMTime.app is copyright (c) 1997, 1998 by Martijn Pieterse and Antoine Nulle and licensed through the GNU General Public License. Read the COPYING file for the complete GNU license. dockapps-7d1ef92/TODO000066400000000000000000000011661256672576700144640ustar00rootroot00000000000000TODO list for WMTime. -------------------------------------------------------------- * Optional LCD GUI, either compiletime or runtime; * Alarmclock function with sound support, note that the 'empty space' in -digital is reserved for the alarm settings buttons, gadgets etc.; * Dualmode time display (analog mode with transparent digital clock that shines through); * Simple crontab job launcher/setter?; Your feedback! If you have nice suggestions, ideas, whatever, that aren't on this list, feel free to mail them to: wmaker-dev@lists.windowmaker.org If you don't let us know... how are we suppose to know? ;-) dockapps-7d1ef92/wmtime-mask.xbm000066400000000000000000000144201256672576700167340ustar00rootroot00000000000000#define wmtime_mask_width 128 #define wmtime_mask_height 64 static unsigned char wmtime_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; dockapps-7d1ef92/wmtime-master.xpm000066400000000000000000000653651256672576700173300ustar00rootroot00000000000000/* XPM */ static char * wmtime_master_xpm[] = { "160 164 20 1", " c #00000000FFFF", ". c #208120812081", "X c #000000000000", "o c #C71BC71BC71B", "O c #2081B2CAAEBA", "+ c #000049244103", "@ c #00007DF771C6", "# c #18618A288617", "$ c #96589A699658", "% c #79E77DF779E7", "& c #69A66DB669A6", "* c #514459655144", "= c #41034D344103", "- c #30C23CF330C2", "; c #18619A699658", ": c #0820861779E7", "> c #000071C66185", ", c #000061855144", "< c #00004D344103", "1 c #10407DF779E7", " ................................", " ................................", " ................................", " ................................", " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................", " X......................................................o X......................................................o ................................", " X.........................OOO..........................o X......................................................o ................................", " X.........................OOO+.........................o X......................................................o ................................", " X..............@@.........OOO+........@@...............o X......................................................o ................................", " X..............@@+.........+++........@@+..............o X......................................................o ................................", " X...............++.....................++..............o X......................................................o ................................", " X......................................................o X......................................................o ................................", " X......................................................o X......................................................o ................................", " X......................................................o X......................................................o ................................", " X......@@......................................@@......o X......................................................o ................................", " X......@@+.....................................@@+.....o X......................................................o ................................", " X.......++......................................++.....o X......................................................o ................................", " X......................................................o X......................................................o ................................", " X......................................................o X......................................................o ................................", " X......................................................o X......................................................o ................................", " X......................................................o X...++++...++++.......++++...++++.......++++...++++....o ................................", " X......................................................o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................", " X......................................................o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................", " X..OOO...........................................OOO...o X..+....+.+....+.....+....+.+....+.....+....+.+....+...o ................................", " X..OOO+..........................................OOO+..o X...++++...++++.......++++...++++.......++++...++++....o ................................", " X..OOO+..........................................OOO+..o X..+....+.+....+.....+....+.+....+.....+....+.+....+...o ................................", " X...+++...........................................+++..o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................", " X......................................................o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................", " X......................................................o X...++++...++++.......++++...++++.......++++...++++....o ................................", " X......................................................o X......................................................o ................................", " X......................................................o X......................................................o ................................", " X......................................................o X......................................................o ................................", " X......................................................o X......................................................o ................................", " X......@@......................................@@......o X......................................................o ................................", " X......@@+.....................................@@+.....o X......................................................o ................................", " X.......++......................................++.....o X......................................................o ................................", " X......................................................o X......................................................o ................................", " X......................................................o X......................................................o ................................", " X......................................................o X......................................................o ................................", " X..............@@.....................@@...............o X......................................................o ................................", " X..............@@+........OOO.........@@+..............o X......................................................o ................................", " X...............++........OOO+.........++..............o X......................................................o ................................", " X.........................OOO+.........................o X......................................................o ................................", " X..........................+++.........................o X......................................................o ................................", " X......................................................o X......................................................o ................................", " oooooooooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooooooooooo ................................", " ................................", " ................................", " XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................", " X..............o X....................................o X..............o X....................................o ................................", " X..............o X....................................o X..............o X....................................o ................................", " X..............o X....................................o X..............o X....................................o ................................", " X..............o X....................................o X..............o X....................................o ................................", " X..............o X....................................o X..............o X....................................o ................................", " X..............o X....................................o X..............o X....................................o ................................", " X..............o X....................................o X..............o X....................................o ................................", " X..............o X....................................o X..............o X....................................o ................................", " X..............o X....................................o X..............o X....................................o ................................", " X..............o X....................................o X..............o X....................................o ................................", " oooooooooooooooo oooooooooooooooooooooooooooooooooooooo oooooooooooooooo oooooooooooooooooooooooooooooooooooooo ................................", " ................................", " ................................", " ................................", " ................................", "................................................................................................................................................................", "..OOO...+++#.#OOO#.#OOO#.#+++#.#OOO#.#OOO#.#OOO#.#OOO#.#OOO#....................................................................................................", ".O...O.+...O.+...O.+...O.O...O.O...+.O...+.+...O.O...O.O...O............O.....$$%%&&**==--......................................................................", ".O...O.+...O.+...O.+...O.O...O.O...+.O...+.+...O.O...O.O...O.......O....O.....$$%%&&**==--......................................................................", ".#+++#..+++#.#OOO#..OOO#.#OOO#.#OOO#.#OOO#..+++#.#OOO#.#OOO#..#O#..#...O........................................................................................", ".O...O.+...O.O...+.+...O.+...O.+...O.O...O.+...O.O...O.+...O...........O......OO;;::>>,,<<......................................................................", ".O...O.+...O.O...+.+...O.+...O.+...O.O...O.+...O.O...O.+...O.......O..O.......OO;;::>>,,<<......................................................................", "..OOO...+++#.#OOO#.#OOO#..+++#.#OOO#.#OOO#..+++#.#OOO#.#OOO#.......#..O.........................................................................................", "................................................................................................................................................................", " ", "................................................................................................................................................................", ".+OOO+.#OOO...OOO#.#OOO..#OOO#.#OOO#.#OOO#.#+++#..+++#..+++#.#+++#.#+++..O+++O.#OOO..#OOO#.#OOO#.#OOO#.#OOO#.#OOO#.#OOO#.#+++#.#+++#.#+++#.#+++#.#+++#.#OOO#....", ".O...O.O...O.O...+.O...O.O...+.O...+.O...+.O...O.+...O.+...O.O...O.O...+.OO.OO.O...O.O...O.O...O.O...O.O...O.O...+.+.O.+.O...O.O...O.O...O.O...O.O...O.+...O....", ".O...O.O...O.O...+.O...O.O...+.O...+.O...+.O...O.+...O.+...O.O...O.O...+.O.O.O.O...O.O...O.O...O.O...O.O...O.O...+.+.O.+.O...O.O...O.O...O..O.O..O...O.+..O+....", ".#OOO#.#OOO..#+++..#+++#.#OOO..#OOO..#+#O#.#OOO#..+++#..+++#.#OOO..#+++..#+++#.#+++#.#+++#.#OOO#.#O++#.#OOO..#OOO#..+#+..#+++#.#+++#.#+++#...O...#OOO#..+O+.....", ".O...O.O...O.O...+.O...O.O...+.O...+.O...O.O...O.+...O.+...O.O...O.O...+.O...O.O...O.O...O.O...+.O.O.O.O...O.+...O.+.O.+.O...O.O...O.O.O.O..O.O..+...O.+O..+....", ".O...O.O...O.O...+.O...O.O...+.O...+.O...O.O...O.+...O.+...O.O...O.O...+.O...O.O...O.O...O.O...+.O..OO.O...O.+...O.+.O.+.O...O.O...O.OO.OO.O...O.+...O.O...+....", ".#+++#.#OOO...OOO#.#OOO..#OOO#.#+++..#OOO#.#+++#..+++#.#OOO#.#+++#.#OOO#.#+++#.#+++#.#OOO#.#+++..#OOO#.#+++#.#OOO#..+#+..#OOOO..OOO..#+++#.#+++#.#OOO#.#OOO#....", "................................................................................................................................................................", " ", "............................................................................. ", "............................................................................. ", "...OOOO...++++1.1OOOO#.1OOOO1.1++++1.1OOOO1.1OOOO#.1OOOO1.1OOOO#.1OOOO#...... ", "..O....O.+....O.+....O.+....O.O....O.O....+.O....+.+....O.O....O.O....O..O... ", "..O....O.+....O.+....O.+....O.O....O.O....+.O....+.+....O.O....O.O....O..O... ", "..O....O.+....O.+....O.+....O.O....O.O....+.O....+.+....O.O....O.O....O...... ", "..1++++1..++++1.1OOOO1.1OOOO1.1OOOO1.1OOOO1.1OOOO1..++++1.1OOOO1.1OOOO1...... ", "..O....O.+....O.O....+.+....O.+....O.+....O.O....O.+....O.O....O.+....O...... ", "..O....O.+....O.O....+.+....O.+....O.+....O.O....O.+....O.O....O.+....O..O... ", "..O....O.+....O.O....+.+....O.+....O.+....O.O....O.+....O.O....O.+....O..O... ", "...OOOO...++++1.1OOOO1.1OOOO1..++++1.1OOOO1.1OOOO1..++++1.1OOOO1.1OOOO1...... ", "............................................................................. ", "............................................................................. ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}; dockapps-7d1ef92/wmtime.1000066400000000000000000000102671256672576700153620ustar00rootroot00000000000000'\" t .\" Man page for wmtime .\" Copyright (c) 2003 Software in the Public Interest, Inc. .\" .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or (at .\" your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, but .\" WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU .\" General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 .\" USA. .\" .TH WMTIME 1 "January 2015" "WMTIME" .SH NAME wmtime \- Window Maker dockapp that displays the time and date .SH SYNOPSIS .B wmtime [ .I OPTION ] .SH DESCRIPTION .B WMTime displays the time and date and gives you some nice additional features too. It is intended for docking in Window Maker. It currently provides: .IP \(bu 4 the time and date; .IP \(bu a realtime morphing interface (analog <> digital mode); .IP \(bu auto\-scaled and anti\-aliased hands; .IP \(bu localization, displaying the day and date in various languages; .IP \(bu three user\-defined commands to launch. .SH OPTIONS .TP .BR \-d , \ \-digital Display the digital clock on startup, instead of the analog clock. .TP .BI \-display \ display This option specifies the X server to contact; see .IR X(7x) . .TP .BI \-geometry \ geometry This option specifies the preferred position of clock; see .IR X(7x) . .TP .BR \-n , \ \-noseconds Disables the second hand. .TP .BI \-l \ locale Specify locale. .TP .B \-h Show help information. .TP .B \-v Print the version number. .TP .B \-c Set color. .SH USAGE The .B WMTime window is separated into top and bottom sections. The top section contains a clock and the bottom section contains the date. The clock can be toggled between analog and digital modes. To do this, click in the bottom section of the window. WMTime can also be used to launch programs. You may click either left, middle, or right mouse buttons in the top section of the window. The pre\-configured program will be launched according to the mouse button clicked. (see .B CONFIGURATION FILE below.) In order to move .BR WMTime , drag on the outer edges. These are not sensitive to mouse clicks. .SH "DOCKING IN WINDOW MANAGERS" .TP Window Maker Window Maker users should drag and drop the .B WMTime window on the Dock. Then, right\-click on the border of the window and select \*(lqSettings...\*(rq. Check \*(lqStart when Window Maker is started\*(rq. .TP AfterStep AfterStep users should put the following in their .I $HOME/.steprc .RS 16 Wharf wmtime \- MaxSwallow "wmtime" wmtime & .RE .TP Other window managers .B WMTime runs nicely as a 64x64 shaped icon on your desktop. .SH "CONFIGURATION FILE" .B WMTime can launch three user\-defined commands, triggered by left, middle and right mouse button clicks. You can define the commands to launch in .I $HOME/.wmtimerc .RS .PD 0 left: xterm .PP middle: xload .PP right: xcalc .PP .PD .RE If .B WMTime detects a .I $HOME/.wmtimerc file, it will launch the appropriate command when you click on the clock. The system administrator can define default commands in .IR /etc/wmtimerc . The administrator may also choose to \*(lqfix\*(rq particular commands, making it impossible for users to change. These commands can be defined in .IR /etc/wmtimerc.fixed , although this isn't a nice thing to do. .SH FILES .I /etc/wmtimerc .br .I $HOME/.wmtimerc .br .I /etc/wmtimerc.fixed .SH AUTHORS .B WMTime was written by Martijn Pieterse and Antoine Nulle. This manual page was written by Simon Law for the .B Debian system (but may be used by others). It is based on the documentation provided by the original program. This manual is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. dockapps-7d1ef92/wmtime.c000066400000000000000000000474641256672576700154550ustar00rootroot00000000000000/* wmtime - Window Maker dockapp that displays the time and date Copyright (C) 1997, 1998 Martijn Pieterse Copyright (C) 1997, 1998 Antoine Nulle This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Code based on wmppp/wmifs [Orig WMMON comments] This code was mainly put together by looking at the following programs: asclock A neat piece of equip, used to display the date and time on the screen. Comes with every AfterStep installation. Source used: How do I create a not so solid window? How do I open a window? How do I use pixmaps? ------------------------------------------------------------ Author: Martijn Pieterse (pieterse@xs4all.nl) This program is distributed under the GPL license. (as were asclock and pppstats) ---- Changes: ---- 15/07/2008 (Paul Harris, harris.pc@gmail.com) * Minor changes to correct build warnings 09/10/2003 (Simon Law, sfllaw@debian.org) * Add -geometry support * Add -noseconds support * Make the digital clock fill the space provided * Eliminated exploitable static buffers 17/05/1998 (Antoine Nulle, warp@xs4all.nl) * Updated version number and some other minor stuff 16/05/1998 (Antoine Nulle, warp@xs4all.nl) * Added Locale support, based on original diff supplied by Alen Salamun (snowman@hal9000.medinet.si) 04/05/1998 (Martijn Pieterse, pieterse@xs4all.nl) * Moved the hands one pixel down. * Removed the RedrawWindow out of the main loop 02/05/1998 (Martijn Pieterse, pieterse@xs4all.nl) * Removed a lot of code that was in the wmgeneral dir. 02/05/1998 (Antoine Nulle, warp@xs4all.nl) * Updated master-xpm, hour dots where a bit 'off' 30/04/1998 (Martijn Pieterse, pieterse@xs4all.nl) * Added anti-aliased hands 23/04/1998 (Martijn Pieterse, pieterse@xs4all.nl) * Changed the hand lengths.. again! ;) * Zombies were created, so added wait code 21/04/1998 (Martijn Pieterse, pieterse@xs4all.nl) * Added digital/analog switching support 18/04/1998 (Martijn Pieterse, pieterse@xs4all.nl) * Started this project. * Copied the source from wmmon. */ #define _GNU_SOURCE #include /* for ButtonPress, ButtonRelease, etc */ #include /* for XEvent, XButtonEvent, etc */ #include #include /* for toupper */ #include /* for iconv, iconv_close, etc */ #include /* for nl_langinfo, ABDAY_1, etc */ #include /* for NULL, setlocale, LC_ALL */ #include /* for floor, cos, sin, M_PI */ #include /* for size_t */ #include /* for printf, asprintf, snprintf, etc */ #include /* for abs, free, exit, getenv */ #include /* for strcmp, strdup, strncpy, etc */ #include /* for waitpid, WNOHANG */ #include /* for tm, time, localtime */ #include /* for usleep */ #include "libdockapp/misc.h" /* for execCommand */ #include "libdockapp/wmgeneral.h" /* for copyXPMArea, RedrawWindow, etc */ #include "wmtime-mask.xbm" /* for wmtime_mask_bits */ #include "wmtime-master.xpm" /* for wmtime_master_xpm */ /***********/ /* Defines */ /***********/ const char* default_left_action = NULL; const char* default_middle_action = NULL; const char* default_right_action = NULL; #define WMTIME_VERSION "1.4" /********************/ /* Global Variables */ /********************/ int digital = 0; int noseconds = 0; char day_of_week[7][3] = { "SU", "MO", "TU", "WE", "TH", "FR", "SA" }; char mon_of_year[12][4] = { "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" }; XpmIcon wmgen; char color[256]; /* functions */ void usage(char *); void printversion(void); void wmtime_routine(int, char **); void get_lang(); int main(int argc, char *argv[]) { int i; char *name = argv[0]; char locale[256]; locale[0] = 0; color[0] = 0; for (i=1; i i+1) { strcpy(color, argv[i+1]); i++; } break; case 'd' : if (strcmp(arg+1, "display") && strcmp(arg+1, "digital") && strcmp(arg+1, "d")) { usage(name); return 1; } if (!strcmp(arg+1, "digital") || !(strcmp(arg+1, "d"))) digital = 1; break; case 'g' : if (strcmp(arg+1, "geometry")) { usage(name); return 1; } break; case 'n' : if (strcmp(arg+1, "noseconds") && strcmp(arg+1, "n")) { usage(name); return 1; } else { noseconds = 1; } break; case 'v' : printversion(); return 0; case 'l': if (argc > i+1) { strcpy(locale, argv[i+1]); i++; } break; default: usage(name); return 1; } } } if (setlocale(LC_ALL, locale) == NULL) fprintf(stderr, "warning: locale '%s' not recognized; defaulting to '%s'.", locale, setlocale(LC_ALL, NULL)); get_lang(); wmtime_routine(argc, argv); return 0; } /************/ /* get_lang */ /************/ void get_lang(void) { char langbuf[10], outbuf[10]; char *inp, *outp; iconv_t icd; int i, ret; size_t insize, outsize; icd = iconv_open("ASCII//TRANSLIT", nl_langinfo(CODESET)); if (icd == (iconv_t) -1) { perror("wmtime: Error allocating charset conversion descriptor"); return; } for (i = 0; i < 7; i++) { strncpy(langbuf, nl_langinfo(ABDAY_1 + i), 10); insize = outsize = 10; inp = langbuf; outp = outbuf; do { ret = iconv(icd, &inp, &insize, &outp, &outsize); } while (outsize > 0 && ret > 0); if (strstr(outbuf,"?") != NULL) return; for (outp = outbuf, outsize = 0; *outp != 0 && outsize < 2; outp++, outsize++) day_of_week[i][outsize] = toupper(*outp); } for (i = 0; i < 12; i++) { strncpy(langbuf, nl_langinfo(ABMON_1 + i), 10); insize = outsize = 10; inp = langbuf; outp = outbuf; do { ret = iconv(icd, &inp, &insize, &outp, &outsize); } while (outsize > 0 && ret > 0); if (strstr(outbuf,"?") != NULL) return; for (outp = outbuf, outsize = 0; *outp != 0 && outsize < 3; outp++, outsize++) mon_of_year[i][outsize] = toupper(*outp); } iconv_close(icd); } Pixel scale_pixel(Pixel pixel, float scale) { int red, green, blue; red = pixel / ( 1 << 16 ); green = pixel % (1 << 16) / (1 << 8); blue = pixel % (1 << 8); red *= scale; green *= scale; blue *= scale; return red * (1 << 16) + green * (1 << 8) + blue; } /*******************************************************************************\ |* wmtime_routine *| \*******************************************************************************/ char *left_action = NULL; char *right_action = NULL; char *middle_action = NULL; void DrawTime(int, int, int); void DrawWijzer(int, int, int); void DrawDate(int, int, int); void wmtime_routine(int argc, char **argv) { rckeys wmtime_keys[] = { { "left", &left_action }, { "right", &right_action }, { "middle", &middle_action }, { NULL, NULL } }; int i; XEvent Event; int but_stat = -1; struct tm *time_struct; long starttime; long curtime; char *conffile = NULL; /* Scan through ~/.wmtimerc for the mouse button actions. */ if (default_left_action) left_action = strdup(default_left_action); if (default_middle_action) middle_action = strdup(default_middle_action); if (default_right_action) right_action = strdup(default_right_action); /* Scan through the .rc files */ if (asprintf(&conffile, "/etc/wmtimerc") >= 0) { parse_rcfile(conffile, wmtime_keys); free(conffile); } if (asprintf(&conffile, "%s/.wmtimerc", getenv("HOME")) >= 0) { parse_rcfile(conffile, wmtime_keys); free(conffile); } if (asprintf(&conffile, "/etc/wmtimerc.fixed") >= 0) { parse_rcfile(conffile, wmtime_keys); free(conffile); } /* set user-defined colors */ if (color[0] != 0) { Window Root; XColor col; XWindowAttributes attributes; int screen; Pixel pixel; #define NUMSYMBOLS 10 XpmColorSymbol user_color[NUMSYMBOLS] = { {NULL, "#2081B2CAAEBA", 0}, /* O */ {NULL, "#000049244103", 0}, /* + */ {NULL, "#00007DF771C6", 0}, /* @ */ {NULL, "#18618A288617", 0}, /* # */ {NULL, "#18619A699658", 0}, /* ; */ {NULL, "#0820861779E7", 0}, /* : */ {NULL, "#000071C66185", 0}, /* > */ {NULL, "#000061855144", 0}, /* , */ {NULL, "#00004D344103", 0}, /* < */ {NULL, "#10407DF779E7", 0} /* 1 */ }; /* code based on GetColor() from wmgeneral.c */ /* we need a temporary display to parse the color */ display = XOpenDisplay(NULL); screen = DefaultScreen(display); Root = RootWindow(display, screen); XGetWindowAttributes(display, Root, &attributes); col.pixel = 0; if (!XParseColor(display, attributes.colormap, color, &col)) { fprintf(stderr, "wmtime: can't parse %s.\n", color); goto draw_window; } else if (!XAllocColor(display, attributes.colormap, &col)) { fprintf(stderr, "wmtime: can't allocate %s.\n", color); goto draw_window; } pixel = col.pixel; /* replace colors from wmtime-master.xpm */ user_color[0].pixel = pixel; user_color[1].pixel = scale_pixel(pixel, .4); user_color[2].pixel = scale_pixel(pixel, .7); user_color[3].pixel = scale_pixel(pixel, .8); user_color[4].pixel = scale_pixel(pixel, .9); user_color[5].pixel = scale_pixel(pixel, .8); user_color[6].pixel = scale_pixel(pixel, .6); user_color[7].pixel = scale_pixel(pixel, .5); user_color[8].pixel = scale_pixel(pixel, .4); user_color[9].pixel = scale_pixel(pixel, .7); wmgen.attributes.valuemask |= XpmColorSymbols; wmgen.attributes.numsymbols = NUMSYMBOLS; wmgen.attributes.colorsymbols = user_color; XCloseDisplay(display); } draw_window: openXwindow(argc, argv, wmtime_master_xpm, (char*)wmtime_mask_bits, 128, 64); /* Mask out the right parts of the clock */ copyXPMArea(0, 0, 128, 64, 0, 98); /* Draw the borders */ copyXPMArea(0, 0, 64, 64, 64, 0); /* Draw the clock face */ copyXPMArea(64, 98, 64, 64, 0, 0); /* Draw the LCD background */ setMaskXY(0, 0); /* add mouse region */ AddMouseRegion(0, 5, 48, 58, 60); AddMouseRegion(1, 5, 5, 58, 46); starttime = time(0); curtime = time(0); time_struct = localtime(&curtime); while (1) { curtime = time(0); waitpid(0, NULL, WNOHANG); time_struct = localtime(&curtime); if (curtime >= starttime) { if (!digital) { /* Now to update the seconds */ DrawWijzer(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec); DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon); } else { DrawTime(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec); DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon); } RedrawWindow(); } while (XPending(display)) { XNextEvent(display, &Event); switch (Event.type) { case Expose: RedrawWindow(); break; case DestroyNotify: XCloseDisplay(display); exit(0); break; case ButtonPress: but_stat = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y); break; case ButtonRelease: i = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y); if (but_stat == i && but_stat >= 0) { switch (but_stat) { case 0: digital = 1-digital; if (digital) { copyXPMArea(64, 98, 64, 64, 0, 0); DrawTime(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec); DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon); } else { copyXPMArea(0, 98, 64, 64, 0, 0); DrawWijzer(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec); DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon); } RedrawWindow(); break; case 1: switch (Event.xbutton.button) { case 1: if (left_action) execCommand(left_action); break; case 2: if (middle_action) execCommand(middle_action); break; case 3: if (right_action) execCommand(right_action); break; } } } break; } } /* Sleep 0.3 seconds */ usleep(300000L); } } /*******************************************************************************\ |* DrawTime *| \*******************************************************************************/ void DrawTime(int hr, int min, int sec) { #define TIME_SIZE 16 char time[TIME_SIZE]; char *p = time; int i,j,k=6; int numfields; /* 7x13 */ if (noseconds) { snprintf(time, TIME_SIZE, "%02d:%02d ", hr, min); numfields = 2; } else { snprintf(time, TIME_SIZE, "%02d:%02d:%02d ", hr, min, sec); numfields = 3; } for (i=0; i < numfields; i++) { for (j=0; j<2; j++) { copyXPMArea((*p-'0')*7 + 1, 84, 8, 13, k, 18); k += 7; p++; } if (*p == ':') { copyXPMArea(71, 84, 5, 13, k, 18); k += 4; p++; } } } /*******************************************************************************\ |* DrawDate *| \*******************************************************************************/ void DrawDate(int wkday, int dom, int month) { #define DATE_SIZE 16 char date[DATE_SIZE]; char *p = date; int i,k; /* 7x13 */ snprintf(date, DATE_SIZE, "%.2s%02d%.3s ", day_of_week[wkday], dom, mon_of_year[month]); k = 5; for (i=0; i<2; i++) { if (*p < 'A') copyXPMArea((*p-'0')*6, 64, 6, 9, k, 49); else copyXPMArea((*p-'A')*6, 74, 6, 9, k, 49); k += 6; p++; } k = 23; for (i=0; i<2; i++) { copyXPMArea((*p-'0')*6, 64, 6, 9, k, 49); k += 6; p++; } copyXPMArea(61, 64, 4, 9, k, 49); k += 4; for (i=0; i<3; i++) { if (*p < 'A') copyXPMArea((*p-'0')*6, 64, 6, 9, k, 49); else copyXPMArea((*p-'A')*6, 74, 6, 9, k, 49); k += 6; p++; } } /*******************************************************************************\ |* DrawWijzer *| \*******************************************************************************/ void DrawWijzer(int hr, int min, int sec) { double psi; int dx,dy; int x,y; int ddx,ddy; int adder; int k; int i; hr %= 12; copyXPMArea(5+64, 5, 54, 40, 5, 5); /**********************************************************************/ psi = hr * (M_PI / 6.0); psi += min * (M_PI / 360); dx = floor(sin(psi) * 22 * 0.7 + 0.5); dy = floor(-cos(psi) * 16 * 0.7 + 0.5); /* dx, dy is het punt waar we naar toe moeten. * Zoek alle punten die ECHT op de lijn liggen: */ ddx = 1; ddy = 1; if (dx < 0) ddx = -1; if (dy < 0) ddy = -1; x = 0; y = 0; if (abs(dx) > abs(dy)) { if (dy != 0) adder = abs(dx) / 2; else adder = 0; for (i=0; i abs(dy)) { if (dy != 0) adder = abs(dx) / 2; else adder = 0; for (i=0; i abs(dy)) { if (dy != 0) adder = abs(dx) / 2; else adder = 0; for (i=0; i