2 * wmmisc - WindowMaker Dockapp for monitoring misc. information.
3 * Copyright (C) 2003-2006 Jesse S. (luxorfalls@sbcglobal.net)
5 * wmmisc is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * wmmisc is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with wmmisc; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #include <bits/getopt_core.h>
29 #endif /* USE_MTRACE */
31 #include <libdockapp/wmgeneral.h>
33 #include "wmmisc-master.xpm"
34 #include "dockapp_main.h"
35 #include "dockapp_draw.h"
38 dockapp_show_help( const char* wm_name
)
40 printf( "Usage: %s [OPTION]...\n", wm_name
);
41 printf( "This is a simple WindowMaker 'DockApp' that will monitor the following:\n" );
42 printf( "Number of users logged in, total processes, total number of processes running,\n" );
43 printf( "the system's fork count and load average.\n\n" );
44 printf( " -h display this help and exit\n" );
45 printf( " -v output version information and exit\n\n" );
46 printf( "Report bugs to <" PACKAGE_BUGREPORT
">.\n" );
50 dockapp_show_version( void )
52 printf( "%s\n", PACKAGE_STRING
);
53 printf( "Written by %s <%s>\n\n", DOCKAPP_AUTHOR
, DOCKAPP_AUTHOR_EMAIL
);
54 printf( "Copyright (C) 2003-2006 %s\n", DOCKAPP_AUTHOR
);
55 printf( "This is free software; see the source for copying conditions. There is NO\n" );
56 printf( "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" );
60 dockapp_exit( int signal_received
)
64 #endif /* USE_MTRACE */
68 "%s: Exiting cleanly with signal %d\n",
77 dockapp_crash( int signal_received
)
80 "%s: got signal %d -- bailing out!\n",
84 "It appears that %s has encountered an error.\n",
87 "If this continues to happen, please run '%s core' from a debugger,\n",
90 "such as gdb, and report the output to <%s>.\n",
97 main( int argc
, char** argv
)
103 #endif /* USE_MTRACE */
105 signal( SIGINT
, dockapp_exit
);
106 signal( SIGSEGV
, dockapp_crash
);
108 opt
= getopt( argc
, argv
, "hv" );
116 dockapp_show_help( argv
[0] );
123 dockapp_show_version();
129 opt
= getopt( argc
, argv
, "hv" );
132 createXBMfromXPM( wmmisc_mask_bits
,
135 wmmisc_mask_height
);
142 wmmisc_mask_height
);
146 dockapp_draw_small_str( "USERS", 4, 4 );
147 dockapp_draw_small_str( "PROCS", 4, 11 );
148 dockapp_draw_small_str( "ACTIVE", 4, 18 );
150 dockapp_draw_small_str( "UP", 4, 28 );
151 dockapp_draw_small_str( "DAYS", 4, 37 );
152 dockapp_draw_small_str( "WEEKS", 4, 44 );
154 dockapp_draw_small_str( "LOAD", 4, 53 );