Remove trailing whitespace.

This commit is contained in:
Doug Torrance 2014-10-05 10:29:59 -05:00 committed by Carlos R. Mafra
parent b141e5af28
commit 612921ae43
339 changed files with 2980 additions and 2982 deletions

View file

@ -34,7 +34,7 @@ void AChannel::setVolume(long value) {
bool AChannel::isMuted() { bool AChannel::isMuted() {
int val; int val;
snd_mixer_selem_get_playback_switch(aItem->aElem, (SNDCHID_T) id, &val); snd_mixer_selem_get_playback_switch(aItem->aElem, (SNDCHID_T) id, &val);
return (! (bool) val); return (! (bool) val);

View file

@ -16,7 +16,7 @@ class AMixer;
class AItem { class AItem {
private: private:
AMixer *mixer; // parent mixer AMixer *mixer; // parent mixer
std::vector<AChannel *> pbChannels; // item channels std::vector<AChannel *> pbChannels; // item channels
long minPVolume, maxPVolume; // min/max playback volume long minPVolume, maxPVolume; // min/max playback volume
bool hPVolume; // has Playback volume bool hPVolume; // has Playback volume

View file

@ -115,7 +115,7 @@ bool AMixer::itemOK(unsigned int itemNumber) {
int AMixer::itemGetVolume(unsigned int itemNumber) { int AMixer::itemGetVolume(unsigned int itemNumber) {
if (itemNumber >= MIXER_ITEMS || !mixerItems[itemNumber]) if (itemNumber >= MIXER_ITEMS || !mixerItems[itemNumber])
return (-1); return (-1);
return ((int) mixerItems[itemNumber]->getVolumePerc()); return ((int) mixerItems[itemNumber]->getVolumePerc());
} }
@ -129,7 +129,7 @@ void AMixer::itemSetVolume(unsigned int itemNumber, unsigned int volume) {
int AMixer::itemIsMuted(unsigned int itemNumber) { int AMixer::itemIsMuted(unsigned int itemNumber) {
if (itemNumber >= MIXER_ITEMS || !mixerItems[itemNumber]) if (itemNumber >= MIXER_ITEMS || !mixerItems[itemNumber])
return (-1); return (-1);
return ((bool) mixerItems[itemNumber]->isMuted()); return ((bool) mixerItems[itemNumber]->isMuted());
} }
@ -193,7 +193,7 @@ int itemCallback(snd_mixer_elem_t *elem, unsigned int mask) {
char* AMixer::convertIDToCard(const char* cardId) { char* AMixer::convertIDToCard(const char* cardId) {
static char card[32] = ""; static char card[32] = "";
int i = snd_card_get_index(cardId); int i = snd_card_get_index(cardId);
if (i >= 0 && i < 32) if (i >= 0 && i < 32)
std::snprintf(card, 32, "hw:%i", i); std::snprintf(card, 32, "hw:%i", i);
else else

View file

@ -1,8 +1,8 @@
// //
// Mixer.app // Mixer.app
// //
// Copyright (c) 1998-2002 Per Liden // Copyright (c) 1998-2002 Per Liden
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or // the Free Software Foundation; either version 2 of the License, or
@ -15,7 +15,7 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
// USA. // USA.
// //
@ -23,7 +23,7 @@
Mixer* app; Mixer* app;
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
app = new Mixer(argc, argv); app = new Mixer(argc, argv);
app->run(); app->run();

View file

@ -1,8 +1,8 @@
// //
// Mixer.app // Mixer.app
// //
// Copyright (c) 1998-2002 Per Liden // Copyright (c) 1998-2002 Per Liden
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or // the Free Software Foundation; either version 2 of the License, or
@ -15,7 +15,7 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
// USA. // USA.
// //
@ -44,7 +44,7 @@ static const char* MixerSources[] = { "Master", "PCM", "CD" };
extern Mixer* app; extern Mixer* app;
void catchBrokenPipe(int sig) void catchBrokenPipe(int sig)
{ {
app->saveVolumeSettings(); app->saveVolumeSettings();
exit(0); exit(0);
@ -58,7 +58,7 @@ int percentToPosition(int percent) {
return ROUND_POS(BUTTON_MIN - (percent * (BUTTON_MIN - BUTTON_MAX)) / 100.0); return ROUND_POS(BUTTON_MIN - (percent * (BUTTON_MIN - BUTTON_MAX)) / 100.0);
} }
Mixer::Mixer(int argc, char** argv) Mixer::Mixer(int argc, char** argv)
{ {
XClassHint classHint; XClassHint classHint;
XSizeHints sizeHints; XSizeHints sizeHints;
@ -221,7 +221,7 @@ Mixer::Mixer(int argc, char** argv)
cerr << APPNAME << ": could not open display " << displayName << endl; cerr << APPNAME << ": could not open display " << displayName << endl;
exit(0); exit(0);
} }
// Get root window // Get root window
mRoot = RootWindow(mDisplay, DefaultScreen(mDisplay)); mRoot = RootWindow(mDisplay, DefaultScreen(mDisplay));
@ -311,7 +311,7 @@ void Mixer::tryHelp(char* appname)
cerr << "Try `" << appname << " --help' for more information" << endl; cerr << "Try `" << appname << " --help' for more information" << endl;
} }
void Mixer::showHelp() void Mixer::showHelp()
{ {
cerr << APPNAME << " Copyright (c) 1998-2002 by Per Liden (per@fukt.bth.se), Petr Hlavka (xhlavk00@stud.fit.vutbr.cz)" << endl << endl cerr << APPNAME << " Copyright (c) 1998-2002 by Per Liden (per@fukt.bth.se), Petr Hlavka (xhlavk00@stud.fit.vutbr.cz)" << endl << endl
<< "options:" << endl << "options:" << endl
@ -341,7 +341,7 @@ void Mixer::checkArgument(char** argv, int argc, int index)
} }
} }
void Mixer::showErrorLed() void Mixer::showErrorLed()
{ {
Window led; Window led;
Xpm* image; Xpm* image;
@ -395,7 +395,7 @@ void Mixer::saveVolumeSettings()
ofstream file(mSettingsFile); ofstream file(mSettingsFile);
if (file) { if (file) {
// Files in ~/GNUstep/Defaults/ should follow the property list format // Files in ~/GNUstep/Defaults/ should follow the property list format
file << "{" << endl file << "{" << endl
<< " Volume1 = " << mVolumePos[0] << ";" << endl << " Volume1 = " << mVolumePos[0] << ";" << endl
<< " Volume2 = " << mVolumePos[1] << ";" << endl << " Volume2 = " << mVolumePos[1] << ";" << endl
<< " Volume3 = " << mVolumePos[2] << ";" << endl << " Volume3 = " << mVolumePos[2] << ";" << endl
@ -407,7 +407,7 @@ void Mixer::saveVolumeSettings()
} }
} }
void Mixer::getVolume() void Mixer::getVolume()
{ {
static int lastVolume[3] = {-1, -1, -1}; static int lastVolume[3] = {-1, -1, -1};
static int lastVolumeMute[3] = {-1, -1, -1}; static int lastVolumeMute[3] = {-1, -1, -1};
@ -449,7 +449,7 @@ void Mixer::getVolume()
} }
} }
void Mixer::setVolume(int button, int volume) void Mixer::setVolume(int button, int volume)
{ {
if (mError) { if (mError) {
return; return;
@ -469,7 +469,7 @@ void Mixer::toggleMute(int button)
setButtonType(button); setButtonType(button);
} }
void Mixer::setButtonType(int button) void Mixer::setButtonType(int button)
{ {
Xpm* image; Xpm* image;
@ -500,10 +500,10 @@ void Mixer::setButtonPosition(int button, int position) {
mVolumePos[button] = position; mVolumePos[button] = position;
} }
void Mixer::setButtonPositionRelative(int button, int relativePosition) void Mixer::setButtonPositionRelative(int button, int relativePosition)
{ {
int y; int y;
// Calc new button position // Calc new button position
y = mVolumePos[button] + relativePosition; y = mVolumePos[button] + relativePosition;
@ -512,17 +512,17 @@ void Mixer::setButtonPositionRelative(int button, int relativePosition)
} else if (y < BUTTON_MAX) { } else if (y < BUTTON_MAX) {
y = BUTTON_MAX; y = BUTTON_MAX;
} }
// Set button position and volume // Set button position and volume
XMoveWindow(mDisplay, mButton[button], ButtonX[button], y); XMoveWindow(mDisplay, mButton[button], ButtonX[button], y);
mVolumePos[button] = y; mVolumePos[button] = y;
// set volume // set volume
setVolume(button, positionToPercent(y)); setVolume(button, positionToPercent(y));
} }
void Mixer::run() void Mixer::run()
{ {
XEvent event; XEvent event;
int buttonDown = 0; int buttonDown = 0;
@ -532,7 +532,7 @@ void Mixer::run()
while(1) { while(1) {
while(XPending(mDisplay) || buttonDown) { while(XPending(mDisplay) || buttonDown) {
XNextEvent(mDisplay, &event); XNextEvent(mDisplay, &event);
switch(event.type) { switch(event.type) {
case ButtonPress: case ButtonPress:
if (event.xbutton.button == Button4 || event.xbutton.button == Button5) { if (event.xbutton.button == Button4 || event.xbutton.button == Button5) {
@ -562,13 +562,13 @@ void Mixer::run()
loadVolumeSettings(); loadVolumeSettings();
} }
break; break;
case ButtonRelease: case ButtonRelease:
if (event.xbutton.button == Button1) { if (event.xbutton.button == Button1) {
buttonDown = 0; buttonDown = 0;
} }
break; break;
case MotionNotify: case MotionNotify:
if (buttonDown) { if (buttonDown) {
// Find button // Find button

View file

@ -1,8 +1,8 @@
// //
// Mixer.app // Mixer.app
// //
// Copyright (c) 1998-2002 Per Liden // Copyright (c) 1998-2002 Per Liden
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or // the Free Software Foundation; either version 2 of the License, or
@ -15,7 +15,7 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
// USA. // USA.
// //
@ -42,7 +42,7 @@
#define BUTTON_MIN 45 #define BUTTON_MIN 45
#define BUTTON_MAX 6 #define BUTTON_MAX 6
class Mixer class Mixer
{ {
public: public:
Mixer(int argc, char** argv); Mixer(int argc, char** argv);

View file

@ -12,8 +12,8 @@ for URL's), only connection to ALSA driver was added.
Hints Hints
-------------------------------------------------------------- --------------------------------------------------------------
Error led: Error led:
If the led on Mixer.app is red an error message has If the led on Mixer.app is red an error message has
been printed to stderr and something is not working been printed to stderr and something is not working
correctly. If the led is green everything is working ok. correctly. If the led is green everything is working ok.
(Error led doesn't work in AlsaMixer.app, TODO) (Error led doesn't work in AlsaMixer.app, TODO)
@ -21,14 +21,14 @@ Mute:
Right click on a volume controller to mute the sound Right click on a volume controller to mute the sound
source. The button will then have a red led in one corner. source. The button will then have a red led in one corner.
Right click again to restore the volume. If a muted sound Right click again to restore the volume. If a muted sound
source is modified by another application Mixer.app will source is modified by another application Mixer.app will
automaticaly release its muted state. automaticaly release its muted state.
Wheel mouse: Wheel mouse:
If you have a wheel mouse (where the wheel is configured as If you have a wheel mouse (where the wheel is configured as
Button4 and Button5) you can control the volume by just moving Button4 and Button5) you can control the volume by just moving
the mouse over Mixer.app and roll the wheel up and down. Use the mouse over Mixer.app and roll the wheel up and down. Use
the command line option -w to specify which slider that should the command line option -w to specify which slider that should
react to the wheel movement. react to the wheel movement.
Label: Label:
@ -39,8 +39,8 @@ Label:
the mixer. the mixer.
Save volume settings: Save volume settings:
Use the option -S (and -f <file>) if you want the volume Use the option -S (and -f <file>) if you want the volume
settings to be saved when AlsaMixer.app exits, and then settings to be saved when AlsaMixer.app exits, and then
-L to be loaded again when AlsaMixer.app is started the next time. -L to be loaded again when AlsaMixer.app is started the next time.
When not using -f the settings are saved in/loaded from When not using -f the settings are saved in/loaded from
~/GNUstep/Defaults/AlsaMixer. Use the -f <file> option ~/GNUstep/Defaults/AlsaMixer. Use the -f <file> option
@ -57,7 +57,7 @@ Configurable middle click:
Bugs Bugs
-------------------------------------------------------------- --------------------------------------------------------------
If you discover any bugs in this software, please send a If you discover any bugs in this software, please send a
bugreport to xhlavk00@stud.fit.vutbr.cz and describe the problem. bugreport to xhlavk00@stud.fit.vutbr.cz and describe the problem.
@ -72,8 +72,8 @@ Alban Hertroys <dalroi@wit401310.student.utwente.nl>
Copyright Copyright
-------------------------------------------------------------- --------------------------------------------------------------
AlsaMixer.app, 2004, Petr Hlavka AlsaMixer.app, 2004, Petr Hlavka
Mixer.app is copyright (c) 1998-2002 by Per Liden and is Mixer.app is copyright (c) 1998-2002 by Per Liden and is
licensed through the GNU General Public License. Read the licensed through the GNU General Public License. Read the
COPYING file for the complete license. COPYING file for the complete license.
Minor parts of this code were taken from asmixer by Rob Malda Minor parts of this code were taken from asmixer by Rob Malda

View file

@ -1,8 +1,8 @@
// //
// Mixer.app // Mixer.app
// //
// Copyright (c) 1998-2002 Per Liden // Copyright (c) 1998-2002 Per Liden
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or // the Free Software Foundation; either version 2 of the License, or
@ -15,7 +15,7 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
// USA. // USA.
// //
@ -30,7 +30,7 @@
using namespace std; using namespace std;
Xpm::Xpm(Display* display, Window root, char** data) Xpm::Xpm(Display* display, Window root, char** data)
{ {
int error; int error;
@ -67,7 +67,7 @@ Xpm::Xpm(Display* display, Window root, char** data)
} }
} }
Xpm::~Xpm() Xpm::~Xpm()
{ {
if (mImage) { if (mImage) {
XFreePixmap(mDisplay, mImage); XFreePixmap(mDisplay, mImage);
@ -78,20 +78,20 @@ Xpm::~Xpm()
} }
} }
void Xpm::setWindowPixmap(Window win) void Xpm::setWindowPixmap(Window win)
{ {
XResizeWindow(mDisplay, win, mAttributes.width, mAttributes.height); XResizeWindow(mDisplay, win, mAttributes.width, mAttributes.height);
XSetWindowBackgroundPixmap(mDisplay, win, mImage); XSetWindowBackgroundPixmap(mDisplay, win, mImage);
} }
void Xpm::setWindowPixmapShaped(Window win) void Xpm::setWindowPixmapShaped(Window win)
{ {
XResizeWindow(mDisplay, win, mAttributes.width, mAttributes.height); XResizeWindow(mDisplay, win, mAttributes.width, mAttributes.height);
XSetWindowBackgroundPixmap(mDisplay, win, mImage); XSetWindowBackgroundPixmap(mDisplay, win, mImage);
XShapeCombineMask(mDisplay, win, ShapeBounding, 0, 0, mMask, ShapeSet); XShapeCombineMask(mDisplay, win, ShapeBounding, 0, 0, mMask, ShapeSet);
} }
void Xpm::drawString(int x, int y, char* text) void Xpm::drawString(int x, int y, char* text)
{ {
Font font; Font font;
GC gc; GC gc;

View file

@ -1,8 +1,8 @@
// //
// Mixer.app // Mixer.app
// //
// Copyright (c) 1998-2002 Per Liden // Copyright (c) 1998-2002 Per Liden
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or // the Free Software Foundation; either version 2 of the License, or
@ -15,7 +15,7 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
// USA. // USA.
// //
@ -25,7 +25,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/xpm.h> #include <X11/xpm.h>
class Xpm class Xpm
{ {
public: public:
Xpm(Display* display, Window root, char** data); Xpm(Display* display, Window root, char** data);

View file

@ -17,7 +17,7 @@ Version Description
- New Makefile. - New Makefile.
1.5.0 - Released 2000-02-21. 1.5.0 - Released 2000-02-21.
- Added command line options -s and -S <file>, which cause - Added command line options -s and -S <file>, which cause
Mixer.app to load/save volume settings when starting/exiting. Mixer.app to load/save volume settings when starting/exiting.
When the option -s is used, settings are loaded from/saved in When the option -s is used, settings are loaded from/saved in
~/GNUstep/Defaults/Mixer. Use -S <file> if you want Mixer.app ~/GNUstep/Defaults/Mixer. Use -S <file> if you want Mixer.app
@ -25,19 +25,19 @@ Version Description
- Fixed potential bug in command line parsing. - Fixed potential bug in command line parsing.
1.4.1 - Released 1999-05-28. 1.4.1 - Released 1999-05-28.
- Added command line option -l <text> that can be used to - Added command line option -l <text> that can be used to
add a text label in the corner of the mixer. add a text label in the corner of the mixer.
1.4.0 - Released 1999-05-09. 1.4.0 - Released 1999-05-09.
- Added support for wheel mice. One of the sliders (use -w to - Added support for wheel mice. One of the sliders (use -w to
specify which one) will react on wheel movement. specify which one) will react on wheel movement.
- Misc. code clean up. - Misc. code clean up.
1.3.3 - Released 1999-05-02. 1.3.3 - Released 1999-05-02.
- Fixed problem that caused Mixer.app to die. - Fixed problem that caused Mixer.app to die.
1.3.2 - Released 1999-04-18. 1.3.2 - Released 1999-04-18.
- Fixed exit bug. Mixer.app will now exit properly when - Fixed exit bug. Mixer.app will now exit properly when
the windowmanager terminates. the windowmanager terminates.
1.3.1 - Released 1999-02-09. 1.3.1 - Released 1999-02-09.
@ -48,25 +48,25 @@ Version Description
1.3.0 - Released 1999-02-04. 1.3.0 - Released 1999-02-04.
- New design. - New design.
- I didn't find the mute function very usefull so I removed it. - I didn't find the mute function very usefull so I removed it.
- Doing 'make install' will now install it in - Doing 'make install' will now install it in
/usr/local/GNUstep/Apps/Mixer.app/. /usr/local/GNUstep/Apps/Mixer.app/.
1.2.0 - Released 1998-12-01. 1.2.0 - Released 1998-12-01.
- Moved back to old design. The design of version 1.1.1 made - Moved back to old design. The design of version 1.1.1 made
Mixer.app (and Window Maker) unstable due to some strange Mixer.app (and Window Maker) unstable due to some strange
race condition at startup. It worked on some machines and race condition at startup. It worked on some machines and
some not, so I desided to go back to the old design. some not, so I desided to go back to the old design.
- Increased idle interval to reduce CPU usage. - Increased idle interval to reduce CPU usage.
1.1.1 - Released 1998-11-14. 1.1.1 - Released 1998-11-14.
- Fixed XGetImage errors, (slow machines may still have this - Fixed XGetImage errors, (slow machines may still have this
problem, please report any errors). problem, please report any errors).
- Added command line option -m <dev> to set mixer device. - Added command line option -m <dev> to set mixer device.
- Added command line option -n <name> to set instance name. - Added command line option -n <name> to set instance name.
- Compiling under FreeBSD now works fine. - Compiling under FreeBSD now works fine.
1.1.0 - Released 1998-11-14. 1.1.0 - Released 1998-11-14.
- Alarm singals are no longer used so now the "Alarm Clock" - Alarm singals are no longer used so now the "Alarm Clock"
problem is solved for sure! problem is solved for sure!
- Mute function. - Mute function.
- New design. - New design.
@ -84,7 +84,7 @@ Version Description
- Minor changes to eventhandling code. - Minor changes to eventhandling code.
1.0.2 - Released 1998-02-23. 1.0.2 - Released 1998-02-23.
- If the red led goes on (an error has occured) the control - If the red led goes on (an error has occured) the control
buttons are set to volume 0. buttons are set to volume 0.
1.0.1 - Released 1998-02-23. 1.0.1 - Released 1998-02-23.

View file

@ -19,22 +19,22 @@ support.
Hints Hints
-------------------------------------------------------------- --------------------------------------------------------------
Error led: Error led:
If the led on Mixer.app is red an error message has If the led on Mixer.app is red an error message has
been printed to stderr and something is not working been printed to stderr and something is not working
correctly. If the led is green everything is working ok. correctly. If the led is green everything is working ok.
Mute: Mute:
Right click on a volume controller to mute the sound Right click on a volume controller to mute the sound
source. The button will then have a red led in one corner. source. The button will then have a red led in one corner.
Right click again to restore the volume. If a muted sound Right click again to restore the volume. If a muted sound
source is modified by another application Mixer.app will source is modified by another application Mixer.app will
automaticaly release its muted state. automaticaly release its muted state.
Wheel mouse: Wheel mouse:
If you have a wheel mouse (where the wheel is configured as If you have a wheel mouse (where the wheel is configured as
Button4 and Button5) you can control the volume by just moving Button4 and Button5) you can control the volume by just moving
the mouse over Mixer.app and roll the wheel up and down. Use the mouse over Mixer.app and roll the wheel up and down. Use
the command line option -w to specify which slider that should the command line option -w to specify which slider that should
react to the wheel movement. react to the wheel movement.
Label: Label:
@ -45,16 +45,16 @@ Label:
the mixer. the mixer.
Save volume settings: Save volume settings:
Use the option -s or -S <file> if you want the volume Use the option -s or -S <file> if you want the volume
settings to be saved when Mixer.app exits, and then settings to be saved when Mixer.app exits, and then
loaded again when Mixer.app is started the next time. loaded again when Mixer.app is started the next time.
When using -s the settings are saved in/loaded from When using -s the settings are saved in/loaded from
~/GNUstep/Defaults/Mixer. Use the -S <file> option ~/GNUstep/Defaults/Mixer. Use the -S <file> option
if you want to use a different file. if you want to use a different file.
Bugs Bugs
-------------------------------------------------------------- --------------------------------------------------------------
If you discover any bugs in this software, please send a If you discover any bugs in this software, please send a
bugreport to per@fukt.bth.se and describe the problem. bugreport to per@fukt.bth.se and describe the problem.
@ -67,8 +67,8 @@ Alban Hertroys <dalroi@wit401310.student.utwente.nl>
Copyright Copyright
-------------------------------------------------------------- --------------------------------------------------------------
Mixer.app is copyright (c) 1998-2002 by Per Liden and is Mixer.app is copyright (c) 1998-2002 by Per Liden and is
licensed through the GNU General Public License. Read the licensed through the GNU General Public License. Read the
COPYING file for the complete license. COPYING file for the complete license.
Minor parts of this code were taken from asmixer by Rob Malda Minor parts of this code were taken from asmixer by Rob Malda

View file

@ -13,7 +13,7 @@ Version 1.3 - Jul 2, 2001
Version 1.2 - Jun 29, 2001 Version 1.2 - Jun 29, 2001
- Temporary files are now unique to the process, - Temporary files are now unique to the process,
so that multiple instances can run at once. so that multiple instances can run at once.
Version 1.1 - Jun 25, 2001 Version 1.1 - Jun 25, 2001
- Fixed some compilation problems. - Fixed some compilation problems.
- Fixed potential race condition. - Fixed potential race condition.

View file

@ -10,12 +10,12 @@ Requirements
- ICAO Location Indicator - ICAO Location Indicator
You must find the ICAO Location Indicator (a 4-character string) You must find the ICAO Location Indicator (a 4-character string)
of a weather station near you. You can search for a station of a weather station near you. You can search for a station
on this site: http://www.nws.noaa.gov/oso/siteloc.shtml on this site: http://www.nws.noaa.gov/oso/siteloc.shtml
- X11, libxpm, C++ development environment - X11, libxpm, C++ development environment
Most (Linux) systems have these things installed by default. Most (Linux) systems have these things installed by default.
If you don't have it look for packages that fit your If you don't have it look for packages that fit your
distribution/vendor. distribution/vendor.

View file

@ -1,8 +1,8 @@
// //
// Temperature.app // Temperature.app
// //
// Copyright (c) 2000 Per Liden // Copyright (c) 2000 Per Liden
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or // the Free Software Foundation; either version 2 of the License, or
@ -15,13 +15,13 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
// USA. // USA.
// //
#include "Temperature.h" #include "Temperature.h"
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
Temperature app(argc, argv); Temperature app(argc, argv);
app.run(); app.run();

View file

@ -11,14 +11,14 @@
Description Description
-------------------------------------------------------------- --------------------------------------------------------------
Temperature.app is a Window Maker dock application which Temperature.app is a Window Maker dock application which
fetches local temperature information every 15 minutes from fetches local temperature information every 15 minutes from
ftp://weather.noaa.gov and displays it (in Celsius or Fahrenheit). ftp://weather.noaa.gov and displays it (in Celsius or Fahrenheit).
Hints Hints
-------------------------------------------------------------- --------------------------------------------------------------
The led: The led:
If the led is blinking (green/red), then that means If the led is blinking (green/red), then that means
Temperature.app is trying to fetch weather information. Temperature.app is trying to fetch weather information.
If successful the led will stop blinking and go green. If successful the led will stop blinking and go green.
If unsuccessful the led will stop blinking and go red. If unsuccessful the led will stop blinking and go red.
@ -30,20 +30,20 @@ The led:
Bugs Bugs
-------------------------------------------------------------- --------------------------------------------------------------
If you discover any bugs in this software, please send a If you discover any bugs in this software, please send a
bugreport to per@fukt.bth.se and describe the problem. bugreport to per@fukt.bth.se and describe the problem.
Special thanks to Special thanks to
-------------------------------------------------------------- --------------------------------------------------------------
Mike Henderson (mghenderson@lanl.gov) - Author of wmWeather Mike Henderson (mghenderson@lanl.gov) - Author of wmWeather
(I didn't know about the weather.noaa.gov ftp-site before I (I didn't know about the weather.noaa.gov ftp-site before I
caught sight of his program). caught sight of his program).
Copyright Copyright
-------------------------------------------------------------- --------------------------------------------------------------
Temperature.app is copyright (c) 2000-2002 by Per Liden and is Temperature.app is copyright (c) 2000-2002 by Per Liden and is
licensed through the GNU General Public License. Read the licensed through the GNU General Public License. Read the
COPYING file for the complete license. COPYING file for the complete license.

View file

@ -1,8 +1,8 @@
// //
// Temperature.app // Temperature.app
// //
// Copyright (c) 2000-2002 Per Liden // Copyright (c) 2000-2002 Per Liden
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or // the Free Software Foundation; either version 2 of the License, or
@ -15,7 +15,7 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
// USA. // USA.
// //
@ -40,12 +40,12 @@
volatile static ChildStatus childStatus; volatile static ChildStatus childStatus;
static void catchBrokenPipe(int sig) static void catchBrokenPipe(int sig)
{ {
exit(0); exit(0);
} }
static void catchChildExit(int sig) static void catchChildExit(int sig)
{ {
int status; int status;
waitpid(-1, &status, 0); waitpid(-1, &status, 0);
@ -65,7 +65,7 @@ static void catchChildExit(int sig)
} }
} }
Temperature::Temperature(int argc, char** argv) Temperature::Temperature(int argc, char** argv)
{ {
XClassHint classHint; XClassHint classHint;
XSizeHints sizeHints; XSizeHints sizeHints;
@ -163,14 +163,14 @@ Temperature::Temperature(int argc, char** argv)
std::cerr << APPNAME << ": could not open display " << displayName << std::endl; std::cerr << APPNAME << ": could not open display " << displayName << std::endl;
exit(0); exit(0);
} }
// Get root window // Get root window
mRoot = RootWindow(mDisplay, DefaultScreen(mDisplay)); mRoot = RootWindow(mDisplay, DefaultScreen(mDisplay));
// Create windows // Create windows
mAppWin = XCreateSimpleWindow(mDisplay, mRoot, 1, 1, 64, 64, 0, 0, 0); mAppWin = XCreateSimpleWindow(mDisplay, mRoot, 1, 1, 64, 64, 0, 0, 0);
mIconWin = XCreateSimpleWindow(mDisplay, mAppWin, 0, 0, 64, 64, 0, 0, 0); mIconWin = XCreateSimpleWindow(mDisplay, mAppWin, 0, 0, 64, 64, 0, 0, 0);
// Set classhint // Set classhint
classHint.res_name = mInstanceName; classHint.res_name = mInstanceName;
classHint.res_class = CLASSNAME; classHint.res_class = CLASSNAME;
@ -230,7 +230,7 @@ void Temperature::tryHelp(char* appname)
std::cerr << std::endl << "Try `" << appname << " --help' for more information" << std::endl; std::cerr << std::endl << "Try `" << appname << " --help' for more information" << std::endl;
} }
void Temperature::showHelp() void Temperature::showHelp()
{ {
std::cerr << APPNAME << " Copyright (c) 2000-2002 by Per Liden (per@fukt.bth.se)" << std::endl << std::endl std::cerr << APPNAME << " Copyright (c) 2000-2002 by Per Liden (per@fukt.bth.se)" << std::endl << std::endl
<< "options:" << std::endl << "options:" << std::endl
@ -241,7 +241,7 @@ void Temperature::showHelp()
<< " -n <name> set client instance name" << std::endl << " -n <name> set client instance name" << std::endl
<< " -d <disp> set display" << std::endl << " -d <disp> set display" << std::endl
<< " -v print version and exit" << std::endl << " -v print version and exit" << std::endl
<< " -h, --help display this help text and exit" << std::endl << " -h, --help display this help text and exit" << std::endl
<< std::endl << std::endl
<< "You must supply the ICAO Location Indicator (a 4-character string)" << std::endl << "You must supply the ICAO Location Indicator (a 4-character string)" << std::endl
<< "of a weather station near you. You can search for a station on" << std::endl << "of a weather station near you. You can search for a station on" << std::endl
@ -294,7 +294,7 @@ void Temperature::setTime(char* utcTime)
{ {
char unit[3]; char unit[3];
int hour = 0; int hour = 0;
int min = 0; int min = 0;
strncpy(unit, &utcTime[0], 2); strncpy(unit, &utcTime[0], 2);
hour = atoi(unit); hour = atoi(unit);
@ -319,7 +319,7 @@ void Temperature::setTime(char* utcTime)
if (mTime12HourFormat) { if (mTime12HourFormat) {
if (hour >= 0 && hour <= 11) { if (hour >= 0 && hour <= 11) {
mTimeAMPM = "AM"; mTimeAMPM = "AM";
} else { } else {
mTimeAMPM = "PM"; mTimeAMPM = "PM";
} }
@ -350,7 +350,7 @@ bool Temperature::updateTemperture(ifstream& file)
strncpy(time, start - 5, 4); strncpy(time, start - 5, 4);
setTime(time); setTime(time);
} }
// Find temperature // Find temperature
while (!file.eof()) { while (!file.eof()) {
file >> buffer; file >> buffer;
@ -365,7 +365,7 @@ bool Temperature::updateTemperture(ifstream& file)
sprintf(mTemperature, "%d", (int)rint((atoi(buffer) - 32) / 1.8)); sprintf(mTemperature, "%d", (int)rint((atoi(buffer) - 32) / 1.8));
unit = " °C"; unit = " °C";
} }
Xpm* image = new Xpm(mDisplay, mRoot, main_xpm); Xpm* image = new Xpm(mDisplay, mRoot, main_xpm);
if (mShowTime) { if (mShowTime) {
if (mTime12HourFormat) { if (mTime12HourFormat) {
@ -389,7 +389,7 @@ bool Temperature::updateTemperture(ifstream& file)
return false; return false;
} }
void Temperature::run() void Temperature::run()
{ {
if (mShowTime) { if (mShowTime) {
calcTimeDiff(); calcTimeDiff();

View file

@ -1,8 +1,8 @@
// //
// Temperature.app // Temperature.app
// //
// Copyright (c) 2000-2002 Per Liden // Copyright (c) 2000-2002 Per Liden
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or // the Free Software Foundation; either version 2 of the License, or
@ -15,7 +15,7 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
// USA. // USA.
// //
@ -47,9 +47,9 @@ using namespace std;
enum ChildStatus enum ChildStatus
{ {
ChildRunning, ChildRunning,
ChildDone, ChildDone,
ChildError ChildError
}; };
class Temperature class Temperature

View file

@ -1,8 +1,8 @@
// //
// Temperature.app // Temperature.app
// //
// Copyright (c) 2000-2002 Per Liden // Copyright (c) 2000-2002 Per Liden
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or // the Free Software Foundation; either version 2 of the License, or
@ -15,7 +15,7 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
// USA. // USA.
// //
@ -28,7 +28,7 @@
#include "Temperature.h" #include "Temperature.h"
#include "Xpm.h" #include "Xpm.h"
Xpm::Xpm(Display* display, Window root, char** data) Xpm::Xpm(Display* display, Window root, char** data)
{ {
int error; int error;
@ -65,7 +65,7 @@ Xpm::Xpm(Display* display, Window root, char** data)
} }
} }
Xpm::~Xpm() Xpm::~Xpm()
{ {
if (mImage) { if (mImage) {
XFreePixmap(mDisplay, mImage); XFreePixmap(mDisplay, mImage);
@ -76,14 +76,14 @@ Xpm::~Xpm()
} }
} }
void Xpm::setWindowPixmap(Window win) void Xpm::setWindowPixmap(Window win)
{ {
XResizeWindow(mDisplay, win, mAttributes.width, mAttributes.height); XResizeWindow(mDisplay, win, mAttributes.width, mAttributes.height);
XSetWindowBackgroundPixmap(mDisplay, win, mImage); XSetWindowBackgroundPixmap(mDisplay, win, mImage);
XClearWindow(mDisplay, win); XClearWindow(mDisplay, win);
} }
void Xpm::setWindowPixmapShaped(Window win) void Xpm::setWindowPixmapShaped(Window win)
{ {
XResizeWindow(mDisplay, win, mAttributes.width, mAttributes.height); XResizeWindow(mDisplay, win, mAttributes.width, mAttributes.height);
XSetWindowBackgroundPixmap(mDisplay, win, mImage); XSetWindowBackgroundPixmap(mDisplay, win, mImage);
@ -101,13 +101,13 @@ void Xpm::drawString(int pos, char* font, char* str)
cerr << APPNAME << ": could not load font '" << font << "'" << endl; cerr << APPNAME << ": could not load font '" << font << "'" << endl;
exit(0); exit(0);
} }
gcv.foreground = WhitePixel(mDisplay, DefaultScreen(mDisplay)); gcv.foreground = WhitePixel(mDisplay, DefaultScreen(mDisplay));
gc = XCreateGC(mDisplay, mImage, GCForeground, &gcv); gc = XCreateGC(mDisplay, mImage, GCForeground, &gcv);
int strLength = strlen(str); int strLength = strlen(str);
int strWidth = XTextWidth(fontStruct, str, strLength); int strWidth = XTextWidth(fontStruct, str, strLength);
int x = (64 / 2) - (strWidth / 2); int x = (64 / 2) - (strWidth / 2);
XSetFont(mDisplay, gc, fontStruct->fid); XSetFont(mDisplay, gc, fontStruct->fid);
XDrawString(mDisplay, mImage, gc, x, pos, str, strLength); XDrawString(mDisplay, mImage, gc, x, pos, str, strLength);
@ -132,7 +132,7 @@ void Xpm::drawComposedString(int pos, char* font1, char* str1, char* font2, char
cerr << APPNAME << ": could not load font '" << font2 << "'" << endl; cerr << APPNAME << ": could not load font '" << font2 << "'" << endl;
exit(0); exit(0);
} }
gcv.foreground = WhitePixel(mDisplay, DefaultScreen(mDisplay)); gcv.foreground = WhitePixel(mDisplay, DefaultScreen(mDisplay));
gc = XCreateGC(mDisplay, mImage, GCForeground, &gcv); gc = XCreateGC(mDisplay, mImage, GCForeground, &gcv);
@ -140,7 +140,7 @@ void Xpm::drawComposedString(int pos, char* font1, char* str1, char* font2, char
int str1Width = XTextWidth(fontStruct1, str1, str1Length); int str1Width = XTextWidth(fontStruct1, str1, str1Length);
int str2Length = strlen(str2); int str2Length = strlen(str2);
int str2Width = XTextWidth(fontStruct2, str2, str2Length); int str2Width = XTextWidth(fontStruct2, str2, str2Length);
int x = (64 / 2) - ((str1Width + str2Width) / 2); int x = (64 / 2) - ((str1Width + str2Width) / 2);
XSetFont(mDisplay, gc, fontStruct1->fid); XSetFont(mDisplay, gc, fontStruct1->fid);
XDrawString(mDisplay, mImage, gc, x, pos, str1, str1Length); XDrawString(mDisplay, mImage, gc, x, pos, str1, str1Length);

View file

@ -1,8 +1,8 @@
// //
// Temperature.app // Temperature.app
// //
// Copyright (c) 2000-2002 Per Liden // Copyright (c) 2000-2002 Per Liden
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or // the Free Software Foundation; either version 2 of the License, or
@ -15,7 +15,7 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
// USA. // USA.
// //
@ -25,7 +25,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/xpm.h> #include <X11/xpm.h>
class Xpm class Xpm
{ {
public: public:
Xpm(Display* display, Window root, char** data); Xpm(Display* display, Window root, char** data);

View file

@ -32,10 +32,10 @@ Version 1.23 - released March 20, 1999.
Version 1.22 - released February 24, 1999. Version 1.22 - released February 24, 1999.
Added double click detection and -e command-line option. Added double click detection and -e command-line option.
Version 1.21 - released February 4, 1999. Version 1.21 - released February 4, 1999.
cosmetic for AfterStep users. removed spurious black line at RHS edge an mask. cosmetic for AfterStep users. removed spurious black line at RHS edge an mask.
Version 1.2 - released January 14, 1999. Version 1.2 - released January 14, 1999.
Changed support for LowColor Pixmap. Now, check for Depth Changed support for LowColor Pixmap. Now, check for Depth
automatically. If its <= 8, then use LowColor. automatically. If its <= 8, then use LowColor.

View file

@ -21,14 +21,14 @@ usage: wmCalClock [-b <Volume>] [-tc <Color>] [-bc <Color>] [-e "Command"] [-S]
-S Do not show seconds. -S Do not show seconds.
-24 Show 24-hour time. Default is 12 hour AM/PM Time. -24 Show 24-hour time. Default is 12 hour AM/PM Time.
-g Show Greenwich time. -g Show Greenwich time.
-s Show Greenwich Mean Sidereal Time (GMST) in 24-hour format. -s Show Greenwich Mean Sidereal Time (GMST) in 24-hour format.
-L <Longitude> Show Local Sidereal Time (LST) in 24-hour format. -L <Longitude> Show Local Sidereal Time (LST) in 24-hour format.
Longitude is in degrees (- for West + for East). Longitude is in degrees (- for West + for East).
-l Use a low-color pixmap to conserve colors. On 8-bit displays the -l Use a low-color pixmap to conserve colors. On 8-bit displays the
low color pixmap will always be used. low color pixmap will always be used.
-h Display help screen. -h Display help screen.
Example: wmCalClock -b 100 -tc #001100 -bc #7e9e69 Example: wmCalClock -b 100 -tc #001100 -bc #7e9e69
WindowMaker. WindowMaker.
@ -38,12 +38,12 @@ In WindowMaker simply drag and drop the wmCalClock App on the WindowMaker Dock o
Afterstep. Afterstep.
--------- ---------
Afterstep users put the following in their .steprc "Wharf wmCalClock - MaxSwallow Afterstep users put the following in their .steprc "Wharf wmCalClock - MaxSwallow
"wmCalClock" wmCalClock &". Dont use Afterstep so I have no idea if it works... "wmCalClock" wmCalClock &". Dont use Afterstep so I have no idea if it works...
Note: AfterStep's Wharf supposedly has a problem with pixmaps that are larger Note: AfterStep's Wharf supposedly has a problem with pixmaps that are larger
than 60x60 pixels. Please tell the AfterStep authors to fix this, this is not than 60x60 pixels. Please tell the AfterStep authors to fix this, this is not
our fault, but a Wharf problem! our fault, but a Wharf problem!
Other window managers. Other window managers.
---------------------- ----------------------

View file

@ -10,8 +10,8 @@ Installation
1) gunzip wmCalClock-x.xx.tar.gz 1) gunzip wmCalClock-x.xx.tar.gz
1) tar -xvf wmCalClock-x.xx.tar 1) tar -xvf wmCalClock-x.xx.tar
2) cd wmCalClock-x.xx/Src/ 2) cd wmCalClock-x.xx/Src/
3) make 3) make
4) make install (must be root) 4) make install (must be root)
5) wmCalClock & (or 'wmCalClock -h' for help, or 'man wmCalClock' for the man page) 5) wmCalClock & (or 'wmCalClock -h' for help, or 'man wmCalClock' for the man page)

View file

@ -1,8 +1,8 @@
wmCalClock-1.24 release wmCalClock-1.24 release
----------------------- -----------------------
Author....: Michael G. Henderson <mghenderson@lanl.gov> Author....: Michael G. Henderson <mghenderson@lanl.gov>
Description Description
----------- -----------
wmCalClock is a simple Calendar Clock that uses anti-aliased characters and wmCalClock is a simple Calendar Clock that uses anti-aliased characters and
@ -18,7 +18,7 @@ BUGS Bug reports
CHANGES Change history. CHANGES Change history.
COPYING GNU General Public License Version 2. COPYING GNU General Public License Version 2.
TODO Wish list. TODO Wish list.
Bugs Bugs
----- -----

View file

@ -21,7 +21,7 @@ OBJS = wmCalClock.o \
all: wmCalClock.o wmCalClock all: wmCalClock.o wmCalClock
wmCalClock.o: wmCalClock_master.xpm wmCalClock_mask.xbm wmCalClock.o: wmCalClock_master.xpm wmCalClock_mask.xbm
wmCalClock: $(OBJS) wmCalClock: $(OBJS)
$(CC) $(COPTS) $(SYSTEM) -o wmCalClock $^ $(INCDIR) $(LIBDIR) $(LIBS) $(CC) $(COPTS) $(SYSTEM) -o wmCalClock $^ $(INCDIR) $(LIBDIR) $(LIBS)
clean: clean:
@ -32,5 +32,5 @@ clean:
install:: wmCalClock install:: wmCalClock
install -c -s -m 0755 wmCalClock $(DESTDIR)/bin install -c -s -m 0755 wmCalClock $(DESTDIR)/bin
install -c -m 0644 wmCalClock.1 $(DESTDIR)/man/man1 install -c -m 0644 wmCalClock.1 $(DESTDIR)/man/man1

View file

@ -21,7 +21,7 @@ OBJS = wmCalClock.o \
all: wmCalClock.o wmCalClock all: wmCalClock.o wmCalClock
wmCalClock.o: wmCalClock_master.xpm wmCalClock_mask.xbm wmCalClock.o: wmCalClock_master.xpm wmCalClock_mask.xbm
wmCalClock: $(OBJS) wmCalClock: $(OBJS)
$(CC) $(COPTS) $(SYSTEM) -o wmCalClock $(OBJS) $(INCDIR) $(LIBDIR) $(LIBS) $(CC) $(COPTS) $(SYSTEM) -o wmCalClock $(OBJS) $(INCDIR) $(LIBDIR) $(LIBS)
clean: clean:
@ -32,5 +32,5 @@ clean:
install:: wmCalClock install:: wmCalClock
install -s -m 0755 wmCalClock $(DESTDIR)/bin install -s -m 0755 wmCalClock $(DESTDIR)/bin
install -c -m 0644 wmCalClock.1 $(DESTDIR)/man/man1 install -c -m 0644 wmCalClock.1 $(DESTDIR)/man/man1

View file

@ -21,7 +21,7 @@ OBJS = wmCalClock.o \
all: wmCalClock.o wmCalClock all: wmCalClock.o wmCalClock
wmCalClock.o: wmCalClock_master.xpm wmCalClock_mask.xbm wmCalClock.o: wmCalClock_master.xpm wmCalClock_mask.xbm
wmCalClock: $(OBJS) wmCalClock: $(OBJS)
$(CC) $(COPTS) $(SYSTEM) -o wmCalClock $^ $(INCDIR) $(LIBDIR) $(LIBS) $(CC) $(COPTS) $(SYSTEM) -o wmCalClock $^ $(INCDIR) $(LIBDIR) $(LIBS)
clean: clean:
@ -32,5 +32,5 @@ clean:
install:: wmCalClock install:: wmCalClock
install -s -m 0755 wmCalClock $(DESTDIR)/bin install -s -m 0755 wmCalClock $(DESTDIR)/bin
install -c -m 0644 wmCalClock.1 $(DESTDIR)/man/man1 install -c -m 0644 wmCalClock.1 $(DESTDIR)/man/man1

View file

@ -1,4 +1,4 @@
.TH WMCALCLOCK 1 "16 December 1998" .TH WMCALCLOCK 1 "16 December 1998"
.SH NAME .SH NAME
WMCALCLOCK \- Dockable Calendar Clock WMCALCLOCK \- Dockable Calendar Clock
.SH SYNOPSIS .SH SYNOPSIS
@ -6,7 +6,7 @@ WMCALCLOCK \- Dockable Calendar Clock
[-h] [-display <Display>] [-b <Volume>] [-e <Command>] [-24] [-s] [-S] [-L <Longitude>] [-l] [-tc <color>] [-bc <color>] [-tekton] [-comicsans] [-arial] [-luggerbug] [-jazz] [-h] [-display <Display>] [-b <Volume>] [-e <Command>] [-24] [-s] [-S] [-L <Longitude>] [-l] [-tc <color>] [-bc <color>] [-tekton] [-comicsans] [-arial] [-luggerbug] [-jazz]
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
wmCalClock is a simple Calendar Clock with anti-aliased text and drop-shadows. wmCalClock is a simple Calendar Clock with anti-aliased text and drop-shadows.
.SH OPTIONS .SH OPTIONS
.TP .TP
.B \-h .B \-h
@ -19,31 +19,31 @@ Use an alternate X Display.
Beep on the hour with specified volume (between -100 and 100). Beep on the hour with specified volume (between -100 and 100).
.TP .TP
.B \-e <Command> .B \-e <Command>
Command to execute via double click of mouse button 1. (Use quotes if your command Command to execute via double click of mouse button 1. (Use quotes if your command
has white space in it). has white space in it).
.TP .TP
.B \-24 .B \-24
Show time in 24-hour format instead of default 12-hour AM/PM format. Show time in 24-hour format instead of default 12-hour AM/PM format.
.TP .TP
.B \-s .B \-s
Show Greenwich Mean Sidereal Time (GMST) in 24-hour format. Show Greenwich Mean Sidereal Time (GMST) in 24-hour format.
.TP .TP
.B \-S .B \-S
Dont show seconds. Dont show seconds.
.TP .TP
.B \-L <Longitude> .B \-L <Longitude>
Show Local Sidereal Time (LST) in 24-hour format. Longitude is in degrees Show Local Sidereal Time (LST) in 24-hour format. Longitude is in degrees
(- for West + for East). (- for West + for East).
.TP .TP
.B \-l .B \-l
Force use of lower color pixmap to conserve colors. On displays with <= 8 bits, Force use of lower color pixmap to conserve colors. On displays with <= 8 bits,
the low color Pixmap will always be used. the low color Pixmap will always be used.
.TP .TP
.B \-tc <color> .B \-tc <color>
Change color of time-field digits. Change color of time-field digits.
.TP .TP
.B \-bc <color> .B \-bc <color>
Change color of time-field background. Change color of time-field background.
.TP .TP
.B \-tekton .B \-tekton
Use the Tekton font for time field. Use the Tekton font for time field.

View file

@ -1,11 +1,11 @@
/* /*
* *
* wmCalClock-1.25 (C) 1998, 1999 Mike Henderson (mghenderson@lanl.gov) * wmCalClock-1.25 (C) 1998, 1999 Mike Henderson (mghenderson@lanl.gov)
* *
* - Its a Calendar Clock.... * - Its a Calendar Clock....
* *
* *
* *
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -19,7 +19,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the * along with this program (see the file COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA * Boston, MA 02110-1301 USA
* *
* *
@ -31,10 +31,10 @@
* *
* Version 1.24 - released March 27, 1999. * Version 1.24 - released March 27, 1999.
* Added support for additional fonts for time field; * Added support for additional fonts for time field;
* *
* -tekton for Tekton * -tekton for Tekton
* -arial for Arial (Helvetica) (this is the same font as usual) * -arial for Arial (Helvetica) (this is the same font as usual)
* -luggerbug for LuggerBug * -luggerbug for LuggerBug
* -comicsans for ComicSans * -comicsans for ComicSans
* -jazz for JazzPoster * -jazz for JazzPoster
* *
@ -66,7 +66,7 @@
* *
* Version 1.10 - released January 7, 1999. * Version 1.10 - released January 7, 1999.
* Added support for LowColor Pixmap. (21 colors may still be a * Added support for LowColor Pixmap. (21 colors may still be a
* bit high, but the poor saps with 8-bit displays can at least run * bit high, but the poor saps with 8-bit displays can at least run
* it now.) * it now.)
* *
* Version 1.02 - released January 7, 1999. * Version 1.02 - released January 7, 1999.
@ -84,8 +84,8 @@
/* /*
* Includes * Includes
*/ */
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
@ -101,8 +101,8 @@
/* /*
* Delay between refreshes (in microseconds) * Delay between refreshes (in microseconds)
*/ */
#define DELAY 10000L #define DELAY 10000L
#define WMCALCLOCK_VERSION "1.25" #define WMCALCLOCK_VERSION "1.25"
@ -121,13 +121,13 @@ void print_usage();
int xsMonth[12] = { 150, 170, 190, 212, 233, 256, 276, 294, 317, 337, 357, 380 }; int xsMonth[12] = { 150, 170, 190, 212, 233, 256, 276, 294, 317, 337, 357, 380 };
int xeMonth[12] = { 168, 188, 210, 231, 254, 275, 292, 314, 335, 355, 377, 398 }; int xeMonth[12] = { 168, 188, 210, 231, 254, 275, 292, 314, 335, 355, 377, 398 };
int xdMonth[12]; int xdMonth[12];
int yMonth = 80; int yMonth = 80;
int ydMonth = 13; int ydMonth = 13;
int xsDayOfWeek[7] = { 293, 150, 177, 201, 228, 253, 271 }; int xsDayOfWeek[7] = { 293, 150, 177, 201, 228, 253, 271 };
int xeDayOfWeek[7] = { 314, 175, 199, 226, 250, 269, 290 }; int xeDayOfWeek[7] = { 314, 175, 199, 226, 250, 269, 290 };
int xdDayOfWeek[7]; int xdDayOfWeek[7];
int yDayOfWeek = 95; int yDayOfWeek = 95;
int ydDayOfWeek = 13; int ydDayOfWeek = 13;
/* /*
@ -163,7 +163,7 @@ int ydDayOfMonth = 23;
/* /*
* Luggerbug Font Narrow - 13 pixels high. * Luggerbug Font Narrow - 13 pixels high.
*/ */
int xsDigits_Luggerbug13n[11] = { 75, 84, 92, 101, 110, 119, 127, 136, 143, 151, 159 }; int xsDigits_Luggerbug13n[11] = { 75, 84, 92, 101, 110, 119, 127, 136, 143, 151, 159 };
@ -172,7 +172,7 @@ int xdDigits_Luggerbug13n[11];
int yDigits_Luggerbug13n = 150; int yDigits_Luggerbug13n = 150;
int ydDigits_Luggerbug13n = 13; int ydDigits_Luggerbug13n = 13;
/* /*
* Luggerbug Font - 13 pixels high. * Luggerbug Font - 13 pixels high.
*/ */
int xsDigits_Luggerbug13[11] = { 75, 89, 103, 117, 131, 146, 159, 172, 184, 197, 208 }; int xsDigits_Luggerbug13[11] = { 75, 89, 103, 117, 131, 146, 159, 172, 184, 197, 208 };
@ -181,7 +181,7 @@ int xdDigits_Luggerbug13[11];
int yDigits_Luggerbug13 = 136; int yDigits_Luggerbug13 = 136;
int ydDigits_Luggerbug13 = 13; int ydDigits_Luggerbug13 = 13;
/* /*
* ComicSans Font - 12 pixels high. * ComicSans Font - 12 pixels high.
*/ */
int xsDigits_ComicSans12n[11] = { 338, 349, 359, 370, 380, 390, 401, 411, 422, 432, 444 }; int xsDigits_ComicSans12n[11] = { 338, 349, 359, 370, 380, 390, 401, 411, 422, 432, 444 };
@ -190,7 +190,7 @@ int xdDigits_ComicSans12n[11];
int yDigits_ComicSans12n = 123; int yDigits_ComicSans12n = 123;
int ydDigits_ComicSans12n = 12; int ydDigits_ComicSans12n = 12;
/* /*
* ComicSans Font - 11 pixels high. * ComicSans Font - 11 pixels high.
*/ */
int xsDigits_ComicSans11[11] = { 338, 353, 366, 380, 392, 407, 420, 434, 448, 461, 471 }; int xsDigits_ComicSans11[11] = { 338, 353, 366, 380, 392, 407, 420, 434, 448, 461, 471 };
@ -199,7 +199,7 @@ int xdDigits_ComicSans11[11];
int yDigits_ComicSans11 = 111; int yDigits_ComicSans11 = 111;
int ydDigits_ComicSans11 = 11; int ydDigits_ComicSans11 = 11;
/* /*
* JazzPoster Font Narrow - 12 pixels high. * JazzPoster Font Narrow - 12 pixels high.
*/ */
int xsDigits_JazzPoster12n[11] = { 211, 220, 226, 233, 241, 249, 256, 263, 271, 278, 286 }; int xsDigits_JazzPoster12n[11] = { 211, 220, 226, 233, 241, 249, 256, 263, 271, 278, 286 };
@ -208,7 +208,7 @@ int xdDigits_JazzPoster12n[11];
int yDigits_JazzPoster12n = 122; int yDigits_JazzPoster12n = 122;
int ydDigits_JazzPoster12n = 12; int ydDigits_JazzPoster12n = 12;
/* /*
* JazzPoster Font - 12 pixels high. * JazzPoster Font - 12 pixels high.
*/ */
int xsDigits_JazzPoster12[11] = { 211, 225, 234, 246, 258, 271, 282, 293, 305, 317, 328 }; int xsDigits_JazzPoster12[11] = { 211, 225, 234, 246, 258, 271, 282, 293, 305, 317, 328 };
@ -218,7 +218,7 @@ int yDigits_JazzPoster12 = 109;
int ydDigits_JazzPoster12 = 12; int ydDigits_JazzPoster12 = 12;
/* /*
* Tekton Font - 12 pixels high Narrow (13 pixels high actually). * Tekton Font - 12 pixels high Narrow (13 pixels high actually).
*/ */
int xsDigits_Tekton12n[11] = { 75, 84, 90, 97, 105, 114, 122, 131, 138, 147, 156 }; int xsDigits_Tekton12n[11] = { 75, 84, 90, 97, 105, 114, 122, 131, 138, 147, 156 };
@ -227,7 +227,7 @@ int xdDigits_Tekton12n[11];
int yDigits_Tekton12n = 122; int yDigits_Tekton12n = 122;
int ydDigits_Tekton12n = 13; int ydDigits_Tekton12n = 13;
/* /*
* Tekton Font - 12 pixels high. * Tekton Font - 12 pixels high.
*/ */
int xsDigits_Tekton12[11] = { 75, 89, 98, 111, 124, 137, 150, 164, 176, 191, 205 }; int xsDigits_Tekton12[11] = { 75, 89, 98, 111, 124, 137, 150, 164, 176, 191, 205 };
@ -288,8 +288,8 @@ char BackgroundColor[30] = "#181818";
/* /*
* main * main
*/ */
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
@ -422,12 +422,12 @@ int main(int argc, char *argv[]) {
initXwindow(argc, argv); initXwindow(argc, argv);
if (DisplayDepth <= 8) UseLowColorPixmap = 1; if (DisplayDepth <= 8) UseLowColorPixmap = 1;
@ -440,7 +440,7 @@ int main(int argc, char *argv[]) {
/* /*
* Loop until we die * Loop until we die
*/ */
@ -451,7 +451,7 @@ int main(int argc, char *argv[]) {
/* /*
* Only process every 10th cycle of this loop. We run it faster * Only process every 10th cycle of this loop. We run it faster
* to catch expose events, etc... * to catch expose events, etc...
* *
*/ */
@ -522,7 +522,7 @@ int main(int argc, char *argv[]) {
Flag = (Hours >= 12) ? 1 : 0; Flag = (Hours >= 12) ? 1 : 0;
if (Hours == 0) if (Hours == 0)
Hours = 12; Hours = 12;
else else
Hours = (Hours > 12) ? Hours-12 : Hours; Hours = (Hours > 12) ? Hours-12 : Hours;
} }
@ -552,10 +552,10 @@ int main(int argc, char *argv[]) {
copyXPMArea(5, 110, 54, 15, 5, 5); copyXPMArea(5, 110, 54, 15, 5, 5);
/* /*
* Draw Hours * Draw Hours
*/ */
/* dont show leading zeros */ /* dont show leading zeros */
if (D[0] > -1){ if (D[0] > -1){
digit = D[0]; digit = D[0];
@ -567,14 +567,14 @@ int main(int argc, char *argv[]) {
copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady); copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady);
xoff += (xdDigits[digit]+1); xoff += (xdDigits[digit]+1);
/* /*
* Draw Colon * Draw Colon
*/ */
digit = 10; digit = 10;
copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady); copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady);
xoff += (xdDigits[digit]+1); xoff += (xdDigits[digit]+1);
/* /*
* Draw Minutes * Draw Minutes
*/ */
digit = D[3]; digit = D[3];
@ -587,14 +587,14 @@ int main(int argc, char *argv[]) {
if (ShowSeconds){ if (ShowSeconds){
/* /*
* Draw Colon * Draw Colon
*/ */
digit = 10; digit = 10;
copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady); copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady);
xoff += (xdDigits[digit]+1); xoff += (xdDigits[digit]+1);
/* /*
* Draw Seconds * Draw Seconds
*/ */
digit = D[6]; digit = D[6];
@ -625,7 +625,7 @@ int main(int argc, char *argv[]) {
if (Beep){ if (Beep){
if ((Mins == 0)&&(Secs == 0)&&(OldSecs != Secs)) XBell(display, Volume); if ((Mins == 0)&&(Secs == 0)&&(OldSecs != Secs)) XBell(display, Volume);
OldSecs = Secs; OldSecs = Secs;
} }
@ -642,18 +642,18 @@ int main(int argc, char *argv[]) {
copyXPMArea(5, 70, 54, 35, 5, 24); copyXPMArea(5, 70, 54, 35, 5, 24);
/* /*
* Draw Day of Week and Month * Draw Day of Week and Month
*/ */
wid = xdDayOfWeek[DayOfWeek] + xdMonth[Month] + 1; wid = xdDayOfWeek[DayOfWeek] + xdMonth[Month] + 1;
copyXPMArea(xsDayOfWeek[DayOfWeek], yDayOfWeek, xdDayOfWeek[DayOfWeek], copyXPMArea(xsDayOfWeek[DayOfWeek], yDayOfWeek, xdDayOfWeek[DayOfWeek],
ydMonth, 33-wid/2, 64-24-4-12); ydMonth, 33-wid/2, 64-24-4-12);
copyXPMArea(xsMonth[Month], yMonth, xdMonth[Month], copyXPMArea(xsMonth[Month], yMonth, xdMonth[Month],
ydMonth, 33-wid/2+xdDayOfWeek[DayOfWeek]+1, 64-24-4-12); ydMonth, 33-wid/2+xdDayOfWeek[DayOfWeek]+1, 64-24-4-12);
/* /*
* Draw Day of Month * Draw Day of Month
*/ */
copyXPMArea(xsDayOfMonth[DayOfMonth], yDayOfMonth[DayOfMonth], xdDayOfMonth[DayOfMonth], ydDayOfMonth, 32-xdDayOfMonth2[DayOfMonth]/2, 36); copyXPMArea(xsDayOfMonth[DayOfMonth], yDayOfMonth[DayOfMonth], xdDayOfMonth[DayOfMonth], ydDayOfMonth, 32-xdDayOfMonth2[DayOfMonth]/2, 36);
@ -670,7 +670,7 @@ int main(int argc, char *argv[]) {
} else { } else {
/* /*
* Update the counter. * Update the counter.
*/ */
++n; ++n;
@ -700,7 +700,7 @@ int main(int argc, char *argv[]) {
/* /*
* Process any pending X events. * Process any pending X events.
*/ */
while(XPending(display)){ while(XPending(display)){
@ -721,9 +721,9 @@ int main(int argc, char *argv[]) {
/* /*
* Redraw and wait for next update * Redraw and wait for next update
*/ */
RedrawWindow(); RedrawWindow();
if( HasExecute == 1) { if( HasExecute == 1) {
@ -748,13 +748,13 @@ int main(int argc, char *argv[]) {
/* /*
* ParseCMDLine() * ParseCMDLine()
*/ */
void ParseCMDLine(int argc, char *argv[]) { void ParseCMDLine(int argc, char *argv[]) {
int i; int i;
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-display")){ if (!strcmp(argv[i], "-display")){
@ -857,8 +857,8 @@ int i;
} }
} }
if (!ShowSeconds && !UseArial && !UseJazzPoster if (!ShowSeconds && !UseArial && !UseJazzPoster
&& !UseComicSans && !UseLuggerbug) UseTekton = 1; && !UseComicSans && !UseLuggerbug) UseTekton = 1;

View file

@ -7,8 +7,8 @@
int DblClkDelay; int DblClkDelay;
- int HasExecute = 0; /* controls perf optimization */ - int HasExecute = 0; /* controls perf optimization */
char ExecuteCommand[1024]; char ExecuteCommand[1024];
--- 272,277 ---- --- 272,277 ----
*************** ***************
*** 451,457 **** *** 451,457 ****
@ -16,20 +16,20 @@
* *
*/ */
! if ( HasExecute == 0 || n>10){ ! if ( HasExecute == 0 || n>10){
n = 0; n = 0;
--- 450,456 ---- --- 450,456 ----
* to catch expose events, etc... * to catch expose events, etc...
* *
*/ */
! if (n>10){ ! if (n>10){
n = 0; n = 0;
*************** ***************
*** 722,734 **** *** 722,734 ****
* Redraw and wait for next update * Redraw and wait for next update
*/ */
RedrawWindow(); RedrawWindow();
! if( HasExecute == 1) { ! if( HasExecute == 1) {
@ -39,16 +39,16 @@
! } else { ! } else {
! usleep( 500000L); ! usleep( 500000L);
! } ! }
} }
--- 721,727 ---- --- 721,727 ----
* Redraw and wait for next update * Redraw and wait for next update
*/ */
RedrawWindow(); RedrawWindow();
! usleep(DELAY); ! usleep(DELAY);
} }
*************** ***************
*** 817,823 **** *** 817,823 ****
@ -56,15 +56,15 @@
} }
strcpy(ExecuteCommand, argv[++i]); strcpy(ExecuteCommand, argv[++i]);
- HasExecute = 1; - HasExecute = 1;
} else if (!strcmp(argv[i], "-g")){ } else if (!strcmp(argv[i], "-g")){
--- 810,815 ---- --- 810,815 ----
*************** ***************
*** 975,981 **** *** 975,981 ****
char Command[512]; char Command[512];
- if( HasExecute == 0) return; /* no command specified. Ignore clicks. */ - if( HasExecute == 0) return; /* no command specified. Ignore clicks. */
DblClkDelay = 0; DblClkDelay = 0;
if ((xev->button == Button1) && (xev->type == ButtonPress)){ if ((xev->button == Button1) && (xev->type == ButtonPress)){

View file

@ -1,10 +1,10 @@
/* /*
* xutils.c - A collection of X-windows utilties for creating WindowMAker * xutils.c - A collection of X-windows utilties for creating WindowMAker
* DockApps. * DockApps.
* *
* This file contains alot of the lower-level X windows routines. Origins with wmppp * This file contains alot of the lower-level X windows routines. Origins with wmppp
* (by Martijn Pieterse (pieterse@xs4all.nl)), but its been hacked up quite a bit * (by Martijn Pieterse (pieterse@xs4all.nl)), but its been hacked up quite a bit
* and passed on from one new DockApp to the next. * and passed on from one new DockApp to the next.
* *
* *
* *
@ -27,7 +27,7 @@
* *
* *
* *
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -42,7 +42,7 @@
/* /*
* X11 Variables * X11 Variables
*/ */
int x_fd; int x_fd;
XSizeHints mysizehints; XSizeHints mysizehints;
@ -93,7 +93,7 @@ static int flush_expose(Window w) {
* RedrawWindowXY * RedrawWindowXY
*/ */
void RedrawWindow(void) { void RedrawWindow(void) {
flush_expose(iconwin); flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, 0,0, wmgen.attributes.width, wmgen.attributes.height, 0, 0); XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, 0,0, wmgen.attributes.width, wmgen.attributes.height, 0, 0);
@ -103,7 +103,7 @@ void RedrawWindow(void) {
} }
void RedrawWindowXY(int x, int y) { void RedrawWindowXY(int x, int y) {
flush_expose(iconwin); flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, x,y, wmgen.attributes.width, wmgen.attributes.height, 0, 0); XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, x,y, wmgen.attributes.width, wmgen.attributes.height, 0, 0);
@ -167,7 +167,7 @@ void initXwindow(int argc, char *argv[]){
/* /*
* openXwindow * openXwindow
*/ */
void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits,
int pixmask_width, int pixmask_height) { int pixmask_width, int pixmask_height) {
unsigned int borderwidth = 1; unsigned int borderwidth = 1;
@ -189,9 +189,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
{"Color9", NULL, 0}}; {"Color9", NULL, 0}};
/*
/*
* Create Pixmap * Create Pixmap
*/ */
cols[0].pixel = getColor(BackgroundColor, 1.0000, &red, &grn, &blu); cols[0].pixel = getColor(BackgroundColor, 1.0000, &red, &grn, &blu);
@ -209,9 +209,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
wmgen.attributes.colorsymbols = cols; wmgen.attributes.colorsymbols = cols;
wmgen.attributes.exactColors = False; wmgen.attributes.exactColors = False;
wmgen.attributes.closeness = 40000; wmgen.attributes.closeness = 40000;
wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols
| XpmExactColors | XpmCloseness | XpmSize; | XpmExactColors | XpmCloseness | XpmSize;
if (XpmCreatePixmapFromData(display, Root, pixmap_bytes, if (XpmCreatePixmapFromData(display, Root, pixmap_bytes,
&(wmgen.pixmap), &(wmgen.mask), &(wmgen.attributes)) != XpmSuccess){ &(wmgen.pixmap), &(wmgen.mask), &(wmgen.attributes)) != XpmSuccess){
fprintf(stderr, "Not enough free colorcells.\n"); fprintf(stderr, "Not enough free colorcells.\n");
exit(1); exit(1);
@ -220,8 +220,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
/* /*
* Create a window * Create a window
*/ */
mysizehints.flags = USSize | USPosition; mysizehints.flags = USSize | USPosition;
mysizehints.x = 0; mysizehints.x = 0;
@ -235,19 +235,19 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
mysizehints.width = 64; mysizehints.width = 64;
mysizehints.height = 64; mysizehints.height = 64;
win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y, win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y, iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
/* /*
* Activate hints * Activate hints
*/ */
XSetWMNormalHints(display, win, &mysizehints); XSetWMNormalHints(display, win, &mysizehints);
classHint.res_name = wname; classHint.res_name = wname;
@ -262,11 +262,11 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
* effect. I.e. for some you will need to Grab the focus and then return * effect. I.e. for some you will need to Grab the focus and then return
* it after you are done... * it after you are done...
*/ */
XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask
| PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask
| KeyPressMask | KeyReleaseMask); | KeyPressMask | KeyReleaseMask);
XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask
| PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask
| KeyPressMask | KeyReleaseMask); | KeyPressMask | KeyReleaseMask);
@ -278,8 +278,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
XSetWMName(display, win, &name); XSetWMName(display, win, &name);
/* /*
* Create Graphics Context (GC) for drawing * Create Graphics Context (GC) for drawing
*/ */
gcm = GCForeground | GCBackground | GCGraphicsExposures; gcm = GCForeground | GCBackground | GCGraphicsExposures;
gcv.foreground = fore_pix; gcv.foreground = fore_pix;
@ -325,7 +325,7 @@ unsigned long getColor(char *ColorName, float fac, int *red, int *grn, int *blu)
Color.flags = DoRed | DoGreen | DoBlue; Color.flags = DoRed | DoGreen | DoBlue;
XAllocColor(display, Attributes.colormap, &Color); XAllocColor(display, Attributes.colormap, &Color);
*red = Color.red; *red = Color.red;
*grn = Color.green; *grn = Color.green;
*blu = Color.blue; *blu = Color.blue;

View file

@ -4,7 +4,7 @@
/* /*
* Typedefs * Typedefs
*/ */
typedef struct { typedef struct {
Pixmap pixmap; Pixmap pixmap;
@ -21,7 +21,7 @@ typedef struct {
Display *display; Display *display;
Window Root; Window Root;
Window iconwin, win; Window iconwin, win;
int screen; int screen;
int DisplayDepth; int DisplayDepth;

View file

@ -1,7 +1,7 @@
TODO List TODO List
--------- ---------
- Add in a few more fonts... Graphite would be nice! Or EagleFeather - Add in a few more fonts... Graphite would be nice! Or EagleFeather
(its a Frank Lloyd Wright inspired font)? (its a Frank Lloyd Wright inspired font)?
- Allow fonts to be added externally via some sort of config file... - Allow fonts to be added externally via some sort of config file...
@ -9,17 +9,17 @@ TODO List
- Add alarm clock mode? - Add alarm clock mode?
- graphical Moon-Phase Icon in Calendar section. - graphical Moon-Phase Icon in Calendar section.
- Day numbers in Calendar section. This is something that I would really like myself! - Day numbers in Calendar section. This is something that I would really like myself!
- Allow Changing of fonts/colors for the main Calendar section. - Allow Changing of fonts/colors for the main Calendar section.
- Foreign language support... - Foreign language support...
- Add indicators for Greenwich, sidereal, local sideareal time displays (right now - Add indicators for Greenwich, sidereal, local sideareal time displays (right now
you dont really know what it is displaying just by looking at it)... you dont really know what it is displaying just by looking at it)...

View file

@ -5,5 +5,5 @@ documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting copyright notice and this permission notice appear in supporting
documentation. No representations are made about the suitability of this documentation. No representations are made about the suitability of this
software for any purpose. It is provided "as is" without express or software for any purpose. It is provided "as is" without express or
implied warranty. implied warranty.

View file

@ -1,8 +1,8 @@
CC = gcc CC = gcc
CFLAGS = -O2 -Wall CFLAGS = -O2 -Wall
INCDIR = INCDIR =
DESTDIR= /usr DESTDIR= /usr
LIBDIR = LIBDIR =
LIBS = -lXpm -lX11 -lXext LIBS = -lXpm -lX11 -lXext
OBJS = wmMatrix.o matrix.o xutils.o yarandom.o OBJS = wmMatrix.o matrix.o xutils.o yarandom.o
@ -14,7 +14,7 @@ all: wmMatrix
wmMatrix.o: wmMatrix_master.xpm wmMatrix_mask.xbm wmMatrix.o: wmMatrix_master.xpm wmMatrix_mask.xbm
wmMatrix: $(OBJS) wmMatrix: $(OBJS)
$(CC) $(LDFLAGS) -o wmMatrix $^ $(LIBDIR) $(LIBS) $(CC) $(LDFLAGS) -o wmMatrix $^ $(LIBDIR) $(LIBS)
clean: clean:

View file

@ -2,7 +2,7 @@
/* config.h.in --- xscreensaver, Copyright (c) 1998 Jamie Zawinski. /* config.h.in --- xscreensaver, Copyright (c) 1998 Jamie Zawinski.
* *
* The best way to set these parameters is by running the included `configure' * The best way to set these parameters is by running the included `configure'
* script. That examines your system, and generates `config.h' from * script. That examines your system, and generates `config.h' from
* `config.h.in'. * `config.h.in'.
* *
* If something goes very wrong, you can edit `config.h' directly, but beware * If something goes very wrong, you can edit `config.h' directly, but beware
@ -29,13 +29,13 @@
/* #undef HAVE_XHPDISABLERESET */ /* #undef HAVE_XHPDISABLERESET */
/* First, some background: there are three distinct server extensions which /* First, some background: there are three distinct server extensions which
* are useful to a screen saver program: they are XIDLE, MIT-SCREEN-SAVER, * are useful to a screen saver program: they are XIDLE, MIT-SCREEN-SAVER,
* and SCREEN_SAVER. * and SCREEN_SAVER.
* *
* The XIDLE extension resides in .../contrib/extensions/xidle/ on the X11R5 * The XIDLE extension resides in .../contrib/extensions/xidle/ on the X11R5
* contrib tape. This extension lets the client get accurate idle-time * contrib tape. This extension lets the client get accurate idle-time
* information from the X server in a potentially more reliable way than by * information from the X server in a potentially more reliable way than by
* simply watching for keyboard and mouse activity. However, the XIDLE * simply watching for keyboard and mouse activity. However, the XIDLE
* extension has apparently not been ported to X11R6. * extension has apparently not been ported to X11R6.
* *
* The SCREEN_SAVER extension is found (as far as I know) only in the SGI * The SCREEN_SAVER extension is found (as far as I know) only in the SGI
@ -68,7 +68,7 @@
/* Define this if you have the XIDLE extension installed. If you have the /* Define this if you have the XIDLE extension installed. If you have the
* XIDLE extension, this is recommended. (You have this extension if the * XIDLE extension, this is recommended. (You have this extension if the
* file /usr/include/X11/extensions/xidle.h exists.) Turning on this flag * file /usr/include/X11/extensions/xidle.h exists.) Turning on this flag
* lets XScreenSaver work better with servers which support this extension; * lets XScreenSaver work better with servers which support this extension;
* but it will still work with servers which do not suport it, so it's a good * but it will still work with servers which do not suport it, so it's a good
* idea to compile in support for it if you can. * idea to compile in support for it if you can.
*/ */
@ -147,7 +147,7 @@
*/ */
#define HAVE_GL 1 #define HAVE_GL 1
/* Define this if you have OpenGL, but it's the MesaGL variant. (The /* Define this if you have OpenGL, but it's the MesaGL variant. (The
libraries have different names.) (HAVE_GL should be defined too.) libraries have different names.) (HAVE_GL should be defined too.)
*/ */
/* #undef HAVE_MESA_GL */ /* #undef HAVE_MESA_GL */
@ -190,13 +190,13 @@
/* #undef NO_LOCKING */ /* #undef NO_LOCKING */
/* Define this if you want to use Kerberos authentication to lock/unlock the /* Define this if you want to use Kerberos authentication to lock/unlock the
* screen instead of your local password. This currently uses Kerberos V4, * screen instead of your local password. This currently uses Kerberos V4,
* but a V5 server with V4 compatibility will work. WARNING: DO NOT USE AFS * but a V5 server with V4 compatibility will work. WARNING: DO NOT USE AFS
* string-to-key passwords with this option. This option currently *only* * string-to-key passwords with this option. This option currently *only*
* works with standard Kerberos des_string_to_key. If your password is an * works with standard Kerberos des_string_to_key. If your password is an
* AFS password and not a kerberos password, it will not authenticate * AFS password and not a kerberos password, it will not authenticate
* properly. See the comments in driver/kpasswd.c for more information if you * properly. See the comments in driver/kpasswd.c for more information if you
* need it. * need it.
*/ */
/* #undef HAVE_KERBEROS */ /* #undef HAVE_KERBEROS */
@ -226,8 +226,8 @@
#define HAVE_SHADOW_PASSWD 1 #define HAVE_SHADOW_PASSWD 1
/* Define this if your system is Digital or SCO Unix with so-called ``Enhanced /* Define this if your system is Digital or SCO Unix with so-called ``Enhanced
Security'', that is, the passwords live in /tcb/files/auth/<x>/<xyz> Security'', that is, the passwords live in /tcb/files/auth/<x>/<xyz>
instead of in /etc/passwd, and one reads them with getprpwnam() instead instead of in /etc/passwd, and one reads them with getprpwnam() instead
of getpwnam(). of getpwnam().
*/ */
/* #undef HAVE_ENHANCED_PASSWD */ /* #undef HAVE_ENHANCED_PASSWD */
@ -238,7 +238,7 @@
*/ */
/* #undef HAVE_ADJUNCT_PASSWD */ /* #undef HAVE_ADJUNCT_PASSWD */
/* Define this if you are running HPUX with so-called ``Secure Passwords'' /* Define this if you are running HPUX with so-called ``Secure Passwords''
(if you have /usr/include/hpsecurity.h, you probably have this.) I (if you have /usr/include/hpsecurity.h, you probably have this.) I
haven't tested this one, let me know if it works. haven't tested this one, let me know if it works.
*/ */

View file

@ -1,40 +1,40 @@
#define matrix_width 14 #define matrix_width 14
#define matrix_height 216 #define matrix_height 216
static char matrix_bits[] = { static char matrix_bits[] = {
0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x30, 0xfd, 0x34, 0xeb, 0x2c, 0xef, 0x35, 0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x30, 0xfd, 0x34, 0xeb, 0x2c, 0xef, 0x35,
0xeb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3b, 0xfb, 0x3b, 0xf7, 0x39, 0xeb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3b, 0xfb, 0x3b, 0xf7, 0x39,
0xfb, 0x3b, 0xf7, 0x39, 0xfb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x35, 0xfb, 0x3b, 0xf7, 0x39, 0xfb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x35,
0xeb, 0x38, 0xfb, 0x3d, 0xfb, 0x3b, 0xff, 0x31, 0xeb, 0x32, 0xff, 0x3f, 0xeb, 0x38, 0xfb, 0x3d, 0xfb, 0x3b, 0xff, 0x31, 0xeb, 0x32, 0xff, 0x3f,
0xff, 0x3f, 0xff, 0x31, 0xfb, 0x38, 0xfb, 0x3d, 0xfb, 0x38, 0xff, 0x34, 0xff, 0x3f, 0xff, 0x31, 0xfb, 0x38, 0xfb, 0x3d, 0xfb, 0x38, 0xff, 0x34,
0xeb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d, 0xfb, 0x3b, 0xf7, 0x31, 0xeb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d, 0xfb, 0x3b, 0xf7, 0x31,
0xeb, 0x20, 0xff, 0x39, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3b, 0xf7, 0x31, 0xeb, 0x20, 0xff, 0x39, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3b, 0xf7, 0x31,
0xeb, 0x3b, 0xf7, 0x31, 0xfb, 0x3c, 0xff, 0x35, 0xfb, 0x3b, 0xff, 0x3f, 0xeb, 0x3b, 0xf7, 0x31, 0xfb, 0x3c, 0xff, 0x35, 0xfb, 0x3b, 0xff, 0x3f,
0xff, 0x3b, 0xff, 0x33, 0xeb, 0x33, 0xe7, 0x31, 0xeb, 0x2e, 0xff, 0x35, 0xff, 0x3b, 0xff, 0x33, 0xeb, 0x33, 0xe7, 0x31, 0xeb, 0x2e, 0xff, 0x35,
0xff, 0x3b, 0xff, 0x3f, 0xef, 0x3b, 0xfb, 0x31, 0xfb, 0x3b, 0xf7, 0x3b, 0xff, 0x3b, 0xff, 0x3f, 0xef, 0x3b, 0xfb, 0x31, 0xfb, 0x3b, 0xf7, 0x3b,
0xef, 0x3b, 0xff, 0x37, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x35, 0xef, 0x3b, 0xff, 0x37, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x35,
0xeb, 0x20, 0xe7, 0x31, 0xeb, 0x28, 0xff, 0x35, 0xeb, 0x3b, 0xff, 0x3f, 0xeb, 0x20, 0xe7, 0x31, 0xeb, 0x28, 0xff, 0x35, 0xeb, 0x3b, 0xff, 0x3f,
0xff, 0x3f, 0xff, 0x35, 0xeb, 0x28, 0xfb, 0x35, 0xeb, 0x28, 0xff, 0x39, 0xff, 0x3f, 0xff, 0x35, 0xeb, 0x28, 0xfb, 0x35, 0xeb, 0x28, 0xff, 0x39,
0xef, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xef, 0x3b, 0xff, 0x37, 0xef, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xef, 0x3b, 0xff, 0x37,
0xeb, 0x2e, 0xcd, 0x24, 0xef, 0x2a, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x2e, 0xcd, 0x24, 0xef, 0x2a, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d,
0xfb, 0x3b, 0xff, 0x37, 0xef, 0x2b, 0xff, 0x39, 0xfb, 0x3b, 0xff, 0x3f, 0xfb, 0x3b, 0xff, 0x37, 0xef, 0x2b, 0xff, 0x39, 0xfb, 0x3b, 0xff, 0x3f,
0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x22, 0xfd, 0x36, 0xee, 0x2e, 0xdf, 0x2d, 0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x22, 0xfd, 0x36, 0xee, 0x2e, 0xdf, 0x2d,
0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x38, 0xfb, 0x3a, 0x77, 0x31, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x38, 0xfb, 0x3a, 0x77, 0x31,
0xfb, 0x3b, 0xff, 0x39, 0xfb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d, 0xfb, 0x3b, 0xff, 0x39, 0xfb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d,
0xfb, 0x3b, 0xff, 0x39, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xfb, 0x3b, 0xff, 0x39, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f,
0xff, 0x3f, 0xff, 0x35, 0xeb, 0x28, 0xd7, 0x21, 0xeb, 0x20, 0xff, 0x35, 0xff, 0x3f, 0xff, 0x35, 0xeb, 0x28, 0xd7, 0x21, 0xeb, 0x20, 0xff, 0x35,
0xfb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xeb, 0x32, 0xf7, 0x31, 0xfb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xeb, 0x32, 0xf7, 0x31,
0xeb, 0x2b, 0xff, 0x3f, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x2b, 0xff, 0x3f, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d,
0xeb, 0x3a, 0xf3, 0x30, 0xea, 0x28, 0xff, 0x35, 0xeb, 0x2f, 0xff, 0x3f, 0xeb, 0x3a, 0xf3, 0x30, 0xea, 0x28, 0xff, 0x35, 0xeb, 0x2f, 0xff, 0x3f,
0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x3a, 0xf5, 0x30, 0xeb, 0x28, 0xff, 0x39, 0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x3a, 0xf5, 0x30, 0xeb, 0x28, 0xff, 0x39,
0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x37, 0xef, 0x33, 0xf7, 0x33, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x37, 0xef, 0x33, 0xf7, 0x33,
0xef, 0x2b, 0xef, 0x31, 0xfb, 0x2a, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d, 0xef, 0x2b, 0xef, 0x31, 0xfb, 0x2a, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d,
0xeb, 0x28, 0xf5, 0x30, 0xef, 0x3a, 0xff, 0x35, 0xfb, 0x3f, 0xff, 0x3f, 0xeb, 0x28, 0xf5, 0x30, 0xef, 0x3a, 0xff, 0x35, 0xfb, 0x3f, 0xff, 0x3f,
0xff, 0x3f, 0xff, 0x3f, 0xeb, 0x2a, 0xff, 0x36, 0xef, 0x2a, 0xfd, 0x34, 0xff, 0x3f, 0xff, 0x3f, 0xeb, 0x2a, 0xff, 0x36, 0xef, 0x2a, 0xfd, 0x34,
0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xfd, 0x34, 0xeb, 0x2a, 0xf7, 0x33, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xfd, 0x34, 0xeb, 0x2a, 0xf7, 0x33,
0xef, 0x3b, 0xff, 0x37, 0xff, 0x3f, 0xff, 0x3f, 0xef, 0x2b, 0xff, 0x31, 0xef, 0x3b, 0xff, 0x37, 0xff, 0x3f, 0xff, 0x3f, 0xef, 0x2b, 0xff, 0x31,
0xeb, 0x22, 0xf7, 0x31, 0xef, 0x2b, 0xff, 0x31, 0xff, 0x3b, 0xff, 0x3f, 0xeb, 0x22, 0xf7, 0x31, 0xef, 0x2b, 0xff, 0x31, 0xff, 0x3b, 0xff, 0x3f,
0xfe, 0x3e, 0xff, 0x20, 0xeb, 0x2a, 0xff, 0x3d, 0xff, 0x2a, 0xff, 0x23, 0xfe, 0x3e, 0xff, 0x20, 0xeb, 0x2a, 0xff, 0x3d, 0xff, 0x2a, 0xff, 0x23,
0xef, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x2d, 0xeb, 0x2b, 0xf7, 0x33, 0xef, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x2d, 0xeb, 0x2b, 0xf7, 0x33,
0xeb, 0x28, 0xff, 0x3d, 0xff, 0x3f, 0xff, 0x3f, 0xfe, 0x3e, 0xfd, 0x3c, 0xeb, 0x28, 0xff, 0x3d, 0xff, 0x3f, 0xff, 0x3f, 0xfe, 0x3e, 0xfd, 0x3c,
0xfb, 0x2c, 0xff, 0x35, 0xfb, 0x3b, 0xff, 0x37, 0xff, 0x2f, 0xff, 0x3f, 0xfb, 0x2c, 0xff, 0x35, 0xfb, 0x3b, 0xff, 0x37, 0xff, 0x2f, 0xff, 0x3f,
}; };

View file

@ -5,7 +5,7 @@
* the above copyright notice appear in all copies and that both that * the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting * copyright notice and this permission notice appear in supporting
* documentation. No representations are made about the suitability of this * documentation. No representations are made about the suitability of this
* software for any purpose. It is provided "as is" without express or * software for any purpose. It is provided "as is" without express or
* implied warranty. * implied warranty.
* *
* Matrix -- simulate the text scrolls from the movie "The Matrix". * Matrix -- simulate the text scrolls from the movie "The Matrix".
@ -169,8 +169,8 @@ static void feed_matrix(m_state * state)
int x; int x;
/* /*
* Update according to current feeders. * Update according to current feeders.
*/ */
for (x = 0; x < state->grid_width; x++) { for (x = 0; x < state->grid_width; x++) {

View file

@ -1,4 +1,4 @@
.TH WMMATRIX 1 "September 1999" .TH WMMATRIX 1 "September 1999"
.SH NAME .SH NAME
wmMatrix \- Dockable Matrix Display wmMatrix \- Dockable Matrix Display
.SH SYNOPSIS .SH SYNOPSIS

View file

@ -1,10 +1,10 @@
/* /*
* xutils.c - A collection of X-windows utilties for creating WindowMAker * xutils.c - A collection of X-windows utilties for creating WindowMAker
* DockApps. * DockApps.
* *
* This file contains alot of the lower-level X windows routines. Origins with wmppp * This file contains alot of the lower-level X windows routines. Origins with wmppp
* (by Martijn Pieterse (pieterse@xs4all.nl)), but its been hacked up quite a bit * (by Martijn Pieterse (pieterse@xs4all.nl)), but its been hacked up quite a bit
* and passed on from one new DockApp to the next. * and passed on from one new DockApp to the next.
* *
* *
* *
@ -42,7 +42,7 @@
#include "xutils.h" #include "xutils.h"
/* /*
* X11 Variables * X11 Variables
*/ */
int x_fd; int x_fd;
XSizeHints mysizehints; XSizeHints mysizehints;
@ -168,7 +168,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
{"Color9", NULL, 0} {"Color9", NULL, 0}
}; };
/* /*
* Create Pixmap * Create Pixmap
*/ */
cols[0].pixel = getColor(BackgroundColor, 1.0000, &red, &grn, &blu); cols[0].pixel = getColor(BackgroundColor, 1.0000, &red, &grn, &blu);
@ -192,8 +192,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
exit(1); exit(1);
} }
/* /*
* Create a window * Create a window
*/ */
mysizehints.flags = USSize | USPosition; mysizehints.flags = USSize | USPosition;
mysizehints.x = 0; mysizehints.x = 0;
@ -214,8 +214,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y, iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
/* /*
* Activate hints * Activate hints
*/ */
XSetWMNormalHints(display, win, &mysizehints); XSetWMNormalHints(display, win, &mysizehints);
classHint.res_name = wname; classHint.res_name = wname;
@ -240,8 +240,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
XSetWMName(display, win, &name); XSetWMName(display, win, &name);
/* /*
* Create Graphics Context (GC) for drawing * Create Graphics Context (GC) for drawing
*/ */
gcm = GCForeground | GCBackground | GCGraphicsExposures; gcm = GCForeground | GCBackground | GCGraphicsExposures;
gcv.foreground = fore_pix; gcv.foreground = fore_pix;
@ -249,8 +249,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
gcv.graphics_exposures = 0; gcv.graphics_exposures = 0;
NormalGC = XCreateGC(display, Root, gcm, &gcv); NormalGC = XCreateGC(display, Root, gcm, &gcv);
/* /*
* Create Graphics Context (GC) for erasing * Create Graphics Context (GC) for erasing
*/ */
gcm = GCForeground | GCBackground | GCGraphicsExposures; gcm = GCForeground | GCBackground | GCGraphicsExposures;
gcv.foreground = back_pix; gcv.foreground = back_pix;

View file

@ -2,7 +2,7 @@
#define WMGENERAL_H_INCLUDED #define WMGENERAL_H_INCLUDED
/* /*
* Typedefs * Typedefs
*/ */
typedef struct { typedef struct {
Pixmap pixmap; Pixmap pixmap;

View file

@ -5,7 +5,7 @@
* the above copyright notice appear in all copies and that both that * the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting * copyright notice and this permission notice appear in supporting
* documentation. No representations are made about the suitability of this * documentation. No representations are made about the suitability of this
* software for any purpose. It is provided "as is" without express or * software for any purpose. It is provided "as is" without express or
* implied warranty. * implied warranty.
*/ */

View file

@ -15,7 +15,7 @@
- Improved processing of command line options - unknown options and - Improved processing of command line options - unknown options and
missing parameters are now dealt with missing parameters are now dealt with
- wmSMPmon now properly supports single CPU machines! On a single CPU - wmSMPmon now properly supports single CPU machines! On a single CPU
machine, the CPU load bar is drawn wider and only one graph style is machine, the CPU load bar is drawn wider and only one graph style is
supported. supported.
- man page improved and edited Makefile so man page will get installed as well - man page improved and edited Makefile so man page will get installed as well
@ -29,4 +29,4 @@
2.9.1 2.9.1
- Adapted wmSMPmon to kernel 2.6, using code from top and - Adapted wmSMPmon to kernel 2.6, using code from top and
procps. kernels 2.2, 2.4 and 2.6 are now supported. procps. kernels 2.2, 2.4 and 2.6 are now supported.

View file

@ -1,4 +1,4 @@
#(c)1999-2003 redseb #(c)1999-2003 redseb
# Adapted for wmSMPmon 2.9.x and higher: Thomas Ribbrock # Adapted for wmSMPmon 2.9.x and higher: Thomas Ribbrock
# Change the following two to determine installation location # Change the following two to determine installation location
@ -33,7 +33,7 @@ $(OBJ): %.o : %.c
$(CC) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
clean: clean:
rm -rf $(EXE) rm -rf $(EXE)
rm -rf *.o rm -rf *.o
rm -rf ../wmgeneral/*.o rm -rf ../wmgeneral/*.o

View file

@ -1,16 +1,16 @@
/*###################################################################### /*######################################################################
# # # #
# This file contains some general utility functions for wmSMPmon. # # This file contains some general utility functions for wmSMPmon. #
# # # #
# All of them were taken from the program 'top' from the procps # # All of them were taken from the program 'top' from the procps #
# suite. # # suite. #
# With thanks to the author of top: # # With thanks to the author of top: #
# James C. Warner <warnerjc@worldnet.att.net> # # James C. Warner <warnerjc@worldnet.att.net> #
# # # #
# This file is placed under the conditions of the GNU Library # # This file is placed under the conditions of the GNU Library #
# General Public License, version 2, or any later version. # # General Public License, version 2, or any later version. #
# See file COPYING for information on distribution conditions. # # See file COPYING for information on distribution conditions. #
# # # #
######################################################################*/ ######################################################################*/
#include "standards.h" #include "standards.h"

View file

@ -1,16 +1,16 @@
/*###################################################################### /*######################################################################
# # # #
# This file contains the definitions of the functions that wmSMPmon # # This file contains the definitions of the functions that wmSMPmon #
# uses to determine CPU load, memory and swap information. # # uses to determine CPU load, memory and swap information. #
# All functions should be implemented by any OS dependent module # # All functions should be implemented by any OS dependent module #
# that is added to wmSMPmon. See sysinfo-linux.c as an example. # # that is added to wmSMPmon. See sysinfo-linux.c as an example. #
# # # #
# (c) 2004 Thomas Ribbrock <emgaron@gmx.net> # # (c) 2004 Thomas Ribbrock <emgaron@gmx.net> #
# # # #
# This file is placed under the conditions of the GNU Library # # This file is placed under the conditions of the GNU Library #
# General Public License, version 2, or any later version. # # General Public License, version 2, or any later version. #
# See file COPYING for information on distribution conditions. # # See file COPYING for information on distribution conditions. #
# # # #
######################################################################*/ ######################################################################*/
#ifndef WMSMP_STANDARDS_H #ifndef WMSMP_STANDARDS_H

View file

@ -17,7 +17,7 @@
* Now supports >256 colors * Now supports >256 colors
11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl) 11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl)
* Removed a bug from parse_rcfile. You could * Removed a bug from parse_rcfile. You could
not use "start" in a command if a label was not use "start" in a command if a label was
also start. also start.
* Changed the needed geometry string. * Changed the needed geometry string.
We don't use window size, and don't support We don't use window size, and don't support
@ -177,7 +177,7 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) {
err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap), err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap),
&(wmgen->mask), &(wmgen->attributes)); &(wmgen->mask), &(wmgen->attributes));
if (err != XpmSuccess) { if (err != XpmSuccess) {
fprintf(stderr, "Not enough free colorcells.\n"); fprintf(stderr, "Not enough free colorcells.\n");
exit(1); exit(1);
@ -224,9 +224,9 @@ static int flush_expose(Window w) {
\***************************************************************************/ \***************************************************************************/
void RedrawWindow(void) { void RedrawWindow(void) {
flush_expose(iconwin); flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0); 0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0);
flush_expose(win); flush_expose(win);
XCopyArea(display, wmgen.pixmap, win, NormalGC, XCopyArea(display, wmgen.pixmap, win, NormalGC,
@ -238,9 +238,9 @@ void RedrawWindow(void) {
\***************************************************************************/ \***************************************************************************/
void RedrawWindowXY(int x, int y) { void RedrawWindowXY(int x, int y) {
flush_expose(iconwin); flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0); x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0);
flush_expose(win); flush_expose(win);
XCopyArea(display, wmgen.pixmap, win, NormalGC, XCopyArea(display, wmgen.pixmap, win, NormalGC,

View file

@ -18,7 +18,7 @@ Version Description
-tc <color> -tc <color>
Added code to properly decode wind speed when in MPS. Added code to properly decode wind speed when in MPS.
Fixed bug in beaufort wind speed calcs. Fixed bug in beaufort wind speed calcs.
@ -39,18 +39,18 @@ Version Description
-wgc <color> for setting the Wind Gust color. -wgc <color> for setting the Wind Gust color.
Also cleaned up the pixmap to minimize the number of colors used. Also cleaned up the pixmap to minimize the number of colors used.
Changed metric toggle to work with a key press (any key). Changed metric toggle to work with a key press (any key).
Added double click support. Now double clicking does the following: Added double click support. Now double clicking does the following:
Double Mouse Left: pops up the fully decoded METAR file Double Mouse Left: pops up the fully decoded METAR file
in xmessage. in xmessage.
Double Mouse Middle: Currently undefined. Double Mouse Middle: Currently undefined.
Double Mouse Right: Forces a new update (i.e. download.) Double Mouse Right: Forces a new update (i.e. download.)
@ -64,7 +64,7 @@ Version Description
Also added -mps option to display wind speed in units of Also added -mps option to display wind speed in units of
meters/second (when in -metric mode). meters/second (when in -metric mode).
1.27 - released March 8, 1999. 1.27 - released March 8, 1999.
fixed bug in speed calculation when wind is gusting. fixed bug in speed calculation when wind is gusting.
@ -98,7 +98,7 @@ Version Description
when Celsius is set. (Really should change the flag to -metric). when Celsius is set. (Really should change the flag to -metric).
1.1 - Released Jan. 25, 1999. 1.1 - Released Jan. 25, 1999.
Bug fixes. Bug fixes.
Added Degrees F/C support... Added Degrees F/C support...
Added a bit more info on where to find info on METAR/TAF Added a bit more info on where to find info on METAR/TAF
system... system...

View file

@ -16,7 +16,7 @@ Afterstep users put the following in their .steprc
Note: AfterStep's Wharf has a problem with pixmaps that are Note: AfterStep's Wharf has a problem with pixmaps that are
larger than 60x60 pixels. Please tell the AfterStep authors larger than 60x60 pixels. Please tell the AfterStep authors
to fix this, this is not our fault, but a Wharf problem! to fix this, this is not our fault, but a Wharf problem!
Other window managers. Other window managers.
---------------------- ----------------------

View file

@ -17,8 +17,8 @@ Installation
1) tar -xvf wmWeather-1.29.tar 1) tar -xvf wmWeather-1.29.tar
2) cd wmWeather-1.29/Src/ 2) cd wmWeather-1.29/Src/
3) make clean 3) make clean
4) make 4) make
5) make install (must be root) 5) make install (must be root)
6) wmWeather & (or 'wmWeather -h' for help, or 'man wmWeather' for the man page) 6) wmWeather & (or 'wmWeather -h' for help, or 'man wmWeather' for the man page)
7) You need to set the location of perl correctly in GrabWeather if your perl 7) You need to set the location of perl correctly in GrabWeather if your perl
is located in a place other than /usr/bin/ is located in a place other than /usr/bin/

View file

@ -56,7 +56,7 @@
# #
# Parse HTML File. # Parse HTML File.
# #
$Temp = -999.0; $Temp = -999.0;
$Chill = -999.0; $Chill = -999.0;
@ -82,7 +82,7 @@
# #
# Isolate the Wind groups out of the coded METAR report. # Isolate the Wind groups out of the coded METAR report.
# There may be two groups - the normal one and a variability set. # There may be two groups - the normal one and a variability set.

View file

@ -18,7 +18,7 @@ OBJS = wmWeather.o \
all: wmWeather.o wmWeather all: wmWeather.o wmWeather
wmWeather.o: wmWeather_master.xpm wmWeather_mask.xbm wmWeather.o: wmWeather_master.xpm wmWeather_mask.xbm
wmWeather: $(OBJS) wmWeather: $(OBJS)
$(CC) $(CFLAGS) $(SYSTEM) -o wmWeather $^ $(INCDIR) $(LIBDIR) $(LIBS) $(CC) $(CFLAGS) $(SYSTEM) -o wmWeather $^ $(INCDIR) $(LIBDIR) $(LIBS)
clean: clean:
@ -30,5 +30,5 @@ clean:
install:: wmWeather install:: wmWeather
install -c -s -m 0755 wmWeather $(DESTDIR)/bin install -c -s -m 0755 wmWeather $(DESTDIR)/bin
install -c -m 0755 GrabWeather $(DESTDIR)/bin install -c -m 0755 GrabWeather $(DESTDIR)/bin
install -c -m 0644 wmWeather.1 $(DESTDIR)/man/man1 install -c -m 0644 wmWeather.1 $(DESTDIR)/man/man1

View file

@ -1,4 +1,4 @@
.TH WMWEATHER 1.1 "19 January 1999" .TH WMWEATHER 1.1 "19 January 1999"
.SH NAME .SH NAME
WMWEATHER \- Dockable Weather Monitor WMWEATHER \- Dockable Weather Monitor
.SH SYNOPSIS .SH SYNOPSIS
@ -74,7 +74,7 @@ Set the color of the labels. (E.g. -lc red or -lc salmon or -lc #4523ff).
Set the background color. (#8e8e69 is LCD-ish). Set the background color. (#8e8e69 is LCD-ish).
.TP .TP
.B \-dc <color> .B \-dc <color>
Set the color of the data entries. Set the color of the data entries.
.TP .TP
.B \-tc <color> .B \-tc <color>
Set the color of the station ID/update time header. Set the color of the station ID/update time header.
@ -86,9 +86,9 @@ average speed). Similarly, the wind direction indicator with change to this
color when the wind direction is variable. (The value shown in this case is the color when the wind direction is variable. (The value shown in this case is the
average direction). average direction).
.SH BUGS .SH BUGS
Let me know if/when you find any. Let me know if/when you find any.
.SH NOTES .SH NOTES
Requires that a (fairly recent) version of wget be installed on your machine. Requires that a (fairly recent) version of wget be installed on your machine.
You can download wget from "http://sunsite.auc.dk/wget/". You can download wget from "http://sunsite.auc.dk/wget/".
.SH AUTHOR .SH AUTHOR
Michael G. Henderson <mghenderson@lanl.gov> Michael G. Henderson <mghenderson@lanl.gov>

View file

@ -1,11 +1,11 @@
/* /*
* *
* wmWeather-1.31 (C) 1999 Mike Henderson (mghenderson@lanl.gov) * wmWeather-1.31 (C) 1999 Mike Henderson (mghenderson@lanl.gov)
* *
* - Shows Local Weather conditions * - Shows Local Weather conditions
* *
* *
* *
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -19,7 +19,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the * along with this program (see the file COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA * Boston, MA 02110-1301 USA
* *
* *
@ -29,7 +29,7 @@
* *
* - Add a GTK popup window to display data in a nicer way. Currently just use * - Add a GTK popup window to display data in a nicer way. Currently just use
* xmessage... * xmessage...
* *
* - Add "current conditions" graphic (as background?). I.e. one of those little * - Add "current conditions" graphic (as background?). I.e. one of those little
* cartoons that show clouds or sun with rain or snow, etc. on it... * cartoons that show clouds or sun with rain or snow, etc. on it...
* *
@ -47,7 +47,7 @@
* Fixed a bug whereby the App would crash when trying to gain input * Fixed a bug whereby the App would crash when trying to gain input
* focus under non-WindowMaker WMs (focus is now grabbed by * focus under non-WindowMaker WMs (focus is now grabbed by
* `PointerRoot' not `iconwin'). * `PointerRoot' not `iconwin').
* *
* Added StationID and `time-of-last-update' labels. To do this I needed * Added StationID and `time-of-last-update' labels. To do this I needed
* to shrink the fonts down and scrunch them together a bit more. * to shrink the fonts down and scrunch them together a bit more.
* *
@ -75,11 +75,11 @@
* -wgc <color> for setting the Wind Gust color. * -wgc <color> for setting the Wind Gust color.
* *
* Also cleaned up the pixmap to minimize the number of colors used. * Also cleaned up the pixmap to minimize the number of colors used.
* *
* Changed metric toggle to work with a key press (any key). * Changed metric toggle to work with a key press (any key).
* *
* Added double click support. Now double clicking does the following: * Added double click support. Now double clicking does the following:
* *
* Double Mouse Left: pops up the fully decoded METAR file * Double Mouse Left: pops up the fully decoded METAR file
* in xmessage. * in xmessage.
* *
@ -96,14 +96,14 @@
* Since Windchill is not always available, we only show it if its * Since Windchill is not always available, we only show it if its
* available. If its not, we paste up DewPoint as default. * available. If its not, we paste up DewPoint as default.
* *
* Also added -mps option to display wind speed in units of * Also added -mps option to display wind speed in units of
* meters/second (when in -metric mode). * meters/second (when in -metric mode).
* *
* Version 1.27 - released March 8, 1999. * Version 1.27 - released March 8, 1999.
* fixed bug in speed calculation when wind is gusting. * fixed bug in speed calculation when wind is gusting.
* *
* Version 1.26 - released February 24, 1999. * Version 1.26 - released February 24, 1999.
* Added -delay option. * Added -delay option.
* *
* Version 1.25 - released February 16, 1999. * Version 1.25 - released February 16, 1999.
* Added Wind speeds on the 'Beaufort scale' * Added Wind speeds on the 'Beaufort scale'
@ -145,8 +145,8 @@
/* /*
* Includes * Includes
*/ */
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
@ -162,8 +162,8 @@
/* /*
* Delay between refreshes (in microseconds) * Delay between refreshes (in microseconds)
*/ */
#define DELAY 10000L #define DELAY 10000L
#define WMWEATHER_VERSION "1.31" #define WMWEATHER_VERSION "1.31"
@ -203,7 +203,7 @@ int DblClkDelay;
* We convert to digits in the sequence `NWSE' so we dont have to put all these * We convert to digits in the sequence `NWSE' so we dont have to put all these
* combinations into the pixmap. * combinations into the pixmap.
*/ */
static char *CompassDirection[] = { "0", "003", "03", "303", "3", "323", "23", "223", static char *CompassDirection[] = { "0", "003", "03", "303", "3", "323", "23", "223",
"2", "221", "21", "121", "1", "101", "01", "001"}; "2", "221", "21", "121", "1", "101", "01", "001"};
@ -216,8 +216,8 @@ char StationTimeColor[30] = "#c5a6ff";
/* /*
* main * main
*/ */
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
@ -249,14 +249,14 @@ FILE *fp;
/* /*
* Parse any command line arguments. * Parse any command line arguments.
*/ */
ParseCMDLine(argc, argv); ParseCMDLine(argc, argv);
/* /*
* Do the window opening in 2 stages. After the initXwindow() call, * Do the window opening in 2 stages. After the initXwindow() call,
* we know what the Depth of the Display is. We can then pick an appropriate * we know what the Depth of the Display is. We can then pick an appropriate
@ -264,12 +264,12 @@ FILE *fp;
* better on a low-color 8-bit display. * better on a low-color 8-bit display.
*/ */
initXwindow(argc, argv); initXwindow(argc, argv);
openXwindow(argc, argv, wmWeather_master, wmWeather_mask_bits, wmWeather_mask_width, openXwindow(argc, argv, wmWeather_master, wmWeather_mask_bits, wmWeather_mask_width,
wmWeather_mask_height, BackColor, LabelColor, WindGustColor, DataColor, StationTimeColor); wmWeather_mask_height, BackColor, LabelColor, WindGustColor, DataColor, StationTimeColor);
/* /*
* Loop until we die * Loop until we die
*/ */
@ -290,19 +290,19 @@ FILE *fp;
* Keep track of # of seconds * Keep track of # of seconds
*/ */
if (m > 100){ if (m > 100){
m = 0; m = 0;
++dt1; ++dt1;
++dt2; ++dt2;
++dt3; ++dt3;
} else { } else {
/* /*
* Increment counter * Increment counter
*/ */
++m; ++m;
} }
@ -338,7 +338,7 @@ FILE *fp;
/* /*
* Process any pending X events. * Process any pending X events.
*/ */
while(XPending(display)){ while(XPending(display)){
@ -369,7 +369,7 @@ FILE *fp;
/* /*
@ -380,7 +380,7 @@ FILE *fp;
* may be Up-To-Date! * may be Up-To-Date!
*/ */
if ((dt2 > 5)||(ForceUpdate)){ if ((dt2 > 5)||(ForceUpdate)){
dt2 = 0; dt2 = 0;
/* /*
@ -410,7 +410,7 @@ FILE *fp;
DT = UT - LT; DT = UT - LT;
if (DT > 24.0) DT -= 24.0; if (DT > 24.0) DT -= 24.0;
if (DT < 0.00) DT += 24.0; if (DT < 0.00) DT += 24.0;
/* /*
@ -477,7 +477,7 @@ FILE *fp;
} }
@ -492,7 +492,7 @@ FILE *fp;
dt3 = 0; dt3 = 0;
/* /*
@ -512,7 +512,7 @@ FILE *fp;
chr = (int)StationID[3] - 65; copyXPMArea(chr*5+2, 128, 5, 6, 7+q, 6); q+= 5; chr = (int)StationID[3] - 65; copyXPMArea(chr*5+2, 128, 5, 6, 7+q, 6); q+= 5;
if (UpdateLTHour != 99){ if (UpdateLTHour != 99){
q = 0; q = 0;
Tens = (int)(UpdateLTHour); Tens = (int)(UpdateLTHour);
copyXPMArea(Tens/10*5+2, 135, 5, 6, 36+q, 6); q+= 5; copyXPMArea(Tens/10*5+2, 135, 5, 6, 36+q, 6); q+= 5;
copyXPMArea(Tens%10*5+2, 135, 5, 6, 36+q, 6); q+= 5; copyXPMArea(Tens%10*5+2, 135, 5, 6, 36+q, 6); q+= 5;
@ -575,7 +575,7 @@ FILE *fp;
val = DewPoint; val = DewPoint;
copyXPMArea(5, 87, 17, 8, 5, 24); copyXPMArea(5, 87, 17, 8, 5, 24);
} }
if ((val > -999.0)&&(val < 1000.0)){ if ((val > -999.0)&&(val < 1000.0)){
sgn = (val < 0.0) ? -1.0 : 1.0; sgn = (val < 0.0) ? -1.0 : 1.0;
val *= sgn; val *= sgn;
@ -722,7 +722,7 @@ FILE *fp;
q += 2; q += 2;
} else if (Direction > 0.0){ } else if (Direction > 0.0){
/* /*
* In this case, the wind direction is variable with speed < 6 Knots. * In this case, the wind direction is variable with speed < 6 Knots.
* A numerical direction is not given in these cases. Just write out 'VRB'. * A numerical direction is not given in these cases. Just write out 'VRB'.
*/ */
@ -735,7 +735,7 @@ FILE *fp;
if (Metric && Beaufort) { if (Metric && Beaufort) {
int beau = 0; int beau = 0;
int spd; int spd;
sgn = (Speed < 0.0) ? -1.0 : 1.0; sgn = (Speed < 0.0) ? -1.0 : 1.0;
spd = (int)(sgn * (int)Speed); spd = (int)(sgn * (int)Speed);
if (spd > 1) { beau = 1; } if (spd > 1) { beau = 1; }
@ -828,8 +828,8 @@ UpToDate = 0;
/* /*
* Wait for next update * Wait for next update
*/ */
usleep(DELAY); usleep(DELAY);
@ -849,7 +849,7 @@ void ParseCMDLine(int argc, char *argv[]) {
int i; int i;
void print_usage(); void print_usage();
StationID[0] = '\0'; StationID[0] = '\0';
PressureUnits = 0; PressureUnits = 0;
MetersPerSecond = 0; MetersPerSecond = 0;
@ -907,15 +907,15 @@ void ParseCMDLine(int argc, char *argv[]) {
strcpy(DataColor, argv[++i]); strcpy(DataColor, argv[++i]);
} else if (!strcmp(argv[i], "-beaufort")){ } else if (!strcmp(argv[i], "-beaufort")){
Beaufort = 1; Beaufort = 1;
} else if (!strcmp(argv[i], "-mps")){ } else if (!strcmp(argv[i], "-mps")){
MetersPerSecond = 1; MetersPerSecond = 1;
} else if (!strcmp(argv[i], "-W")){ } else if (!strcmp(argv[i], "-W")){
ShowWindChill = 1; ShowWindChill = 1;
} else if ((!strcmp(argv[i], "-metric"))||(!strcmp(argv[i], "-m"))){ } else if ((!strcmp(argv[i], "-metric"))||(!strcmp(argv[i], "-m"))){
@ -936,7 +936,7 @@ void ParseCMDLine(int argc, char *argv[]) {
PressureUnits = 3; PressureUnits = 3;
PressureConv = 25.4; PressureConv = 25.4;
} else if ((!strcmp(argv[i], "-station"))||(!strcmp(argv[i], "-s"))){ } else if ((!strcmp(argv[i], "-station"))||(!strcmp(argv[i], "-s"))){
if ((i+1 >= argc)||(argv[i+1][0] == '-')) { if ((i+1 >= argc)||(argv[i+1][0] == '-')) {
@ -960,13 +960,13 @@ void ParseCMDLine(int argc, char *argv[]) {
print_usage(); print_usage();
exit(-1); exit(-1);
} }
/* /*
* Convert Time to seconds * Convert Time to seconds
*/ */
UpdateDelay *= 60; UpdateDelay *= 60;
++i; ++i;
} else { } else {
print_usage(); print_usage();
@ -1089,7 +1089,7 @@ double UT;
/* /*
* This routine handles button presses. * This routine handles button presses.
* *
* - Left Mouse single click toggles Deg F/C for temperatures. * - Left Mouse single click toggles Deg F/C for temperatures.
* - Some other click event should display the full METAR report -- lots of * - Some other click event should display the full METAR report -- lots of
@ -1110,7 +1110,7 @@ void ButtonPressEvent(XButtonEvent *xev){
if (GotFirstClick1) GotDoubleClick1 = 1; if (GotFirstClick1) GotDoubleClick1 = 1;
else GotFirstClick1 = 1; else GotFirstClick1 = 1;
} else if ((xev->button == Button2) && (xev->type == ButtonPress)){ } else if ((xev->button == Button2) && (xev->type == ButtonPress)){
if (GotFirstClick2) GotDoubleClick2 = 1; if (GotFirstClick2) GotDoubleClick2 = 1;
else GotFirstClick2 = 1; else GotFirstClick2 = 1;

View file

@ -1,10 +1,10 @@
/* /*
* xutils.c - A collection of X-windows utilties for creating WindowMAker * xutils.c - A collection of X-windows utilties for creating WindowMAker
* DockApps. * DockApps.
* *
* This file contains alot of the lower-level X windows routines. Origins with wmppp * This file contains alot of the lower-level X windows routines. Origins with wmppp
* (by Martijn Pieterse (pieterse@xs4all.nl)), but its been hacked up quite a bit * (by Martijn Pieterse (pieterse@xs4all.nl)), but its been hacked up quite a bit
* and passed on from one new DockApp to the next. * and passed on from one new DockApp to the next.
* *
* *
* *
@ -27,7 +27,7 @@
* *
* *
* *
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -42,7 +42,7 @@
/* /*
* X11 Variables * X11 Variables
*/ */
int x_fd; int x_fd;
XSizeHints mysizehints; XSizeHints mysizehints;
@ -85,7 +85,7 @@ static int flush_expose(Window w) {
* RedrawWindowXY * RedrawWindowXY
*/ */
void RedrawWindow(void) { void RedrawWindow(void) {
flush_expose(iconwin); flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, 0,0, wmgen.attributes.width, wmgen.attributes.height, 0, 0); XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, 0,0, wmgen.attributes.width, wmgen.attributes.height, 0, 0);
@ -95,7 +95,7 @@ void RedrawWindow(void) {
} }
void RedrawWindowXY(int x, int y) { void RedrawWindowXY(int x, int y) {
flush_expose(iconwin); flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, x,y, wmgen.attributes.width, wmgen.attributes.height, 0, 0); XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, x,y, wmgen.attributes.width, wmgen.attributes.height, 0, 0);
@ -159,8 +159,8 @@ void initXwindow(int argc, char *argv[]){
/* /*
* openXwindow * openXwindow
*/ */
void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits,
int pixmask_width, int pixmask_height, char *BackColor, char *LabelColor, int pixmask_width, int pixmask_height, char *BackColor, char *LabelColor,
char *WindGustColor, char *DataColor, char *StationTimeColor) { char *WindGustColor, char *DataColor, char *StationTimeColor) {
unsigned int borderwidth = 1; unsigned int borderwidth = 1;
@ -177,9 +177,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
{"StationTimeColor", NULL, 0} }; {"StationTimeColor", NULL, 0} };
/*
/*
* Create Pixmap * Create Pixmap
*/ */
cols[0].pixel = getColor(BackColor, 1.0); cols[0].pixel = getColor(BackColor, 1.0);
@ -191,9 +191,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
wmgen.attributes.colorsymbols = cols; wmgen.attributes.colorsymbols = cols;
wmgen.attributes.exactColors = False; wmgen.attributes.exactColors = False;
wmgen.attributes.closeness = 40000; wmgen.attributes.closeness = 40000;
wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols
| XpmExactColors | XpmCloseness | XpmSize; | XpmExactColors | XpmCloseness | XpmSize;
if (XpmCreatePixmapFromData(display, Root, pixmap_bytes, if (XpmCreatePixmapFromData(display, Root, pixmap_bytes,
&(wmgen.pixmap), &(wmgen.mask), &(wmgen.attributes)) != XpmSuccess){ &(wmgen.pixmap), &(wmgen.mask), &(wmgen.attributes)) != XpmSuccess){
fprintf(stderr, "Not enough free colorcells.\n"); fprintf(stderr, "Not enough free colorcells.\n");
exit(1); exit(1);
@ -202,8 +202,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
/* /*
* Create a window * Create a window
*/ */
mysizehints.flags = USSize | USPosition; mysizehints.flags = USSize | USPosition;
mysizehints.x = 0; mysizehints.x = 0;
@ -217,19 +217,19 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
mysizehints.width = 64; mysizehints.width = 64;
mysizehints.height = 64; mysizehints.height = 64;
win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y, win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y, iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
/* /*
* Activate hints * Activate hints
*/ */
XSetWMNormalHints(display, win, &mysizehints); XSetWMNormalHints(display, win, &mysizehints);
classHint.res_name = wname; classHint.res_name = wname;
@ -244,11 +244,11 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
* effect. I.e. for some you will need to Grab the focus and then return * effect. I.e. for some you will need to Grab the focus and then return
* it after you are done... * it after you are done...
*/ */
XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask
| PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask
| KeyPressMask | KeyReleaseMask); | KeyPressMask | KeyReleaseMask);
XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask
| PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask
| KeyPressMask | KeyReleaseMask); | KeyPressMask | KeyReleaseMask);
@ -260,8 +260,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
XSetWMName(display, win, &name); XSetWMName(display, win, &name);
/* /*
* Create Graphics Context (GC) for drawing * Create Graphics Context (GC) for drawing
*/ */
gcm = GCForeground | GCBackground | GCGraphicsExposures; gcm = GCForeground | GCBackground | GCGraphicsExposures;
gcv.foreground = fore_pix; gcv.foreground = fore_pix;

View file

@ -4,7 +4,7 @@
/* /*
* Typedefs * Typedefs
*/ */
typedef struct { typedef struct {
Pixmap pixmap; Pixmap pixmap;
@ -21,7 +21,7 @@ typedef struct {
Display *display; Display *display;
Window Root; Window Root;
Window iconwin, win; Window iconwin, win;
int screen; int screen;
int DisplayDepth; int DisplayDepth;

View file

@ -1,5 +1,5 @@
Simon Fowler <simon@himi.org> Simon Fowler <simon@himi.org>
Complete rewriting of the code from wmacpi-1.34. Complete rewriting of the code from wmacpi-1.34.
timecop timecop
timecop@japan.co.jp timecop@japan.co.jp

View file

@ -51,8 +51,8 @@
Thanks, Thanks,
JB. JB.
2008 March 18 2.2rc3 2008 March 18 2.2rc3
Some fixes for the sysfs interface support, supplied by Some fixes for the sysfs interface support, supplied by
jblache@debian.org: jblache@debian.org:
@ -70,7 +70,7 @@
JB. JB.
2008 March 14 2.2rc2 2008 March 14 2.2rc2
Support for the sysfs interface that became mandatory with kernel Support for the sysfs interface that became mandatory with kernel
2.6.24 (patch supplied by jblache@debian.org). 2.6.24 (patch supplied by jblache@debian.org).
@ -78,7 +78,7 @@
A number of graphics fixes also from jblache@debian.org. A number of graphics fixes also from jblache@debian.org.
Removed support for hardware reported critical battery status. Removed support for hardware reported critical battery status.
2007 July 14 2.2rc1 2007 July 14 2.2rc1
Major changes to command line handling and to the way we use Major changes to command line handling and to the way we use
libdockapp, courtesy of Patrice Dumas. This should hopefully fix libdockapp, courtesy of Patrice Dumas. This should hopefully fix
@ -89,7 +89,7 @@
/proc/acpi/info - thanks to Samuel Ortiz. /proc/acpi/info - thanks to Samuel Ortiz.
Fixed a longstanding issue with redrawing - thanks to Vito Fixed a longstanding issue with redrawing - thanks to Vito
Caputo. Caputo.
This version changes a number of command line options (little used This version changes a number of command line options (little used
ones, but they're still incompatible changes) due to the ones, but they're still incompatible changes) due to the
@ -98,7 +98,7 @@
(thanks to libdockapp grabbing -h, -v and -w for itself). Also, (thanks to libdockapp grabbing -h, -v and -w for itself). Also,
long options are now supported for everything in wmacpi (but not long options are now supported for everything in wmacpi (but not
acpi, since it doesn't use libdockapp for command line parsing). acpi, since it doesn't use libdockapp for command line parsing).
2007 January 10 2.2a1 2007 January 10 2.2a1
Added a patch from Patrice Dumas to support newer versions of Added a patch from Patrice Dumas to support newer versions of
libdockapp. libdockapp.
@ -107,20 +107,20 @@
2005 February 2 2.1 2005 February 2 2.1
Finalised libdockapp-0.5.0 port - no changes from 2.1rc1. Finalised libdockapp-0.5.0 port - no changes from 2.1rc1.
2005 Jan 5 2.1rc1 2005 Jan 5 2.1rc1
Typo fix in the manpage. Typo fix in the manpage.
Ported to libdockapp-0.5.0 - all this needed was changing the Ported to libdockapp-0.5.0 - all this needed was changing the
type of the dockapp width and height to unsigned short. type of the dockapp width and height to unsigned short.
2004 October 24 2.0 2004 October 24 2.0
Upped version number to 2.0. Upped version number to 2.0.
Small typo fixes. Small typo fixes.
wmacpi 2.0 goes gold . . . wmacpi 2.0 goes gold . . .
2004 September 28 2.0rc1 2004 September 28 2.0rc1
Added support for switching to capacity mode automatically, on Added support for switching to capacity mode automatically, on
detecting dodgy reports from the battery. detecting dodgy reports from the battery.
@ -131,7 +131,7 @@
Various cleanups. Various cleanups.
Hopefully last release before the final 2.0. Hopefully last release before the final 2.0.
2004 August 18 1.99r7 2004 August 18 1.99r7
Implemented the libdockapp port - this seems to close Debian bug Implemented the libdockapp port - this seems to close Debian bug
#227819, but it hasn't received sufficient testing. #227819, but it hasn't received sufficient testing.
@ -141,17 +141,17 @@
remaining capacity of the battery and notes the time at which it remaining capacity of the battery and notes the time at which it
was sampled, and uses a history of samples to estimate the rate of was sampled, and uses a history of samples to estimate the rate of
drain on the battery. From there it calculates a value for time drain on the battery. From there it calculates a value for time
remaining. remaining.
Also, various cleanups have gone in: Also, various cleanups have gone in:
* a reworking of the scrolling code * a reworking of the scrolling code
* generic battery number support (rather than just * generic battery number support (rather than just
using two pixmaps, one for b1 and one for b2) using two pixmaps, one for b1 and one for b2)
* stopped the battery glyph from blinking when running on AC * stopped the battery glyph from blinking when running on AC
2004 July 19 1.99r6 2004 July 19 1.99r6
Fix for Debian bug #250792 - the parser for the acpi files was Fix for Debian bug #250792 - the parser for the acpi files was
too stupid to deal with error conditions. I've now added some too stupid to deal with error conditions. I've now added some
@ -184,7 +184,7 @@
libdockapp is waiting, but I think that's the only change left libdockapp is waiting, but I think that's the only change left
without more bug repots . . . without more bug repots . . .
2004 April 15 1.99r4 2004 April 15 1.99r4
Collected fixes for various small issues. Collected fixes for various small issues.
@ -202,17 +202,17 @@
I've left the big changes that are needed (like using libdockapp, I've left the big changes that are needed (like using libdockapp,
in the hope that it'll solve the docking problems) until later, so in the hope that it'll solve the docking problems) until later, so
that I can get these smaller fixes out. Hopefully soon . . . that I can get these smaller fixes out. Hopefully soon . . .
2004 January 12 1.99r3 2004 January 12 1.99r3
. . . and a fix for a fix that didn't fix it . . . . . . and a fix for a fix that didn't fix it . . .
2004 January 12 1.99r2 2004 January 12 1.99r2
Some cleanups and bugfixes found by the wonderful Debian users. Some cleanups and bugfixes found by the wonderful Debian users.
It's finally in testing! It's finally in testing!
2003 November 23 1.99 2003 November 23 1.99
Finally claimed the wmacpi name as my own . . . Finally claimed the wmacpi name as my own . . .
Renamed wmacpi-ng and acpi-ng, renamed the header files, fixed up Renamed wmacpi-ng and acpi-ng, renamed the header files, fixed up
the makefile. the makefile.
@ -226,7 +226,7 @@
This is wmacpi 1.99, so that I can have a release packaged and in This is wmacpi 1.99, so that I can have a release packaged and in
Debian before going to 2.0, so that any bugs that are left can be Debian before going to 2.0, so that any bugs that are left can be
found by all the extra users. found by all the extra users.
2003 September 26 0.99 2003 September 26 0.99
Fix the last of the old wmacpi code oddities (specifically, the Fix the last of the old wmacpi code oddities (specifically, the
APMInfo struct, which was a completely inappropriate name given we APMInfo struct, which was a completely inappropriate name given we
@ -237,21 +237,21 @@
more feedback and the like, so I'm going to make this version more feedback and the like, so I'm going to make this version
0.99, preliminary to either wmacpi-ng 1.0 or wmacpi 2.0 (depending 0.99, preliminary to either wmacpi-ng 1.0 or wmacpi 2.0 (depending
which direction I go with that). which direction I go with that).
2003 September 23 0.92 2003 September 23 0.92
Fix a few more bugs, and include an option to allow the user to Fix a few more bugs, and include an option to allow the user to
specify how often to sample the ACPI data - some BIOSes disable specify how often to sample the ACPI data - some BIOSes disable
all interrupts while reading from the battery, which apparently all interrupts while reading from the battery, which apparently
causes some interactivity issues. I have no idea why reading once causes some interactivity issues. I have no idea why reading once
every three seconds (which is our default), but there've been some every three seconds (which is our default), but there've been some
complaints. complaints.
Also fixed acpi-ng to properly handle the -a option. Also fixed acpi-ng to properly handle the -a option.
2003 August 6 0.91 2003 August 6 0.91
Fix a problem I'm seeing with docking the app - if the window name Fix a problem I'm seeing with docking the app - if the window name
is set to "acpi" rather than "apm" it doesn't dock . . . is set to "acpi" rather than "apm" it doesn't dock . . .
2003 July 16 0.90 2003 July 16 0.90
Make the time display show '--:--' instead of '00:00' when the Make the time display show '--:--' instead of '00:00' when the
time remaining is 0 - I think this is reasonable, since it'll only time remaining is 0 - I think this is reasonable, since it'll only
@ -262,7 +262,7 @@
don't lose anything. We also get to handle the (sadly, very don't lose anything. We also get to handle the (sadly, very
common) case where the ACPI subsystem doesn't report sane values common) case where the ACPI subsystem doesn't report sane values
for the things we depend on. for the things we depend on.
2003 July 11 0.50a2 2003 July 11 0.50a2
Make the time display show nothing (as opposed to 00:00) when the Make the time display show nothing (as opposed to 00:00) when the
time remaining is unknown, as requested by Emma Jane Hogbin. time remaining is unknown, as requested by Emma Jane Hogbin.
@ -283,7 +283,7 @@
annoying about. annoying about.
Also, added an acpi-ng manpage. Also, added an acpi-ng manpage.
2003 July 11 0.50a1 2003 July 11 0.50a1
Properly fix the AC adapter issue - it's not much use adding the Properly fix the AC adapter issue - it's not much use adding the
infrastructure and then forgetting to fix the code that uses it. infrastructure and then forgetting to fix the code that uses it.
@ -291,14 +291,14 @@
Fix the time disiplay so that it doesn't try to display values Fix the time disiplay so that it doesn't try to display values
greater than 99:59, since the display area won't fit anything greater than 99:59, since the display area won't fit anything
beyond that. beyond that.
2003 July 10 0.50a 2003 July 10 0.50a
Bugfixes, to handle two problems: the case where something like Bugfixes, to handle two problems: the case where something like
the present rate or some such is "unknown" (reported initially by the present rate or some such is "unknown" (reported initially by
Emma Jane Hogbin, and where the AC adapter is called something Emma Jane Hogbin, and where the AC adapter is called something
other than "AC" (reported by Sebastian Henschel). This an 'a' other than "AC" (reported by Sebastian Henschel). This an 'a'
release because I can't test these myself . . . release because I can't test these myself . . .
2003 July 6 0.50 2003 July 6 0.50
Finally got rid of that annoying button - that space now contains Finally got rid of that annoying button - that space now contains
a 'B 1' or 'B 2' (only those two at present, since I'm too lazy to a 'B 1' or 'B 2' (only those two at present, since I'm too lazy to
@ -307,69 +307,69 @@
batteries . . .) batteries . . .)
A few more code cleanups. A few more code cleanups.
2003 July 1 0.19 2003 July 1 0.19
libacpi cleanups and reworking - we now handle the charging libacpi cleanups and reworking - we now handle the charging
battery case properly, it seems. battery case properly, it seems.
Also, some attempts to make error printing a bit cleaner; still a Also, some attempts to make error printing a bit cleaner; still a
long way to go on that, though . . . long way to go on that, though . . .
2003 June 24 0.15 2003 June 24 0.15
Removed process_plugin_timer(), since it was doing nothing useful Removed process_plugin_timer(), since it was doing nothing useful
at all . . . at all . . .
2003 June 23 0.14 2003 June 23 0.14
Removed libapm.c - wmacpi-ng is specifically for ACPI, with no APM Removed libapm.c - wmacpi-ng is specifically for ACPI, with no APM
support. support.
2003 June 23 0.13 2003 June 23 0.13
Some more code cleanups, designed to move libacpi to more of a Some more code cleanups, designed to move libacpi to more of a
library than something built into wmacpi-ng. This is useful with library than something built into wmacpi-ng. This is useful with
the seperate programs, though at present it's not used much. the seperate programs, though at present it's not used much.
2003 June 21 0.12 2003 June 21 0.12
Added a command line tool, acpi-ng to query battery status from Added a command line tool, acpi-ng to query battery status from
the command line. the command line.
2003 May 30 0.11 2003 May 30 0.11
Implemented multiple battery support, and averaging of the samples Implemented multiple battery support, and averaging of the samples
in an attempt to even out the jumpiness of the timer. in an attempt to even out the jumpiness of the timer.
2003 May 30 0.10 2003 May 30 0.10
More major code cleanups: in particular the handling of the power More major code cleanups: in particular the handling of the power
panel and the message has been cleaned up so that it's actually panel and the message has been cleaned up so that it's actually
sane and clean. sane and clean.
Next step from here is to actually implement handling of multiple Next step from here is to actually implement handling of multiple
batteries, so that if there's a fully charge second battery batteries, so that if there's a fully charge second battery
available it reports the correct time remaining (based on the available it reports the correct time remaining (based on the
present rate of power consumption and the sum of the two battery's present rate of power consumption and the sum of the two battery's
remaining capacities). remaining capacities).
2003 May 29 0.3 2003 May 29 0.3
Some major reworking of the internals, to help fix the handling of Some major reworking of the internals, to help fix the handling of
multiple batteries and such things. multiple batteries and such things.
2003 May 26 0.2a 2003 May 26 0.2a
Code cleanups to fix various problems with corner cases. Code cleanups to fix various problems with corner cases.
2003 May 26 0.2 2003 May 26 0.2
Added support for multiple batteries: I took the simple route of Added support for multiple batteries: I took the simple route of
displaying only one battery per instance - to do more I'd need to displaying only one battery per instance - to do more I'd need to
hack with the display code, and I'm not ready for that yet. hack with the display code, and I'm not ready for that yet.
Added a -m option to specify the battery number to monitor. Added a -m option to specify the battery number to monitor.
2003 May 26 0.1 2003 May 26 0.1
Changed package completely, to support the new ACPI code as of Changed package completely, to support the new ACPI code as of
2.4.21-rc2. 2.4.21-rc2.
Since this code hasn't been touched in more than a year, I figure Since this code hasn't been touched in more than a year, I figure
I might as well have a go at hacking on it . . . I might as well have a go at hacking on it . . .
-- Simon Fowler, <simon@dreamcraft.com.au> -- Simon Fowler, <simon@dreamcraft.com.au>
2002 Feb 17 1.34 2002 Feb 17 1.34
Updated ACPI statistics gathering code for the latest ACPI patch from Updated ACPI statistics gathering code for the latest ACPI patch from
Intel. Now uses/checks for subsystem version 20020214+. Redone the version Intel. Now uses/checks for subsystem version 20020214+. Redone the version
@ -439,13 +439,13 @@
Added support for fucked APM bioses that display stuff wrong. (See Added support for fucked APM bioses that display stuff wrong. (See
README to learn how to enable it. Obviously, it's disabled by default) README to learn how to enable it. Obviously, it's disabled by default)
Reorganized apminfo structure and got rid of redundancy. Reorganized apminfo structure and got rid of redundancy.
Reorganized acquire_apm_info. All APM data is processed there. Reorganized acquire_apm_info. All APM data is processed there.
Fixed display_state to do the Right Thing. Fixed display_state to do the Right Thing.
Fixed red blinking button to actually blink on critical battery, and Fixed red blinking button to actually blink on critical battery, and
to stop when it isn't critical anymore. I don't think it ever worked to stop when it isn't critical anymore. I don't think it ever worked
right in 1.0. right in 1.0.

View file

@ -4,7 +4,7 @@ You can change the default install prefix (/usr/local) by specifying
it in the make install command, eg: make install PREFIX=/usr it in the make install command, eg: make install PREFIX=/usr
To build the command line tool, either uncomment the BUILD_CLI=1 line To build the command line tool, either uncomment the BUILD_CLI=1 line
in the Makefile, or specify BUILD_CLI=1 on the make command line. ie, in the Makefile, or specify BUILD_CLI=1 on the make command line. ie,
make BUILD_CLI=1 make BUILD_CLI=1
make install BUILD_CLI=1 make install BUILD_CLI=1

View file

@ -1,7 +1,7 @@
# set options. pick one, acpi or apm. comment out the other one. don't # set options. pick one, acpi or apm. comment out the other one. don't
# uncomment both, bad things will happen :) # uncomment both, bad things will happen :)
OPT := -O2 OPT := -O2
# uncomment this to build the command line acpi tool # uncomment this to build the command line acpi tool
BUILD_CLI = 1 BUILD_CLI = 1
@ -40,7 +40,7 @@ wmacpi: $(WMOBJ)
$(CC) -o $@ $^ $(LDFLAGS) $(CC) -o $@ $^ $(LDFLAGS)
# for the Debian package, we want to make building the command line tools # for the Debian package, we want to make building the command line tools
# optional. So, we hide all the necessary stuff here . . . # optional. So, we hide all the necessary stuff here . . .
ifdef BUILD_CLI ifdef BUILD_CLI
CLSRC := wmacpi-cli.c libacpi.c CLSRC := wmacpi-cli.c libacpi.c
CLOBJ := $(patsubst %.c,%.o,$(filter %.c,$(CLSRC))) CLOBJ := $(patsubst %.c,%.o,$(filter %.c,$(CLSRC)))
@ -56,7 +56,7 @@ endif
gcc -MM $(CFLAGS) $< > $@ gcc -MM $(CFLAGS) $< > $@
clean: clean:
rm -f TAGS *.o *~ trace *.out *.bb *.bbg rm -f TAGS *.o *~ trace *.out *.bb *.bbg
clean-all: clean clean-all: clean
rm -f *.d $(targets) rm -f *.d $(targets)

View file

@ -7,7 +7,7 @@
2003 November 23 1.99 2003 November 23 1.99
* Expand libacpi to handle everything else under * Expand libacpi to handle everything else under
/proc/acpi. Basically, make it into a full ACPI reporting library. /proc/acpi. Basically, make it into a full ACPI reporting library.
* Make the command line tool a complete replacement for Grahame * Make the command line tool a complete replacement for Grahame
Bowland's acpi tool, so that wmacpi won't conflict with it. Bowland's acpi tool, so that wmacpi won't conflict with it.
@ -20,7 +20,7 @@
2003 June 24 0.14 2003 June 24 0.14
* Still more code cleanups - there's a considerable amount of dumb * Still more code cleanups - there's a considerable amount of dumb
stuff in there still . . . stuff in there still . . .
* Display time left for battery charging. But first make sure that * Display time left for battery charging. But first make sure that
this will actually work with other systems. this will actually work with other systems.

View file

@ -46,7 +46,7 @@ static int read_sysfs_file(char *node, char *prop, char *buf, size_t buflen)
perr("Could not read %s/%s\n", node, prop); perr("Could not read %s/%s\n", node, prop);
return -3; return -3;
} }
buf[ret] = '\0'; buf[ret] = '\0';
return 0; return 0;
@ -61,7 +61,7 @@ static int sysfs_init_batteries(global_t *globals)
char *names[MAXBATT]; char *names[MAXBATT];
char ps_type[16]; char ps_type[16];
int i, j; int i, j;
/* now enumerate batteries */ /* now enumerate batteries */
globals->battery_count = 0; globals->battery_count = 0;
battdir = opendir("/sys/class/power_supply"); battdir = opendir("/sys/class/power_supply");
@ -72,12 +72,12 @@ static int sysfs_init_batteries(global_t *globals)
while ((batt = readdir(battdir))) { while ((batt = readdir(battdir))) {
/* there's a serious problem with this code when there's /* there's a serious problem with this code when there's
* more than one battery: the readdir won't return the * more than one battery: the readdir won't return the
* entries in sorted order, so battery one won't * entries in sorted order, so battery one won't
* necessarily be the first one returned. So, we need * necessarily be the first one returned. So, we need
* to sort them ourselves before adding them to the * to sort them ourselves before adding them to the
* batteries array. */ * batteries array. */
name = batt->d_name; name = batt->d_name;
/* skip ., .. and dotfiles */ /* skip ., .. and dotfiles */
if (name[0] == '.') if (name[0] == '.')
continue; continue;
@ -96,7 +96,7 @@ static int sysfs_init_batteries(global_t *globals)
/* A nice quick insertion sort, ala CLR. */ /* A nice quick insertion sort, ala CLR. */
{ {
char *tmp1, *tmp2; char *tmp1, *tmp2;
for (i = 1; i < globals->battery_count; i++) { for (i = 1; i < globals->battery_count; i++) {
tmp1 = names[i]; tmp1 = names[i];
j = i - 1; j = i - 1;
@ -107,7 +107,7 @@ static int sysfs_init_batteries(global_t *globals)
} }
} }
} }
for (i = 0; i < globals->battery_count; i++) { for (i = 0; i < globals->battery_count; i++) {
snprintf(batteries[i].name, MAX_NAME, "%s", names[i]); snprintf(batteries[i].name, MAX_NAME, "%s", names[i]);
pdebug("battery detected at /sys/class/power_supply/%s\n", batteries[i].name); pdebug("battery detected at /sys/class/power_supply/%s\n", batteries[i].name);
@ -141,7 +141,7 @@ static int procfs_init_batteries(global_t *globals)
char *name; char *name;
char *names[MAXBATT]; char *names[MAXBATT];
int i, j; int i, j;
/* now enumerate batteries */ /* now enumerate batteries */
globals->battery_count = 0; globals->battery_count = 0;
battdir = opendir("/proc/acpi/battery"); battdir = opendir("/proc/acpi/battery");
@ -152,12 +152,12 @@ static int procfs_init_batteries(global_t *globals)
while ((batt = readdir(battdir))) { while ((batt = readdir(battdir))) {
/* there's a serious problem with this code when there's /* there's a serious problem with this code when there's
* more than one battery: the readdir won't return the * more than one battery: the readdir won't return the
* entries in sorted order, so battery one won't * entries in sorted order, so battery one won't
* necessarily be the first one returned. So, we need * necessarily be the first one returned. So, we need
* to sort them ourselves before adding them to the * to sort them ourselves before adding them to the
* batteries array. */ * batteries array. */
name = batt->d_name; name = batt->d_name;
/* skip . and .. */ /* skip . and .. */
if (!strncmp(".", name, 1) || !strncmp("..", name, 2)) if (!strncmp(".", name, 1) || !strncmp("..", name, 2))
continue; continue;
@ -170,7 +170,7 @@ static int procfs_init_batteries(global_t *globals)
/* A nice quick insertion sort, ala CLR. */ /* A nice quick insertion sort, ala CLR. */
{ {
char *tmp1, *tmp2; char *tmp1, *tmp2;
for (i = 1; i < globals->battery_count; i++) { for (i = 1; i < globals->battery_count; i++) {
tmp1 = names[i]; tmp1 = names[i];
j = i - 1; j = i - 1;
@ -181,12 +181,12 @@ static int procfs_init_batteries(global_t *globals)
} }
} }
} }
for (i = 0; i < globals->battery_count; i++) { for (i = 0; i < globals->battery_count; i++) {
snprintf(batteries[i].name, MAX_NAME, "%s", names[i]); snprintf(batteries[i].name, MAX_NAME, "%s", names[i]);
snprintf(batteries[i].info_file, MAX_NAME, snprintf(batteries[i].info_file, MAX_NAME,
"/proc/acpi/battery/%s/info", names[i]); "/proc/acpi/battery/%s/info", names[i]);
snprintf(batteries[i].state_file, MAX_NAME, snprintf(batteries[i].state_file, MAX_NAME,
"/proc/acpi/battery/%s/state", names[i]); "/proc/acpi/battery/%s/state", names[i]);
pdebug("battery detected at %s\n", batteries[i].info_file); pdebug("battery detected at %s\n", batteries[i].info_file);
pinfo("found battery %s\n", names[i]); pinfo("found battery %s\n", names[i]);
@ -196,7 +196,7 @@ static int procfs_init_batteries(global_t *globals)
pdebug("%d batteries detected\n", globals->battery_count); pdebug("%d batteries detected\n", globals->battery_count);
pinfo("libacpi: found %d batter%s\n", globals->battery_count, pinfo("libacpi: found %d batter%s\n", globals->battery_count,
(globals->battery_count == 1) ? "y" : "ies"); (globals->battery_count == 1) ? "y" : "ies");
return 0; return 0;
} }
@ -263,7 +263,7 @@ static int sysfs_init_ac_adapters(global_t *globals)
/* we'll just use the first adapter we find ... */ /* we'll just use the first adapter we find ... */
ap->name = strdup(name); ap->name = strdup(name);
pinfo("libacpi: found ac adapter %s\n", ap->name); pinfo("libacpi: found ac adapter %s\n", ap->name);
return 0; return 0;
} }
@ -298,7 +298,7 @@ static int procfs_init_ac_adapters(global_t *globals)
snprintf(ap->state_file, MAX_NAME, "/proc/acpi/ac_adapter/%s/state", snprintf(ap->state_file, MAX_NAME, "/proc/acpi/ac_adapter/%s/state",
ap->name); ap->name);
pinfo("libacpi: found ac adapter %s\n", ap->name); pinfo("libacpi: found ac adapter %s\n", ap->name);
return 0; return 0;
} }
@ -374,7 +374,7 @@ int power_reinit(global_t *globals)
return 1; return 1;
} }
} }
if (!(retval = reinit_batteries(globals))) if (!(retval = reinit_batteries(globals)))
retval = reinit_ac_adapters(globals); retval = reinit_ac_adapters(globals);
@ -424,7 +424,7 @@ static power_state_t procfs_get_power_status(global_t *globals)
char buf[1024]; char buf[1024];
char *val; char *val;
adapter_t *ap = &globals->adapter; adapter_t *ap = &globals->adapter;
if ((file = fopen(ap->state_file, "r")) == NULL) { if ((file = fopen(ap->state_file, "r")) == NULL) {
snprintf(buf, 1024, "Could not open state file %s", ap->state_file); snprintf(buf, 1024, "Could not open state file %s", ap->state_file);
perror(buf); perror(buf);
@ -531,7 +531,7 @@ static int sysfs_get_battery_info(global_t *globals, int batt_no)
info->charge_state = FULL; /* DISCHARGE ? as per old comment ... */ info->charge_state = FULL; /* DISCHARGE ? as per old comment ... */
} }
/* get current rate of burn /* get current rate of burn
* note that if it's on AC, this will report 0 */ * note that if it's on AC, this will report 0 */
if (read_sysfs_file(info->name, "current_now", buf, sizeof(buf)) < 0) if (read_sysfs_file(info->name, "current_now", buf, sizeof(buf)) < 0)
info->present_rate = -1; info->present_rate = -1;
@ -590,7 +590,7 @@ static int procfs_get_battery_info(global_t *globals, int batt_no)
perror(NULL); perror(NULL);
return 0; return 0;
} }
/* grab the contents of the file */ /* grab the contents of the file */
buflen = fread(buf, sizeof(buf), 1, file); buflen = fread(buf, sizeof(buf), 1, file);
fclose(file); fclose(file);
@ -612,13 +612,13 @@ static int procfs_get_battery_info(global_t *globals, int batt_no)
info->present = 0; info->present = 0;
return 0; return 0;
} }
/* get design capacity /* get design capacity
* note that all these integer values can also contain the * note that all these integer values can also contain the
* string 'unknown', so we need to check for this. */ * string 'unknown', so we need to check for this. */
entry = strstr(buf, "design capacity:"); entry = strstr(buf, "design capacity:");
val = get_value(entry); val = get_value(entry);
if (val[0] == 'u') if (val[0] == 'u')
info->design_cap = -1; info->design_cap = -1;
else else
info->design_cap = strtoul(val, NULL, 10); info->design_cap = strtoul(val, NULL, 10);
@ -639,13 +639,13 @@ static int procfs_get_battery_info(global_t *globals, int batt_no)
else else
info->design_voltage = strtoul(val, NULL, 10); info->design_voltage = strtoul(val, NULL, 10);
if ((file = fopen(info->state_file, "r")) == NULL) { if ((file = fopen(info->state_file, "r")) == NULL) {
perr("Could not open %s:", info->state_file ); perr("Could not open %s:", info->state_file );
perror(NULL); perror(NULL);
return 0; return 0;
} }
/* grab the file contents */ /* grab the file contents */
memset(buf, 0, sizeof(buf)); memset(buf, 0, sizeof(buf));
buflen = fread(buf, sizeof(buf), 1, file); buflen = fread(buf, sizeof(buf), 1, file);
@ -671,7 +671,7 @@ static int procfs_get_battery_info(global_t *globals, int batt_no)
/* get charging state */ /* get charging state */
entry = strstr(buf, "charging state:"); entry = strstr(buf, "charging state:");
val = get_value(entry); val = get_value(entry);
if (val[0] == 'u') if (val[0] == 'u')
info->charge_state = CH_ERR; info->charge_state = CH_ERR;
else if ((strncmp(val, "discharging", 10)) == 0) else if ((strncmp(val, "discharging", 10)) == 0)
info->charge_state = DISCHARGE; info->charge_state = DISCHARGE;
@ -684,7 +684,7 @@ static int procfs_get_battery_info(global_t *globals, int batt_no)
else else
info->charge_state = CHARGE; info->charge_state = CHARGE;
/* get current rate of burn /* get current rate of burn
* note that if it's on AC, this will report 0 */ * note that if it's on AC, this will report 0 */
entry = strstr(buf, "present rate:"); entry = strstr(buf, "present rate:");
val = get_value(entry); val = get_value(entry);
@ -728,12 +728,12 @@ int get_battery_info(global_t *globals, int batt_no)
* 2003-7-1. * 2003-7-1.
* In order to make this code more convenient for things other than * In order to make this code more convenient for things other than
* just plain old wmacpi-ng I'm breaking the basic functionality * just plain old wmacpi-ng I'm breaking the basic functionality
* up into several chunks: collecting and collating info for a * up into several chunks: collecting and collating info for a
* single battery, calculating the global info (such as rtime), and * single battery, calculating the global info (such as rtime), and
* some stuff to provide a similar interface to now. * some stuff to provide a similar interface to now.
*/ */
/* calculate the percentage remaining, using the values of /* calculate the percentage remaining, using the values of
* remaining capacity and last full capacity, as outlined in * remaining capacity and last full capacity, as outlined in
* the ACPI spec v2.0a, section 3.9.3. */ * the ACPI spec v2.0a, section 3.9.3. */
static int calc_remaining_percentage(int batt) static int calc_remaining_percentage(int batt)
@ -741,7 +741,7 @@ static int calc_remaining_percentage(int batt)
float rcap, lfcap; float rcap, lfcap;
battery_t *binfo; battery_t *binfo;
int retval; int retval;
binfo = &batteries[batt]; binfo = &batteries[batt];
rcap = (float)binfo->remaining_cap; rcap = (float)binfo->remaining_cap;
@ -796,8 +796,8 @@ static enum rtime_mode check_rt_mode(global_t *globals)
} }
/* calculate remaining time until the battery is charged. /* calculate remaining time until the battery is charged.
* when charging, the battery state file reports the * when charging, the battery state file reports the
* current being used to charge the battery. We can use * current being used to charge the battery. We can use
* this and the remaining capacity to work out how long * this and the remaining capacity to work out how long
* until it reaches the last full capacity of the battery. * until it reaches the last full capacity of the battery.
* XXX: make sure this is actually portable . . . */ * XXX: make sure this is actually portable . . . */
@ -816,7 +816,7 @@ static int calc_charge_time_rate(int batt)
} else { } else {
lfcap = (float)binfo->last_full_cap; lfcap = (float)binfo->last_full_cap;
rcap = (float)binfo->remaining_cap; rcap = (float)binfo->remaining_cap;
charge_time = (int)(((lfcap - rcap)/binfo->present_rate) * 60.0); charge_time = (int)(((lfcap - rcap)/binfo->present_rate) * 60.0);
} }
} else } else
@ -826,7 +826,7 @@ static int calc_charge_time_rate(int batt)
} }
/* we need to calculate the present rate the same way we do in rt_cap /* we need to calculate the present rate the same way we do in rt_cap
* mode, and then use that to estimate charge time. This will * mode, and then use that to estimate charge time. This will
* necessarily be even less accurate than it is for remaining time, but * necessarily be even less accurate than it is for remaining time, but
* it's just as neessary . . . */ * it's just as neessary . . . */
static int calc_charge_time_cap(int batt) static int calc_charge_time_cap(int batt)
@ -841,7 +841,7 @@ static int calc_charge_time_cap(int batt)
float cdiff; float cdiff;
float current_rate; float current_rate;
battery_t *binfo = &batteries[batt]; battery_t *binfo = &batteries[batt];
cap_samples[current] = (float) binfo->remaining_cap; cap_samples[current] = (float) binfo->remaining_cap;
time_samples[current] = time(NULL); time_samples[current] = time(NULL);
@ -863,7 +863,7 @@ static int calc_charge_time_cap(int batt)
tdiff = time_samples[current] - time_samples[old]; tdiff = time_samples[current] - time_samples[old];
current_rate = cdiff/(float)tdiff; current_rate = cdiff/(float)tdiff;
} }
if (current_rate == 0) if (current_rate == 0)
rtime = 0; rtime = 0;
else { else {
float cap_left = (float)(binfo->last_full_cap - binfo->remaining_cap); float cap_left = (float)(binfo->last_full_cap - binfo->remaining_cap);
@ -900,11 +900,11 @@ void acquire_batt_info(global_t *globals, int batt)
{ {
battery_t *binfo; battery_t *binfo;
adapter_t *ap = &globals->adapter; adapter_t *ap = &globals->adapter;
get_battery_info(globals, batt); get_battery_info(globals, batt);
binfo = &batteries[batt]; binfo = &batteries[batt];
if (!binfo->present) { if (!binfo->present) {
binfo->percentage = 0; binfo->percentage = 0;
binfo->valid = 0; binfo->valid = 0;
@ -915,21 +915,21 @@ void acquire_batt_info(global_t *globals, int batt)
binfo->percentage = calc_remaining_percentage(batt); binfo->percentage = calc_remaining_percentage(batt);
/* set the battery's capacity state, based (at present) on some /* set the battery's capacity state, based (at present) on some
* guesstimated values: more than 75% == HIGH, 25% to 75% MED, and * guesstimated values: more than 75% == HIGH, 25% to 75% MED, and
* less than 25% is LOW. Less than globals->crit_level is CRIT. */ * less than 25% is LOW. Less than globals->crit_level is CRIT. */
if (binfo->percentage == -1) if (binfo->percentage == -1)
binfo->state = BS_ERR; binfo->state = BS_ERR;
if (binfo->percentage < globals->crit_level) if (binfo->percentage < globals->crit_level)
binfo->state = CRIT; binfo->state = CRIT;
else if (binfo->percentage > 75) else if (binfo->percentage > 75)
binfo->state = HIGH; binfo->state = HIGH;
else if (binfo->percentage > 25) else if (binfo->percentage > 25)
binfo->state = MED; binfo->state = MED;
else else
binfo->state = LOW; binfo->state = LOW;
/* we need to /know/ that we've got a valid state for the /* we need to /know/ that we've got a valid state for the
* globals->power value . . . .*/ * globals->power value . . . .*/
ap->power = get_power_status(globals); ap->power = get_power_status(globals);
@ -939,11 +939,11 @@ void acquire_batt_info(global_t *globals, int batt)
* that it's now valid . . .*/ * that it's now valid . . .*/
binfo->valid = 1; binfo->valid = 1;
} }
void acquire_all_batt_info(global_t *globals) void acquire_all_batt_info(global_t *globals)
{ {
int i; int i;
for(i = 0; i < globals->battery_count; i++) for(i = 0; i < globals->battery_count; i++)
acquire_batt_info(globals, i); acquire_batt_info(globals, i);
} }
@ -961,7 +961,7 @@ void acquire_all_batt_info(global_t *globals)
* So, what we need to do is provide a way to use a different method * So, what we need to do is provide a way to use a different method
* to calculate the time remaining. What seems most sensible is to * to calculate the time remaining. What seems most sensible is to
* split out the code to calculate it into a seperate function, and * split out the code to calculate it into a seperate function, and
* then provide multiple implementations . . . * then provide multiple implementations . . .
*/ */
/* /*
@ -980,12 +980,12 @@ int calc_time_remaining_rate(global_t *globals)
static int j = 0; static int j = 0;
static int n = 0; static int n = 0;
/* calculate the time remaining, using the battery's remaining /* calculate the time remaining, using the battery's remaining
* capacity and the reported burn rate (3.9.3). * capacity and the reported burn rate (3.9.3).
* For added accuracy, we average the value over the last * For added accuracy, we average the value over the last
* SAMPLES number of calls, or for anything less than this we * SAMPLES number of calls, or for anything less than this we
* simply report the raw number. */ * simply report the raw number. */
/* XXX: this needs to correctly handle the case where /* XXX: this needs to correctly handle the case where
* any of the values used is unknown (which we flag using * any of the values used is unknown (which we flag using
* -1). */ * -1). */
for (i = 0; i < globals->battery_count; i++) { for (i = 0; i < globals->battery_count; i++) {
@ -999,16 +999,16 @@ int calc_time_remaining_rate(global_t *globals)
j++, sample_count++; j++, sample_count++;
if (j >= SAMPLES) if (j >= SAMPLES)
j = 0; j = 0;
/* for the first SAMPLES number of calls we calculate the /* for the first SAMPLES number of calls we calculate the
* average based on sample_count, then we use SAMPLES to * average based on sample_count, then we use SAMPLES to
* calculate the rolling average. */ * calculate the rolling average. */
/* when this fails, n should be equal to SAMPLES. */ /* when this fails, n should be equal to SAMPLES. */
if (sample_count < SAMPLES) if (sample_count < SAMPLES)
n++; n++;
for (i = 0, rate = 0; i < n; i++) { for (i = 0, rate = 0; i < n; i++) {
/* if any of our samples are invalid, we drop /* if any of our samples are invalid, we drop
* straight out, and flag our unknown values. */ * straight out, and flag our unknown values. */
if (rate_samples[i] < 0) { if (rate_samples[i] < 0) {
rate = -1; rate = -1;
@ -1018,16 +1018,16 @@ int calc_time_remaining_rate(global_t *globals)
rate += rate_samples[i]; rate += rate_samples[i];
} }
rate = rate/(float)n; rate = rate/(float)n;
if ((rcap < 1) || (rate < 1)) { if ((rcap < 1) || (rate < 1)) {
rtime = 0; rtime = 0;
goto out; goto out;
} }
if (rate <= 0) if (rate <= 0)
rate = 1; rate = 1;
/* time remaining in minutes */ /* time remaining in minutes */
rtime = (int)((rcap/rate) * 60.0); rtime = (int)((rcap/rate) * 60.0);
if(rtime <= 0) if(rtime <= 0)
rtime = 0; rtime = 0;
out: out:
pdebug("discharge time rem: %d\n", rtime); pdebug("discharge time rem: %d\n", rtime);
@ -1044,11 +1044,11 @@ int calc_time_remaining_rate(global_t *globals)
* precision instruments - mine only report with about 70mAH * precision instruments - mine only report with about 70mAH
* resolution, so they don't report any changes until the difference * resolution, so they don't report any changes until the difference
* is 70mAH. This means that calculating the current rate from the * is 70mAH. This means that calculating the current rate from the
* remaining capacity is very choppy . . . * remaining capacity is very choppy . . .
* *
* To fix this, we should calculate an average over some number of * To fix this, we should calculate an average over some number of
* samples at the old end of the set - this would smooth out the * samples at the old end of the set - this would smooth out the
* transitions. * transitions.
*/ */
int calc_time_remaining_cap(global_t *globals) int calc_time_remaining_cap(global_t *globals)
{ {
@ -1091,7 +1091,7 @@ int calc_time_remaining_cap(global_t *globals)
tdiff = time_samples[current] - time_samples[old]; tdiff = time_samples[current] - time_samples[old];
current_rate = cdiff/tdiff; current_rate = cdiff/tdiff;
} }
if (current_rate == 0) if (current_rate == 0)
rtime = 0; rtime = 0;
else else
rtime = (int)(cap_samples[current]/(current_rate * 60.0)); rtime = (int)(cap_samples[current]/(current_rate * 60.0));
@ -1104,7 +1104,7 @@ int calc_time_remaining_cap(global_t *globals)
pdebug("cap discharge time rem: %d\n", rtime); pdebug("cap discharge time rem: %d\n", rtime);
return rtime; return rtime;
} }
void acquire_global_info(global_t *globals) void acquire_global_info(global_t *globals)
{ {

View file

@ -20,7 +20,7 @@ typedef enum {
BATT, BATT,
PS_ERR, PS_ERR,
} power_state_t; } power_state_t;
typedef enum { typedef enum {
HIGH, HIGH,
MED, MED,
@ -52,7 +52,7 @@ typedef struct {
char state_file[MAX_NAME]; char state_file[MAX_NAME];
/* sysfs capacity mode */ /* sysfs capacity mode */
sysfs_capa_t sysfs_capa_mode; sysfs_capa_t sysfs_capa_mode;
int present; int present;
int design_cap; /* assuming mAh */ int design_cap; /* assuming mAh */
int last_full_cap; int last_full_cap;
int design_voltage; /* in mV */ int design_voltage; /* in mV */
@ -68,9 +68,9 @@ typedef struct {
/* and a flag to indicate that this is valid . . . */ /* and a flag to indicate that this is valid . . . */
int valid; int valid;
/* number of times we've gotten bad info on this battery's present rate */ /* number of times we've gotten bad info on this battery's present rate */
int bad_count; int bad_count;
} battery_t; } battery_t;
typedef struct { typedef struct {
char *name; char *name;
char state_file[MAX_NAME]; char state_file[MAX_NAME];
@ -96,11 +96,11 @@ typedef struct {
/* /*
* Moving percentage to the battery is right, but I think we need a global * Moving percentage to the battery is right, but I think we need a global
* remaining capacity somewhere, too . . . * remaining capacity somewhere, too . . .
*/ */
/* /*
* To provide a convenient debugging function . . . * To provide a convenient debugging function . . .
* *
* It's a macro because I'm too lazy to deal with varargs. * It's a macro because I'm too lazy to deal with varargs.
*/ */
@ -125,7 +125,7 @@ typedef struct {
#define pfatal(fmt, arg...) \ #define pfatal(fmt, arg...) \
fprintf(stderr, fmt, ##arg) \ fprintf(stderr, fmt, ##arg) \
/* Since these /are/ needed here . . . */ /* Since these /are/ needed here . . . */
battery_t batteries[MAXBATT]; battery_t batteries[MAXBATT];

View file

@ -4,7 +4,7 @@
* Written by Simon Fowler <simon@dreamcraft.com.au>, 2003-06-20. * Written by Simon Fowler <simon@dreamcraft.com.au>, 2003-06-20.
* Copyright 2003-06-20 Dreamcraft Pty Ltd. * Copyright 2003-06-20 Dreamcraft Pty Ltd.
* *
* This file is distributed under the GNU General Public License, * This file is distributed under the GNU General Public License,
* version 2. Please see the COPYING file for details. * version 2. Please see the COPYING file for details.
*/ */
@ -95,7 +95,7 @@ int main(int argc, char *argv[])
acquire_global_info(globals); acquire_global_info(globals);
usleep(sleep_time); usleep(sleep_time);
} }
ap = &globals->adapter; ap = &globals->adapter;
if(ap->power == AC) { if(ap->power == AC) {
printf("On AC Power"); printf("On AC Power");
@ -104,8 +104,8 @@ int main(int argc, char *argv[])
if(binfo->present && (binfo->charge_state == CHARGE)) { if(binfo->present && (binfo->charge_state == CHARGE)) {
printf("; Battery %s charging", binfo->name); printf("; Battery %s charging", binfo->name);
printf(", currently at %2d%%", binfo->percentage); printf(", currently at %2d%%", binfo->percentage);
if(binfo->charge_time >= 0) if(binfo->charge_time >= 0)
printf(", %2d:%02d remaining", printf(", %2d:%02d remaining",
binfo->charge_time/60, binfo->charge_time/60,
binfo->charge_time%60); binfo->charge_time%60);
} }
@ -120,7 +120,7 @@ int main(int argc, char *argv[])
binfo->percentage); binfo->percentage);
} }
if(globals->rtime >= 0) if(globals->rtime >= 0)
printf("; %d:%02d remaining", globals->rtime/60, printf("; %d:%02d remaining", globals->rtime/60,
globals->rtime%60); globals->rtime%60);
printf("\n"); printf("\n");
} }

View file

@ -99,7 +99,7 @@ Set the rate at which to sample the ACPI data, in number of times per
minute. Minimum is 1, ie once a minute, default is 20, maximum is 600. minute. Minimum is 1, ie once a minute, default is 20, maximum is 600.
.TP .TP
.B \-n, --no-blink .B \-n, --no-blink
Disable blinking power glyph when charging. Note that it still blinks when Disable blinking power glyph when charging. Note that it still blinks when
the battery reports its capacity state as critical. the battery reports its capacity state as critical.
.TP .TP
.B \-f, --force-capacity-mode .B \-f, --force-capacity-mode
@ -114,7 +114,7 @@ works around certain buggy ACPI BIOSes that fail to report the current
rate. rate.
.TP .TP
.B \-x, --cmdline .B \-x, --cmdline
Run wmacpi in command line mode - this operates identically to Run wmacpi in command line mode - this operates identically to
.B wmacpi-cli\&. .B wmacpi-cli\&.
.TP .TP
.B \-a, --samples=samples .B \-a, --samples=samples
@ -122,8 +122,8 @@ Average the time remaining over num samples. This greatly improves the
accuracy of the reported time remaining. accuracy of the reported time remaining.
.TP .TP
.B \-V, --verbosity=num .B \-V, --verbosity=num
Increase the verbosity of the program. Setting this to 1 will print extra Increase the verbosity of the program. Setting this to 1 will print extra
error information; 2 will produce informational output; 3 will produce error information; 2 will produce informational output; 3 will produce
copious debugging output. copious debugging output.
.TP .TP
.B \-v, --version .B \-v, --version
@ -143,7 +143,7 @@ accuracy of the reported time remaining.
.TP .TP
.B \-V .B \-V
Increase the verbosity of the program. If repeated, the result is the Increase the verbosity of the program. If repeated, the result is the
same as setting same as setting
.B \--verbosity .B \--verbosity
for for
.B wmacpi .B wmacpi
@ -161,6 +161,6 @@ completely rewritten after 1.34 by Simon Fowler <simon@himi.org>.
.PP .PP
This manual page was originally written by Simon Richter This manual page was originally written by Simon Richter
<sjr@debian.org> for the Debian GNU/Linux system, and then updated by <sjr@debian.org> for the Debian GNU/Linux system, and then updated by
Simon Fowler. Simon Fowler.
.br .br
Last modification by Simon Fowler <simon@himi.org>, 2007-07-13. Last modification by Simon Fowler <simon@himi.org>, 2007-07-13.

View file

@ -80,11 +80,11 @@ struct dockapp *dockapp;
int scroll_reset = DEFAULT_SCROLL_RESET; int scroll_reset = DEFAULT_SCROLL_RESET;
/* copy a chunk of pixmap around the app */ /* copy a chunk of pixmap around the app */
static void copy_xpm_area(int x, int y, int w, int h, int dx, int dy) static void copy_xpm_area(int x, int y, int w, int h, int dx, int dy)
{ {
XCopyArea(DADisplay, dockapp->pixmap, dockapp->pixmap, XCopyArea(DADisplay, dockapp->pixmap, dockapp->pixmap,
DAGC, x, y, w, h, dx, dy); DAGC, x, y, w, h, dx, dy);
dockapp->update = 1; dockapp->update = 1;
} }
/* display AC power symbol */ /* display AC power symbol */
@ -156,7 +156,7 @@ static void new_window(char *display, char *name, int argc, char **argv)
StructureNotifyMask); StructureNotifyMask);
/* create the main pixmap . . . */ /* create the main pixmap . . . */
DAMakePixmapFromData(master_xpm, &dockapp->pixmap, &dockapp->mask, DAMakePixmapFromData(master_xpm, &dockapp->pixmap, &dockapp->mask,
&dockapp->width, &dockapp->height); &dockapp->width, &dockapp->height);
DASetPixmap(dockapp->pixmap); DASetPixmap(dockapp->pixmap);
DASetShape(dockapp->mask); DASetShape(dockapp->mask);
@ -181,7 +181,7 @@ static void new_window(char *display, char *name, int argc, char **argv)
hints->max_height = 64; hints->max_height = 64;
XSetWMNormalHints(dockapp->display, dockapp->win, hints); XSetWMNormalHints(dockapp->display, dockapp->win, hints);
XFree(hints); XFree(hints);
} }
DAShow(); DAShow();
} }
@ -208,10 +208,10 @@ static void scroll_text(void)
int tw = dockapp->tw; /* width of the rendered text */ int tw = dockapp->tw; /* width of the rendered text */
int sx, dx, w; int sx, dx, w;
if (!dockapp->scroll) if (!dockapp->scroll)
return; return;
/* /*
* Conceptually this is viewing the text through a scrolling * Conceptually this is viewing the text through a scrolling
* window - the window starts out with the end immediately before * window - the window starts out with the end immediately before
* the text, and stops when the start of the window is immediately * the text, and stops when the start of the window is immediately
@ -224,9 +224,9 @@ static void scroll_text(void)
* text is being copied, until a full window is being copied. * text is being copied, until a full window is being copied.
* *
* As the end of the window moves out past the end of the text, we * As the end of the window moves out past the end of the text, we
* want to keep the destination at the beginning of the text area, * want to keep the destination at the beginning of the text area,
* but copy a smaller and smaller chunk of the text. Eventually the * but copy a smaller and smaller chunk of the text. Eventually the
* start of the window will scroll past the end of the text, at * start of the window will scroll past the end of the text, at
* which point we stop doing any work and wait to be reset. * which point we stop doing any work and wait to be reset.
*/ */
@ -246,7 +246,7 @@ static void scroll_text(void)
w = end; w = end;
else if (end > tw) else if (end > tw)
w = 52 - (end - tw); w = 52 - (end - tw);
dx = x + 52 - w; dx = x + 52 - w;
if (end > tw) if (end > tw)
dx = x; dx = x;
@ -368,7 +368,7 @@ static void display_time(int minutes)
hour = minutes / 60; hour = minutes / 60;
/* our display area only fits %2d:%2d, so we need to make sure /* our display area only fits %2d:%2d, so we need to make sure
* what we're displaying will fit in those constraints. I don't * what we're displaying will fit in those constraints. I don't
* think we're likely to see any batteries that do more than * think we're likely to see any batteries that do more than
* 100 hours any time soon, so it's fairly safe. */ * 100 hours any time soon, so it's fairly safe. */
if (hour >= 100) { if (hour >= 100) {
hour = 99; hour = 99;
@ -392,7 +392,7 @@ static void display_time(int minutes)
omin = min; omin = min;
} }
/* /*
* The reworked state handling stuff. * The reworked state handling stuff.
*/ */
@ -407,9 +407,9 @@ static void really_blink_power_glyph(void)
{ {
static int counter = 0; static int counter = 0;
if (counter == 10) if (counter == 10)
display_power_glyph(); display_power_glyph();
else if (counter == 20) else if (counter == 20)
kill_power_glyph(); kill_power_glyph();
else if (counter > 30) else if (counter > 30)
counter = 0; counter = 0;
@ -435,7 +435,7 @@ static void really_blink_battery_glyph(void)
counter = 0; counter = 0;
counter += dockapp->period_length; counter += dockapp->period_length;
} }
static void blink_battery_glyph(void) static void blink_battery_glyph(void)
{ {
@ -484,7 +484,7 @@ void reset_scroll_speed(void) {
scroll_reset = DEFAULT_SCROLL_RESET; scroll_reset = DEFAULT_SCROLL_RESET;
} }
/* /*
* The message that needs to be displayed needs to be decided * The message that needs to be displayed needs to be decided
* according to a heirarchy: a message like not present needs to take * according to a heirarchy: a message like not present needs to take
* precedence over a global thing like the current power status, and * precedence over a global thing like the current power status, and
@ -492,11 +492,11 @@ void reset_scroll_speed(void) {
* the "on battery" message. Likewise, a battery charging message * the "on battery" message. Likewise, a battery charging message
* needs to take precedence over the on ac power message. The other * needs to take precedence over the on ac power message. The other
* question is how much of a precedence local messages should take * question is how much of a precedence local messages should take
* over global ones . . . * over global ones . . .
* *
* So, there are three possible sets of messages: not present, on-line * So, there are three possible sets of messages: not present, on-line
* and off-line messages. We need to decide which of those sets is * and off-line messages. We need to decide which of those sets is
* appropriate right now, and then decide within them. * appropriate right now, and then decide within them.
*/ */
enum messages { enum messages {
M_NB, /* no batteries */ M_NB, /* no batteries */
@ -515,7 +515,7 @@ static void set_message(global_t *globals)
static enum messages state = M_NULL; static enum messages state = M_NULL;
battery_t *binfo = globals->binfo; battery_t *binfo = globals->binfo;
adapter_t *ap = &globals->adapter; adapter_t *ap = &globals->adapter;
if (globals->battery_count == 0) { if (globals->battery_count == 0) {
if (state != M_NB) { if (state != M_NB) {
state = M_NB; state = M_NB;
@ -525,7 +525,7 @@ static void set_message(global_t *globals)
return; return;
} }
/* battery not present case */ /* battery not present case */
if (!binfo->present) { if (!binfo->present) {
if (state != M_NP) { if (state != M_NP) {
@ -567,7 +567,7 @@ static void set_message(global_t *globals)
render_text("on battery"); render_text("on battery");
} }
} }
} }
} }
void set_time_display(global_t *globals) void set_time_display(global_t *globals)
@ -598,7 +598,7 @@ void set_batt_id_area(int bno)
int dy = 32; /* y coord of the target area */ int dy = 32; /* y coord of the target area */
int sx = (bno + 1) * 7; /* source x coord */ int sx = (bno + 1) * 7; /* source x coord */
int sy = 76; /* source y coord */ int sy = 76; /* source y coord */
copy_xpm_area(sx, sy, w, h, dx, dy); copy_xpm_area(sx, sy, w, h, dx, dy);
} }
@ -609,7 +609,7 @@ void cli_wmacpi(global_t *globals, int samples)
int i, j, sleep_time = 0; int i, j, sleep_time = 0;
battery_t *binfo; battery_t *binfo;
adapter_t *ap; adapter_t *ap;
pdebug("samples: %d\n", samples); pdebug("samples: %d\n", samples);
if(samples > 1) if(samples > 1)
sleep_time = 1000000/samples; sleep_time = 1000000/samples;
@ -621,7 +621,7 @@ void cli_wmacpi(global_t *globals, int samples)
acquire_global_info(globals); acquire_global_info(globals);
usleep(sleep_time); usleep(sleep_time);
} }
ap = &globals->adapter; ap = &globals->adapter;
if(ap->power == AC) { if(ap->power == AC) {
printf("On AC Power"); printf("On AC Power");
@ -630,8 +630,8 @@ void cli_wmacpi(global_t *globals, int samples)
if(binfo->present && (binfo->charge_state == CHARGE)) { if(binfo->present && (binfo->charge_state == CHARGE)) {
printf("; Battery %s charging", binfo->name); printf("; Battery %s charging", binfo->name);
printf(", currently at %2d%%", binfo->percentage); printf(", currently at %2d%%", binfo->percentage);
if(binfo->charge_time >= 0) if(binfo->charge_time >= 0)
printf(", %2d:%02d remaining", printf(", %2d:%02d remaining",
binfo->charge_time/60, binfo->charge_time/60,
binfo->charge_time%60); binfo->charge_time%60);
} }
@ -646,7 +646,7 @@ void cli_wmacpi(global_t *globals, int samples)
binfo->percentage); binfo->percentage);
} }
if(globals->rtime >= 0) if(globals->rtime >= 0)
printf("; %d:%02d remaining", globals->rtime/60, printf("; %d:%02d remaining", globals->rtime/60,
globals->rtime%60); globals->rtime%60);
printf("\n"); printf("\n");
} }
@ -686,14 +686,14 @@ int main(int argc, char **argv)
DAProgramOption options[] = { DAProgramOption options[] = {
{"-r", "--no-scroll", "disable scrolling message", DONone, False, {NULL}}, {"-r", "--no-scroll", "disable scrolling message", DONone, False, {NULL}},
{"-n", "--no-blink", "disable blinking of various UI elements", DONone, False, {NULL}}, {"-n", "--no-blink", "disable blinking of various UI elements", DONone, False, {NULL}},
{"-x", "--cmdline", "run in command line mode", DONone, False, {NULL}}, {"-x", "--cmdline", "run in command line mode", DONone, False, {NULL}},
{"-f", "--force-capacity-mode", "force the use of capacity mode for calculating time remaining", DONone, False, {NULL}}, {"-f", "--force-capacity-mode", "force the use of capacity mode for calculating time remaining", DONone, False, {NULL}},
{"-d", "--display", "display or remote display", DOString, False, {&display}}, {"-d", "--display", "display or remote display", DOString, False, {&display}},
{"-c", "--critical", "set critical low alarm at <number> percent\n (default: 10 percent)", DONatural, False, {&critical}}, {"-c", "--critical", "set critical low alarm at <number> percent\n (default: 10 percent)", DONatural, False, {&critical}},
{"-m", "--battery", "battery number to monitor", DONatural, False, {&battery_no}}, {"-m", "--battery", "battery number to monitor", DONatural, False, {&battery_no}},
{"-s", "--sample-rate", "number of times per minute to sample battery information\n default 20 (once every three seconds)", DONatural, False, {&samplerate}}, {"-s", "--sample-rate", "number of times per minute to sample battery information\n default 20 (once every three seconds)", DONatural, False, {&samplerate}},
{"-V", "--verbosity", "Set verbosity", DONatural, False, {&verbosity}}, {"-V", "--verbosity", "Set verbosity", DONatural, False, {&verbosity}},
{"-a", "--samples", "number of samples to average over (cli mode only)", DONatural, False, {&samples}}, {"-a", "--samples", "number of samples to average over (cli mode only)", DONatural, False, {&samples}},
}; };
dockapp = calloc(1, sizeof(struct dockapp)); dockapp = calloc(1, sizeof(struct dockapp));
@ -706,8 +706,8 @@ int main(int argc, char **argv)
globals->crit_level = 10; globals->crit_level = 10;
battery_no = 1; battery_no = 1;
/* after this many samples, we reinit the battery and AC adapter /* after this many samples, we reinit the battery and AC adapter
* information. * information.
* XXX: make these configurable . . . */ * XXX: make these configurable . . . */
batt_reinit = 100; batt_reinit = 100;
ac_reinit = 1000; ac_reinit = 1000;
@ -716,10 +716,10 @@ int main(int argc, char **argv)
* are available /before/ we can decide if the battery we want to * are available /before/ we can decide if the battery we want to
* monitor is available. */ * monitor is available. */
/* parse command-line options */ /* parse command-line options */
DAParseArguments(argc, argv, options, 10, DAParseArguments(argc, argv, options, 10,
"A battery monitor dockapp for ACPI based systems", "A battery monitor dockapp for ACPI based systems",
VERSION); VERSION);
if (options[0].used) if (options[0].used)
dockapp->scroll = 0; dockapp->scroll = 0;
if (options[1].used) if (options[1].used)
@ -730,7 +730,7 @@ int main(int argc, char **argv)
rt_mode = RT_CAP; rt_mode = RT_CAP;
rt_forced = 1; rt_forced = 1;
} }
if (samplerate == 0) samplerate = 1; if (samplerate == 0) samplerate = 1;
if (samplerate > 600) samplerate = 600; if (samplerate > 600) samplerate = 600;
@ -801,7 +801,7 @@ int main(int argc, char **argv)
battery_no--; battery_no--;
/* make new dockapp window */ /* make new dockapp window */
/* Don't even /think/ of asking me why, but if I set the window name to /* Don't even /think/ of asking me why, but if I set the window name to
* "acpi", the app refuses to dock properly - it's just plain /weird/. * "acpi", the app refuses to dock properly - it's just plain /weird/.
* So, wmacpi it is . . . */ * So, wmacpi it is . . . */
new_window(display, "wmacpi", argc, argv); new_window(display, "wmacpi", argc, argv);
@ -854,9 +854,9 @@ int main(int argc, char **argv)
/* what /is/ this crap? /* what /is/ this crap?
* Turns out that libdockapp adds the WM_DELETE_WINDOW atom to * Turns out that libdockapp adds the WM_DELETE_WINDOW atom to
* the WM_PROTOCOLS property for the window, which means that * the WM_PROTOCOLS property for the window, which means that
* rather than get a simple DestroyNotify message, we get a * rather than get a simple DestroyNotify message, we get a
* nice little message from the WM saying "hey, can you delete * nice little message from the WM saying "hey, can you delete
* yourself, pretty please?". So, when running as a window * yourself, pretty please?". So, when running as a window
* rather than an icon, we're impossible to kill in a friendly * rather than an icon, we're impossible to kill in a friendly
* manner, because we're expecting to die from a DestroyNotify * manner, because we're expecting to die from a DestroyNotify
* and thus blithely ignoring the WM knocking on our window * and thus blithely ignoring the WM knocking on our window
@ -877,10 +877,10 @@ int main(int argc, char **argv)
/* XXX: some laptops have problems with sampling the battery /* XXX: some laptops have problems with sampling the battery
* regularly - apparently, the BIOS disables interrupts while * regularly - apparently, the BIOS disables interrupts while
* reading from the battery, which is generally on a slow bus * reading from the battery, which is generally on a slow bus
* and is a slow device, so you get significant periods without * and is a slow device, so you get significant periods without
* interrupts. This causes interactivity to suffer . . . * interrupts. This causes interactivity to suffer . . .
* *
* So, the workaround/fix for this is to sample at a much * So, the workaround/fix for this is to sample at a much
* lower rate than we may update/refresh/expose/whatever. The * lower rate than we may update/refresh/expose/whatever. The
* user specifies how many times they want us to sample per * user specifies how many times they want us to sample per
@ -913,7 +913,7 @@ int main(int argc, char **argv)
if (globals->battery_count > 0) { if (globals->battery_count > 0) {
if (battery_no > globals->battery_count) if (battery_no > globals->battery_count)
battery_no = 0; battery_no = 0;
binfo = switch_battery(globals, battery_no); binfo = switch_battery(globals, battery_no);
} }
} }
@ -924,13 +924,13 @@ int main(int argc, char **argv)
* they change - you can hotplug batteries on most laptops these days * they change - you can hotplug batteries on most laptops these days
* and who knows what kind of shit will be happening soon . . . */ * and who knows what kind of shit will be happening soon . . . */
if (batt_count++ >= batt_reinit) { if (batt_count++ >= batt_reinit) {
if(reinit_batteries(globals)) if(reinit_batteries(globals))
pfatal("Oh my god, the batteries are gone!\n"); pfatal("Oh my god, the batteries are gone!\n");
batt_count = 0; batt_count = 0;
} }
if (ac_count++ >= ac_reinit) { if (ac_count++ >= ac_reinit) {
if(reinit_ac_adapters(globals)) if(reinit_ac_adapters(globals))
pfatal("What happened to our AC adapters?!?\n"); pfatal("What happened to our AC adapters?!?\n");
ac_count = 0; ac_count = 0;
} }
@ -942,15 +942,15 @@ int main(int argc, char **argv)
scroll_count = 0; scroll_count = 0;
} }
/* The old code had some kind of weird crap with timers and the like. /* The old code had some kind of weird crap with timers and the like.
* As far as I can tell, it's meaningless - the time we want to display * As far as I can tell, it's meaningless - the time we want to display
* is the time calculated from the remaining capacity, as per the * is the time calculated from the remaining capacity, as per the
* ACPI spec. The only thing I'd change is the handling of a charging * ACPI spec. The only thing I'd change is the handling of a charging
* state: my best guess, based on the behaviour I'm seeing with my * state: my best guess, based on the behaviour I'm seeing with my
* Lifebook, is that the present rate value when charging is the rate * Lifebook, is that the present rate value when charging is the rate
* at which the batteries are being charged, which would mean I'd just * at which the batteries are being charged, which would mean I'd just
* need to reverse the rtime calculation to be able to work out how * need to reverse the rtime calculation to be able to work out how
* much time remained until the batteries were fully charged . . . * much time remained until the batteries were fully charged . . .
* That would be rather useful, though given it would vary rather a lot * That would be rather useful, though given it would vary rather a lot
* it seems likely that it'd be little more than a rough guesstimate. */ * it seems likely that it'd be little more than a rough guesstimate. */
set_time_display(globals); set_time_display(globals);
@ -960,7 +960,7 @@ int main(int argc, char **argv)
if (globals->battery_count == 0) { if (globals->battery_count == 0) {
clear_percentage(); clear_percentage();
clear_batt_id_area(); clear_batt_id_area();
} else } else
display_percentage(binfo->percentage); display_percentage(binfo->percentage);
scroll_text(); scroll_text();

View file

@ -1,4 +1,4 @@
Main Hacker: Main Hacker:
Anthony Peacock <bratag44@hotmail.com> Anthony Peacock <bratag44@hotmail.com>
Main Author: Main Author:

View file

@ -25,9 +25,9 @@ This manual page documents briefly the
command. command.
.PP .PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and .\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics, .\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively. .\" respectively.
\fBWMacpiLoad\fP is a program to monitor battery and cpu temp. It is a dockapp \fBWMacpiLoad\fP is a program to monitor battery and cpu temp. It is a dockapp
that is supported by X window managers such as Window Maker, AfterStep, BlackBox, and that is supported by X window managers such as Window Maker, AfterStep, BlackBox, and
Enlightenment. Enlightenment.
@ -90,6 +90,6 @@ set command for acpi standby
.SH AUTHOR .SH AUTHOR
WMACPILoad was assembled by Anthony Peacock <bratag44@hotmail.com> It is massively based on code by WMACPILoad was assembled by Anthony Peacock <bratag44@hotmail.com> It is massively based on code by
Thomas Nemeth <tnemeth@free.fr>. It is largely based on WMMemMon and WMCPULoad by Seiichi Thomas Nemeth <tnemeth@free.fr>. It is largely based on WMMemMon and WMCPULoad by Seiichi
SATO <ssato@sh.rim.or.jp>, WMMemLoad by Mark Staggs <me@markstaggs.net> and wmapm by Chris D. SATO <ssato@sh.rim.or.jp>, WMMemLoad by Mark Staggs <me@markstaggs.net> and wmapm by Chris D.
Faulhaber <jedgar@speck.ml.org> Michael G. Henderson <mghenderson@lanl.gov>. Faulhaber <jedgar@speck.ml.org> Michael G. Henderson <mghenderson@lanl.gov>.

View file

@ -173,7 +173,7 @@ int main(int argc, char **argv) {
pixmap = dockapp_XCreatePixmap(SIZE, SIZE); pixmap = dockapp_XCreatePixmap(SIZE, SIZE);
/* Initialize pixmap */ /* Initialize pixmap */
if (backlight == LIGHTON) if (backlight == LIGHTON)
dockapp_copyarea(backdrop_on, pixmap, 0, 0, SIZE, SIZE, 0, 0); dockapp_copyarea(backdrop_on, pixmap, 0, 0, SIZE, SIZE, 0, 0);
else else
dockapp_copyarea(backdrop_off, pixmap, 0, 0, SIZE, SIZE, 0, 0); dockapp_copyarea(backdrop_off, pixmap, 0, 0, SIZE, SIZE, 0, 0);
@ -261,9 +261,9 @@ static void update() {
} }
/* all clear */ /* all clear */
if (backlight == LIGHTON) if (backlight == LIGHTON)
dockapp_copyarea(backdrop_on, pixmap, 0, 0, 58, 58, 0, 0); dockapp_copyarea(backdrop_on, pixmap, 0, 0, 58, 58, 0, 0);
else else
dockapp_copyarea(backdrop_off, pixmap, 0, 0, 58, 58, 0, 0); dockapp_copyarea(backdrop_off, pixmap, 0, 0, 58, 58, 0, 0);
/* draw digit */ /* draw digit */
@ -547,7 +547,7 @@ int acpi_read(AcpiInfos *i) {
fclose(fd); fclose(fd);
if(( ptr = strstr(buf,"charging state:"))) { if(( ptr = strstr(buf,"charging state:"))) {
stat = *(ptr + 25); stat = *(ptr + 25);
switch (stat) switch (stat)
{ {
case 'd': case 'd':
i->battery_status=1; i->battery_status=1;

View file

@ -19,7 +19,7 @@ wmauda: $(OBJS) $(HEADERS)
all: wmauda all: wmauda
clean: clean:
rm -f *.o wmauda rm -f *.o wmauda
install: all install: all

View file

@ -18,7 +18,7 @@ Show summary of options.
.B \-c, \-\-command .B \-c, \-\-command
Command to start Audacious (Default: audacious). Command to start Audacious (Default: audacious).
.TP .TP
.B \-i, \-\-icon .B \-i, \-\-icon
Icon to show instead of the default one when Audacious is not running. The Icon to show instead of the default one when Audacious is not running. The
icon must be in XPM format. icon must be in XPM format.
.TP .TP

View file

@ -1,7 +1,7 @@
/* wmauda - Dockapp for controlling Audacious /* wmauda - Dockapp for controlling Audacious
* *
* Copyright (C) 2006 Michael Stewart <michael@alteredeclipse.org> * Copyright (C) 2006 Michael Stewart <michael@alteredeclipse.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
@ -74,15 +74,15 @@ typedef struct
{ {
unsigned char ascii; gint x, y; unsigned char ascii; gint x, y;
} Charentry; } Charentry;
Charentry chartable[] = Charentry chartable[] =
{ {
{ '-', 60, 73}, /* put here coordinates of characters */ { '-', 60, 73}, /* put here coordinates of characters */
{ '.', 72, 73}, /* in xmms-dock-master.xpm */ { '.', 72, 73}, /* in xmms-dock-master.xpm */
{ ',', 78, 73}, { ',', 78, 73},
{ '\\', 84, 73}, { '\\', 84, 73},
{ '/', 90, 73}, { '/', 90, 73},
{ '(', 96, 73}, { '(', 96, 73},
{ ')', 102, 73}, { ')', 102, 73},
{ '%', 108, 73}, { '%', 108, 73},
{ 'Ä', 114, 73}, { 'Ä', 114, 73},
@ -98,10 +98,10 @@ Charentry chartable[] =
{ ' ', 66, 73}, { ' ', 66, 73},
}; };
#define NUM_CHARS 19 #define NUM_CHARS 19
#define VOLSLIDER_X 8 #define VOLSLIDER_X 8
#define VOLSLIDER_Y 17 #define VOLSLIDER_Y 17
#define VOLSLIDER_WIDTH 7 #define VOLSLIDER_WIDTH 7
#define VOLSLIDER_HEIGHT 40 #define VOLSLIDER_HEIGHT 40
@ -116,7 +116,7 @@ Charentry chartable[] =
#define SCROLLTEXT_X 5 #define SCROLLTEXT_X 5
#define SCROLLTEXT_Y 6 #define SCROLLTEXT_Y 6
#define SCROLLTEXT_WIDTH 40 #define SCROLLTEXT_WIDTH 40
#define SCROLLTEXT_HEIGHT 9 #define SCROLLTEXT_HEIGHT 9
#define SCROLLTEXT_CHARS 9 #define SCROLLTEXT_CHARS 9
gboolean volslider_dragging = FALSE; gboolean volslider_dragging = FALSE;
@ -141,7 +141,7 @@ gboolean has_geometry = FALSE, single_click = FALSE, song_title = FALSE;
char *icon_name = NULL; char *icon_name = NULL;
int win_x, win_y; int win_x, win_y;
DBusGProxy *dbus_proxy = NULL; DBusGProxy *dbus_proxy = NULL;
static DBusGConnection *connection = NULL; static DBusGConnection *connection = NULL;
GtkTargetEntry drop_types[] = GtkTargetEntry drop_types[] =
@ -267,9 +267,9 @@ void real_draw_scrolltext(GdkWindow * w)
char *title = audacious_remote_get_playlist_title(dbus_proxy, pl_pos); char *title = audacious_remote_get_playlist_title(dbus_proxy, pl_pos);
if (title) if (title)
{ {
/* render text */ /* render text */
gint i = 0, c = 0, pos = 0, dest = 0; gint i = 0, c = 0, pos = 0, dest = 0;
for (i=0; i<SCROLLTEXT_CHARS; i++) for (i=0; i<SCROLLTEXT_CHARS; i++)
{ {
gint x = 66, y = 73; gint x = 66, y = 73;
@ -300,7 +300,7 @@ void real_draw_scrolltext(GdkWindow * w)
break; break;
} }
} }
gdk_draw_pixmap(w, dock_gc, pixmap, x, y, gdk_draw_pixmap(w, dock_gc, pixmap, x, y,
dest, SCROLLTEXT_Y, 7, 9); dest, SCROLLTEXT_Y, 7, 9);
} }
@ -511,10 +511,10 @@ static void update_tooltip(void)
static int pl_pos = -1; static int pl_pos = -1;
static char *filename; static char *filename;
int new_pos; int new_pos;
if (!tooltips) if (!tooltips)
return; return;
new_pos = audacious_remote_get_playlist_pos(dbus_proxy); new_pos = audacious_remote_get_playlist_pos(dbus_proxy);
if (new_pos == 0) if (new_pos == 0)
@ -663,17 +663,17 @@ void drag_data_received(GtkWidget *widget, GdkDragContext *context,
static gboolean dbus_init(void) static gboolean dbus_init(void)
{ {
GError *error = NULL; GError *error = NULL;
connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error); connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
if (connection == NULL) if (connection == NULL)
return FALSE; return FALSE;
dbus_proxy = dbus_g_proxy_new_for_name(connection, AUDACIOUS_DBUS_SERVICE, dbus_proxy = dbus_g_proxy_new_for_name(connection, AUDACIOUS_DBUS_SERVICE,
AUDACIOUS_DBUS_PATH, AUDACIOUS_DBUS_PATH,
AUDACIOUS_DBUS_INTERFACE); AUDACIOUS_DBUS_INTERFACE);
if (dbus_proxy == NULL) if (dbus_proxy == NULL)
return FALSE; return FALSE;
return TRUE; return TRUE;
} }
@ -694,7 +694,7 @@ void init(void)
tooltips = gtk_tooltips_new(); tooltips = gtk_tooltips_new();
gtk_tooltips_set_delay(tooltips, 1000); gtk_tooltips_set_delay(tooltips, 1000);
} }
icon_win = gtk_window_new(GTK_WINDOW_TOPLEVEL); icon_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_app_paintable(icon_win, TRUE); gtk_widget_set_app_paintable(icon_win, TRUE);
gtk_widget_set_uposition(icon_win, 0, 0); gtk_widget_set_uposition(icon_win, 0, 0);
@ -781,16 +781,16 @@ void init(void)
gdk_window_set_icon(leader, icon_win->window, NULL, NULL); gdk_window_set_icon(leader, icon_win->window, NULL, NULL);
gdk_window_reparent(icon_win->window, leader, 0, 0); gdk_window_reparent(icon_win->window, leader, 0, 0);
gdk_window_show(leader); gdk_window_show(leader);
hints.initial_state = WithdrawnState; hints.initial_state = WithdrawnState;
hints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint; hints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint;
hints.icon_window = GDK_WINDOW_XWINDOW(icon_win->window); hints.icon_window = GDK_WINDOW_XWINDOW(icon_win->window);
hints.icon_x = 0; hints.icon_x = 0;
hints.icon_y = 0; hints.icon_y = 0;
hints.window_group = GDK_WINDOW_XWINDOW(leader); hints.window_group = GDK_WINDOW_XWINDOW(leader);
XSetWMHints(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(leader), &hints); XSetWMHints(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(leader), &hints);
gtk_widget_show(icon_win); gtk_widget_show(icon_win);
timeout_tag = gtk_timeout_add(100, timeout_func, NULL); timeout_tag = gtk_timeout_add(100, timeout_func, NULL);
@ -865,7 +865,7 @@ int main(int argc, char **argv)
} }
if (!dbus_init()) if (!dbus_init())
return 1; return 1;
init(); init();
gtk_main(); gtk_main();
return 0; return 0;

View file

@ -1,14 +1,14 @@
Main Author: Main Author:
Florian Krohs <florian.krohs@informatik.uni-oldenburg.de> Florian Krohs <florian.krohs@informatik.uni-oldenburg.de>
Based largely on work on wmacpiload WMMemMon, wmacpiload, WMCPULoad and Based largely on work on wmacpiload WMMemMon, wmacpiload, WMCPULoad and
WMMemLoad done by: WMMemLoad done by:
Anthony Peacock Anthony Peacock
Thomas Nemeth Thomas Nemeth
Seiichi SATO Seiichi SATO
Mark Staggs Mark Staggs
And also on wmapm by : And also on wmapm by :
Chris D. Faulhaber Chris D. Faulhaber
Michael G. Henderson Michael G. Henderson
and maybe others and maybe others

View file

@ -1,7 +1,7 @@
this software comes with no warranty. this software comes with no warranty.
use it on your own risk. use it on your own risk.
if you have problems or any syggestions, feel free to contact me if you have problems or any syggestions, feel free to contact me
Florian Krohs <florian.krohs@informatik.uni-oldenburg.de> Florian Krohs <florian.krohs@informatik.uni-oldenburg.de>

View file

@ -1,7 +1,7 @@
Thanks to those who made the dockapps on which this program is based: Thanks to those who made the dockapps on which this program is based:
Anthony Peacock Anthony Peacock
Thomas Nemeth Thomas Nemeth
Seiichi SATO Seiichi SATO
Mark Staggs Mark Staggs
Chris D. Faulhaber Chris D. Faulhaber
Michael G. Henderson Michael G. Henderson

View file

@ -23,10 +23,10 @@ This manual page documents briefly the
command. command.
.PP .PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and .\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics, .\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively. .\" respectively.
\fBwmbatteries\fP is a program to monitor status of two batteries and cpu temp using \fBwmbatteries\fP is a program to monitor status of two batteries and cpu temp using
ACPI (http://acpi.sf.net). It is a dockapp ACPI (http://acpi.sf.net). It is a dockapp
that is supported by X window managers such as Window Maker, AfterStep, BlackBox, Fluxbox and that is supported by X window managers such as Window Maker, AfterStep, BlackBox, Fluxbox and
Enlightenment. Enlightenment.
@ -36,22 +36,22 @@ is displayed, until the currently charging battery is complete charged.
When on AC and the batteries are not charging, 00:00 is displayed. When on AC and the batteries are not charging, 00:00 is displayed.
Below, current capacity of availible batteries is displayed in percent and in form of bars. Below, current capacity of availible batteries is displayed in percent and in form of bars.
In the bottom half, there are 4 indicators: The left is shown when on AC. In the bottom half, there are 4 indicators: The left is shown when on AC.
The two battery symbols in the middle are shown when the corresponding The two battery symbols in the middle are shown when the corresponding
battery is discharging, and animated if it is charging. battery is discharging, and animated if it is charging.
The animation speed may be set with the -s option. The animation speed may be set with the -s option.
On the right there is an indicator which is displayed when the remaining capacity On the right there is an indicator which is displayed when the remaining capacity
of all batteries is less than a certain (default:20) percentage of the of all batteries is less than a certain (default:20) percentage of the
maximum capacity of all batteries. maximum capacity of all batteries.
The last line may be used to display either CPU temperature or the current power consumption. The last line may be used to display either CPU temperature or the current power consumption.
The mode of the last line may be set with the -m option. when -m s is given, the display The mode of the last line may be set with the -m option. when -m s is given, the display
switches between cpu temperature and power consumption in a certain time (option -ts). switches between cpu temperature and power consumption in a certain time (option -ts).
That line may also be switched manually by rightclicking in the dockapp. That line may also be switched manually by rightclicking in the dockapp.
The back-light may be turned on/off by clicking the mouse button 1 (left) The back-light may be turned on/off by clicking the mouse button 1 (left)
over the application. If battery status is below a critical level, an over the application. If battery status is below a critical level, an
alarm-mode will alert you by turning on and off back-light. alarm-mode will alert you by turning on and off back-light.
wmbatteries makes use of a config file which may be given via command line wmbatteries makes use of a config file which may be given via command line
option ,$HOME/.wmbatteriesrc or /etc/wmbatteries, whichever comes first. option ,$HOME/.wmbatteriesrc or /etc/wmbatteries, whichever comes first.
@ -105,7 +105,7 @@ set command for acpi suspend
set command for acpi standby set command for acpi standby
.TP .TP
.B \-m, \-\-mode [t|r|s] .B \-m, \-\-mode [t|r|s]
set mode for the lower row , set mode for the lower row ,
t=temperature,r=current rate,s=toggle t=temperature,r=current rate,s=toggle
.TP .TP
.B \-ts, \-\-togglespeed <integer> .B \-ts, \-\-togglespeed <integer>

View file

@ -101,7 +101,7 @@ typedef struct AcpiInfos {
typedef struct RateListElem { typedef struct RateListElem {
long rate[2]; long rate[2];
struct RateListElem *next; struct RateListElem *next;
} RateListElem; } RateListElem;
typedef enum { LIGHTOFF, LIGHTON } light; typedef enum { LIGHTOFF, LIGHTON } light;
@ -179,7 +179,7 @@ static void debug(char *debug_string){
} }
int main(int argc, char **argv) { int main(int argc, char **argv) {
XEvent event; XEvent event;
XpmColorSymbol colors[2] = { {"Back0", NULL, 0}, {"Back1", NULL, 0} }; XpmColorSymbol colors[2] = { {"Back0", NULL, 0}, {"Back1", NULL, 0} };
int ncolor = 0; int ncolor = 0;
@ -258,7 +258,7 @@ int main(int argc, char **argv) {
pixmap = dockapp_XCreatePixmap(SIZE, SIZE); pixmap = dockapp_XCreatePixmap(SIZE, SIZE);
/* Initialize pixmap */ /* Initialize pixmap */
if (backlight == LIGHTON) if (backlight == LIGHTON)
dockapp_copyarea(backdrop_on, pixmap, 0, 0, SIZE, SIZE, 0, 0); dockapp_copyarea(backdrop_on, pixmap, 0, 0, SIZE, SIZE, 0, 0);
else else
dockapp_copyarea(backdrop_off, pixmap, 0, 0, SIZE, SIZE, 0, 0); dockapp_copyarea(backdrop_off, pixmap, 0, 0, SIZE, SIZE, 0, 0);
@ -274,13 +274,13 @@ int main(int argc, char **argv) {
while (1) { while (1) {
if (cur_acpi_infos.battery_status[0]==CHARGING || cur_acpi_infos.battery_status[1]==CHARGING) if (cur_acpi_infos.battery_status[0]==CHARGING || cur_acpi_infos.battery_status[1]==CHARGING)
charging = 1; charging = 1;
else else
charging = 0; charging = 0;
timeout = update_timeout; timeout = update_timeout;
if( charging && animation_timeout<update_timeout){ if( charging && animation_timeout<update_timeout){
if(animation_timeout<toggle_timeout) if(animation_timeout<toggle_timeout)
timeout = animation_timeout; timeout = animation_timeout;
else if(togglemode) timeout = toggle_timeout; else if(togglemode) timeout = toggle_timeout;
} else if(update_timeout<toggle_timeout) } else if(update_timeout<toggle_timeout)
timeout = update_timeout; timeout = update_timeout;
else if(togglemode) timeout = toggle_timeout; else if(togglemode) timeout = toggle_timeout;
@ -300,7 +300,7 @@ int main(int argc, char **argv) {
/* Time Out */ /* Time Out */
update_timeout -= timeout; update_timeout -= timeout;
animation_timeout -= timeout; animation_timeout -= timeout;
toggle_timeout -= timeout; toggle_timeout -= timeout;
if(toggle_timeout<=0){ if(toggle_timeout<=0){
toggle_timeout = togglespeed*1000; toggle_timeout = togglespeed*1000;
if(togglemode){ if(togglemode){
@ -309,7 +309,7 @@ int main(int argc, char **argv) {
} }
} }
if(animation_timeout<=0){ if(animation_timeout<=0){
animation_timeout = animationspeed; animation_timeout = animationspeed;
if(charging){ if(charging){
blink_batt(); blink_batt();
show = 1; show = 1;
@ -319,7 +319,7 @@ int main(int argc, char **argv) {
update(); update();
show = 1; show = 1;
update_timeout = update_interval*1000; update_timeout = update_interval*1000;
} }
if(show) { if(show) {
/* show */ /* show */
draw_all(); draw_all();
@ -404,7 +404,7 @@ int init_stats(AcpiInfos *k) {
// initialize buffer // initialize buffer
if ((rateElements = (RateListElem *) malloc(history_size * sizeof(RateListElem))) == NULL) if ((rateElements = (RateListElem *) malloc(history_size * sizeof(RateListElem))) == NULL)
exit(-1); exit(-1);
firstRateElem = rateElements; firstRateElem = rateElements;
@ -418,7 +418,7 @@ int init_stats(AcpiInfos *k) {
ptr += 25; ptr += 25;
sscanf(ptr,"%d",&k->currcap[bat]); sscanf(ptr,"%d",&k->currcap[bat]);
} }
} }
if ((fd = fopen(state_files[bat], "r"))) { if ((fd = fopen(state_files[bat], "r"))) {
fread(buf,512,1,fd); fread(buf,512,1,fd);
fclose(fd); fclose(fd);
@ -436,7 +436,7 @@ int init_stats(AcpiInfos *k) {
(*(rateElements+hist)).rate[i] = k->rate[i]; (*(rateElements+hist)).rate[i] = k->rate[i];
} }
(*(rateElements+history_size-1)).next = rateElements; (*(rateElements+history_size-1)).next = rateElements;
(*(rateElements+history_size-1)).rate[i] = k->rate[i]; (*(rateElements+history_size-1)).rate[i] = k->rate[i];
} }
free(buf); free(buf);
k->ac_line_status = 0; k->ac_line_status = 0;
@ -519,7 +519,7 @@ static void parse_config_file(char *config){
DEBUGSTRING("config file found\n"); DEBUGSTRING("config file found\n");
} else { } else {
DEBUGSTRING("config file in $HOME dir nonexistant\n"); DEBUGSTRING("config file in $HOME dir nonexistant\n");
DEBUGSTRING("trying global one in /etc\n"); DEBUGSTRING("trying global one in /etc\n");
if((fd = fopen("/etc/wmbatteries", "r"))){ if((fd = fopen("/etc/wmbatteries", "r"))){
DEBUGSTRING("config file found\n"); DEBUGSTRING("config file found\n");
} }
@ -533,7 +533,7 @@ static void parse_config_file(char *config){
DEBUGSTRING("begin parsing\n"); DEBUGSTRING("begin parsing\n");
while( fgets( line, 255, fd ) != NULL ) while( fgets( line, 255, fd ) != NULL )
{ {
item = strtok( line, "\t =\n\r" ) ; item = strtok( line, "\t =\n\r" ) ;
if( item != NULL && item[0] != '#' ) if( item != NULL && item[0] != '#' )
{ {
@ -547,7 +547,7 @@ static void parse_config_file(char *config){
} else { } else {
backlight = LIGHTOFF; backlight = LIGHTOFF;
} }
} }
} }
if(!strcmp(item,"lightcolor")){ if(!strcmp(item,"lightcolor")){
@ -610,7 +610,7 @@ static void parse_config_file(char *config){
tmp=atoi(value); tmp=atoi(value);
if(tmp<100) { if(tmp<100) {
printf("animationspeed variable is out of range in line %i,must be >= 100\n",linenr); printf("animationspeed variable is out of range in line %i,must be >= 100\n",linenr);
} else { } else {
animationspeed=tmp; animationspeed=tmp;
} }
} }
@ -619,7 +619,7 @@ static void parse_config_file(char *config){
tmp=atoi(value); tmp=atoi(value);
if(tmp<1 || tmp>1000) { if(tmp<1 || tmp>1000) {
printf("historysize variable is out of range in line %i,must be >=1 and <=1000\n",linenr); printf("historysize variable is out of range in line %i,must be >=1 and <=1000\n",linenr);
} else { } else {
history_size=tmp; history_size=tmp;
} }
} }
@ -627,7 +627,7 @@ static void parse_config_file(char *config){
if(!strcmp(item,"mode")){ if(!strcmp(item,"mode")){
if(strcmp(value,"rate") && strcmp(value,"toggle") && strcmp(value,"toggle")) { if(strcmp(value,"rate") && strcmp(value,"toggle") && strcmp(value,"toggle")) {
printf("mode must be one of rate,temp,toggle in line %i\n",linenr); printf("mode must be one of rate,temp,toggle in line %i\n",linenr);
} else { } else {
if(strcmp(value,"rate")) mode=RATE; if(strcmp(value,"rate")) mode=RATE;
if(strcmp(value,"temp")) mode=TEMP; if(strcmp(value,"temp")) mode=TEMP;
if(strcmp(value,"toggle")) togglemode=1; if(strcmp(value,"toggle")) togglemode=1;
@ -650,9 +650,9 @@ static void draw_all(){
long allremain=0; long allremain=0;
long allcapacity=0; long allcapacity=0;
/* all clear */ /* all clear */
if (backlight == LIGHTON) if (backlight == LIGHTON)
dockapp_copyarea(backdrop_on, pixmap, 0, 0, 58, 58, 0, 0); dockapp_copyarea(backdrop_on, pixmap, 0, 0, 58, 58, 0, 0);
else else
dockapp_copyarea(backdrop_off, pixmap, 0, 0, 58, 58, 0, 0); dockapp_copyarea(backdrop_off, pixmap, 0, 0, 58, 58, 0, 0);
/* draw digit */ /* draw digit */
draw_remaining_time(cur_acpi_infos); draw_remaining_time(cur_acpi_infos);
@ -662,7 +662,7 @@ static void draw_all(){
draw_pcgraph(cur_acpi_infos); draw_pcgraph(cur_acpi_infos);
if(cur_acpi_infos.low) draw_low(); if(cur_acpi_infos.low) draw_low();
draw_batt(cur_acpi_infos); draw_batt(cur_acpi_infos);
} }
@ -701,7 +701,7 @@ static void draw_batt(AcpiInfos infos){
int i=0; int i=0;
if (backlight == LIGHTON) y = 28; if (backlight == LIGHTON) y = 28;
for(i=0;i<number_of_batteries;i++){ for(i=0;i<number_of_batteries;i++){
if(infos.battery_status[i]==DISCHARGING){ if(infos.battery_status[i]==DISCHARGING){
dockapp_copyarea(parts, pixmap,33+y , 63, 9, 5, 16+i*11, 39); dockapp_copyarea(parts, pixmap,33+y , 63, 9, 5, 16+i*11, 39);
} }
} }
@ -757,7 +757,7 @@ static void blink_batt(){
if(cur_acpi_infos.battery_status[bat]==CHARGING){ if(cur_acpi_infos.battery_status[bat]==CHARGING){
dockapp_copyarea(parts, pixmap, blink_pos*9+light_offset , 117, 9, 5, 16+bat*11, 39); dockapp_copyarea(parts, pixmap, blink_pos*9+light_offset , 117, 9, 5, 16+bat*11, 39);
} }
} }
} }
@ -798,7 +798,7 @@ static void draw_pcgraph(AcpiInfos infos) {
light_offset=5; light_offset=5;
} }
for(bat=0;bat<number_of_batteries;bat++){ for(bat=0;bat<number_of_batteries;bat++){
width = (infos.battery_percentage[bat]*32)/100; width = (infos.battery_percentage[bat]*32)/100;
dockapp_copyarea(parts, pixmap, 0, 58+light_offset, width, 5, 5, 26+6*bat); dockapp_copyarea(parts, pixmap, 0, 58+light_offset, width, 5, 5, 26+6*bat);
if(infos.battery_percentage[bat] == 100){ // don't display leading 0 if(infos.battery_percentage[bat] == 100){ // don't display leading 0
dockapp_copyarea(parts, pixmap, 4*(infos.battery_percentage[bat]/100), 126+light_offset, 3, 5, 38, 26+6*bat); dockapp_copyarea(parts, pixmap, 4*(infos.battery_percentage[bat]/100), 126+light_offset, 3, 5, 38, 26+6*bat);
@ -806,7 +806,7 @@ static void draw_pcgraph(AcpiInfos infos) {
if(infos.battery_percentage[bat] > 9){ //don't display leading 0 if(infos.battery_percentage[bat] > 9){ //don't display leading 0
dockapp_copyarea(parts, pixmap, 4*((infos.battery_percentage[bat]%100)/10), 126+light_offset, 3, 5, 42, 26+6*bat); dockapp_copyarea(parts, pixmap, 4*((infos.battery_percentage[bat]%100)/10), 126+light_offset, 3, 5, 42, 26+6*bat);
} }
dockapp_copyarea(parts, pixmap, 4*(infos.battery_percentage[bat]%10), 126+light_offset, 3, 5, 46, 26+6*bat); dockapp_copyarea(parts, pixmap, 4*(infos.battery_percentage[bat]%10), 126+light_offset, 3, 5, 46, 26+6*bat);
} }
} }
@ -885,8 +885,8 @@ static void parse_arguments(int argc, char **argv) {
if ( integer < 1) if ( integer < 1)
fprintf(stderr, "%s: argument %s must be positive integer\n", fprintf(stderr, "%s: argument %s must be positive integer\n",
argv[0], argv[i],update_interval), exit(1); argv[0], argv[i],update_interval), exit(1);
togglespeed=integer; togglespeed=integer;
i++; i++;
} else if (!strcmp(argv[i], "--animationspeed") || !strcmp(argv[i], "-as")) { } else if (!strcmp(argv[i], "--animationspeed") || !strcmp(argv[i], "-as")) {
if (argc == i + 1) if (argc == i + 1)
fprintf(stderr, "%s: error parsing argument for option %s\n", fprintf(stderr, "%s: error parsing argument for option %s\n",
@ -897,8 +897,8 @@ static void parse_arguments(int argc, char **argv) {
if (integer < 100) if (integer < 100)
fprintf(stderr, "%s: argument %s must be >=100\n", fprintf(stderr, "%s: argument %s must be >=100\n",
argv[0], argv[i]), exit(1); argv[0], argv[i]), exit(1);
animationspeed=integer; animationspeed=integer;
i++; i++;
} else if (!strcmp(argv[i], "--historysize") || !strcmp(argv[i], "-hs")) { } else if (!strcmp(argv[i], "--historysize") || !strcmp(argv[i], "-hs")) {
if (argc == i + 1) if (argc == i + 1)
fprintf(stderr, "%s: error parsing argument for option %s\n", fprintf(stderr, "%s: error parsing argument for option %s\n",
@ -910,7 +910,7 @@ static void parse_arguments(int argc, char **argv) {
fprintf(stderr, "%s: argument %s must be >=1 && <=1000\n", fprintf(stderr, "%s: argument %s must be >=1 && <=1000\n",
argv[0], argv[i]), exit(1); argv[0], argv[i]), exit(1);
history_size=integer; history_size=integer;
i++; i++;
} else if (!strcmp(argv[i], "--mode") || !strcmp(argv[i], "-m")) { } else if (!strcmp(argv[i], "--mode") || !strcmp(argv[i], "-m")) {
if (argc == i + 1) if (argc == i + 1)
fprintf(stderr, "%s: error parsing argument for option %s\n", fprintf(stderr, "%s: error parsing argument for option %s\n",
@ -923,7 +923,7 @@ static void parse_arguments(int argc, char **argv) {
argv[0], argv[i]), exit(1); argv[0], argv[i]), exit(1);
if(character=='s') togglemode=1; if(character=='s') togglemode=1;
else if(character=='t') mode=TEMP; else if(character=='t') mode=TEMP;
else if(character=='r') mode=RATE; else if(character=='r') mode=RATE;
i++; i++;
} else if (!strcmp(argv[i], "--standby") || !strcmp(argv[i], "-S")) { } else if (!strcmp(argv[i], "--standby") || !strcmp(argv[i], "-S")) {
standby_cmd = argv[i + 1]; standby_cmd = argv[i + 1];
@ -956,10 +956,10 @@ static void print_help(char *prog)
" -S, --standby <string> set command for acpi standby\n" " -S, --standby <string> set command for acpi standby\n"
" -m, --mode [t|r|s] set mode for the lower row , \n" " -m, --mode [t|r|s] set mode for the lower row , \n"
" t=temperature,r=current rate,s=toggle\n" " t=temperature,r=current rate,s=toggle\n"
" -ts --togglespeed <int> set toggle speed in seconds\n" " -ts --togglespeed <int> set toggle speed in seconds\n"
" -as --animationspeed <int> set speed for charging animation in msec\n" " -as --animationspeed <int> set speed for charging animation in msec\n"
" -hs --historysize <int> set size of history for calculating\n" " -hs --historysize <int> set size of history for calculating\n"
" average power consumption rate\n", " average power consumption rate\n",
prog, prog); prog, prog);
/* OPTIONS SUPP : /* OPTIONS SUPP :
* ? -f, --file : configuration file * ? -f, --file : configuration file
@ -1035,8 +1035,8 @@ int acpi_read(AcpiInfos *i) {
long allremain=0; long allremain=0;
rate = 0; rate = 0;
DEBUGSTRING("acpi_read()\n") DEBUGSTRING("acpi_read()\n")
/* get acpi thermal cpu info */ /* get acpi thermal cpu info */
@ -1052,14 +1052,14 @@ int acpi_read(AcpiInfos *i) {
if(strstr(buf, "off-line") != NULL) i->ac_line_status=0; if(strstr(buf, "off-line") != NULL) i->ac_line_status=0;
} }
for(bat=0;bat<number_of_batteries;bat++){ for(bat=0;bat<number_of_batteries;bat++){
if ((fd = fopen(state_files[bat], "r"))) { if ((fd = fopen(state_files[bat], "r"))) {
bzero(buf, 512); bzero(buf, 512);
fread(buf,512,1,fd); fread(buf,512,1,fd);
fclose(fd); fclose(fd);
if(( ptr = strstr(buf,"charging state:"))) { if(( ptr = strstr(buf,"charging state:"))) {
stat = *(ptr + 25); stat = *(ptr + 25);
switch (stat) switch (stat)
{ {
case 'd': case 'd':
i->battery_status[bat]=1; i->battery_status[bat]=1;
@ -1081,7 +1081,7 @@ int acpi_read(AcpiInfos *i) {
sscanf(ptr,"%d",&((*firstRateElem).rate[bat])); sscanf(ptr,"%d",&((*firstRateElem).rate[bat]));
} }
} }
i->battery_percentage[bat] = (((float)(i->remain[bat])*100)/cur_acpi_infos.currcap[bat]); i->battery_percentage[bat] = (((float)(i->remain[bat])*100)/cur_acpi_infos.currcap[bat]);
@ -1096,7 +1096,7 @@ int acpi_read(AcpiInfos *i) {
} }
} else { } else {
rate=0; rate=0;
i->rate[bat]=0; i->rate[bat]=0;
} }
@ -1109,11 +1109,11 @@ int acpi_read(AcpiInfos *i) {
if((i->battery_status[0]==1 || i->battery_status[1]==1) && (i->rate[0]+i->rate[1])>0){ if((i->battery_status[0]==1 || i->battery_status[1]==1) && (i->rate[0]+i->rate[1])>0){
time = (float)(i->remain[0]+i->remain[1])/(float)(i->rate[0]+i->rate[1]); time = (float)(i->remain[0]+i->remain[1])/(float)(i->rate[0]+i->rate[1]);
i->hours_left=(int)time; i->hours_left=(int)time;
i->minutes_left=(int)((time-(int)time)*60); i->minutes_left=(int)((time-(int)time)*60);
} }
if(i->battery_status[0]==0 && i->battery_status[1]==0){ if(i->battery_status[0]==0 && i->battery_status[1]==0){
i->hours_left=0; i->hours_left=0;
i->minutes_left=0; i->minutes_left=0;
} }
if((i->battery_status[0]==3||i->battery_status[1]==3) && (i->rate[0]>0 || i->rate[1]>0)){ if((i->battery_status[0]==3||i->battery_status[1]==3) && (i->rate[0]>0 || i->rate[1]>0)){
time = (float)(cur_acpi_infos.currcap[0] - i->remain[0] + cur_acpi_infos.currcap[1] - i->remain[1])/(float)(i->rate[0]+i->rate[1]); time = (float)(cur_acpi_infos.currcap[0] - i->remain[0] + cur_acpi_infos.currcap[1] - i->remain[1])/(float)(i->rate[0]+i->rate[1]);
@ -1127,13 +1127,13 @@ int acpi_read(AcpiInfos *i) {
cur_acpi_infos.low=0; cur_acpi_infos.low=0;
if(allcapacity>0){ if(allcapacity>0){
if(((double)allremain/(double)allcapacity)*100<alarm_level){ if(((double)allremain/(double)allcapacity)*100<alarm_level){
cur_acpi_infos.low=1; cur_acpi_infos.low=1;
} }
} }
DEBUGSTRING("MID acpi_read()\n") DEBUGSTRING("MID acpi_read()\n")
firstRateElem = ((*firstRateElem).next); firstRateElem = ((*firstRateElem).next);
free(buf); free(buf);
DEBUGSTRING("END acpi_read()\n") DEBUGSTRING("END acpi_read()\n")
return retcode; return retcode;

View file

@ -209,7 +209,7 @@ wmbattery (2.19) unstable; urgency=low
on systems that label a fully charged battery's charging rate as on systems that label a fully charged battery's charging rate as
unknown and state as charging. unknown and state as charging.
* Base battery charge calculations for ACPI on design capacity, instead of * Base battery charge calculations for ACPI on design capacity, instead of
last full capacity. Some batteries may exceed previous last full on last full capacity. Some batteries may exceed previous last full on
their next charging, and this also lets you see when you have a damaged their next charging, and this also lets you see when you have a damaged
battery that is not fully charging. battery that is not fully charging.
* If acpi battery charging state is unknown, but the rate is 0, * If acpi battery charging state is unknown, but the rate is 0,
@ -455,7 +455,7 @@ wmbattery (1.13) unstable; urgency=low
wmbattery (1.12) unstable; urgency=low wmbattery (1.12) unstable; urgency=low
* Use /usr/share/icons/wmbattery, not /usr/X11R6/share. Sheesh. * Use /usr/share/icons/wmbattery, not /usr/X11R6/share. Sheesh.
-- Joey Hess <joeyh@debian.org> Thu, 6 Apr 2000 13:16:52 -0700 -- Joey Hess <joeyh@debian.org> Thu, 6 Apr 2000 13:16:52 -0700

View file

@ -29,7 +29,7 @@ Conversely, here are some reasons to stick with wmapm:
- You like its look. - You like its look.
- It has a neat rainbow-colored progress bar. - It has a neat rainbow-colored progress bar.
- It has buttons to suspend the laptop and stuff. - It has buttons to suspend the laptop and stuff.
- It may be more actively and/or better maintained. Or not. - It may be more actively and/or better maintained. Or not.
Decide for yourself. Decide for yourself.
Still, forking is evil, and if I was doing this all over again, I suppose Still, forking is evil, and if I was doing this all over again, I suppose

View file

@ -7,5 +7,5 @@
programs use it). programs use it).
* Make -b 0 display an overall average of the status of all batteries, * Make -b 0 display an overall average of the status of all batteries,
much like apm does on multi-battery laptops. much like apm does on multi-battery laptops.
* The simplehal interface is not very good. It polls once per second, * The simplehal interface is not very good. It polls once per second,
it would be much better if it let HAL notify it about changes instead. it would be much better if it let HAL notify it about changes instead.

View file

@ -1,4 +1,4 @@
/* /*
* A not-yet-general-purpose ACPI library, by Joey Hess <joey@kitenet.net> * A not-yet-general-purpose ACPI library, by Joey Hess <joey@kitenet.net>
*/ */
@ -134,7 +134,7 @@ inline char *scan_acpi_value (const char *buf, const char *key) {
} }
/* Read an ACPI proc file, pull out the requested piece of information, and /* Read an ACPI proc file, pull out the requested piece of information, and
* return it (statically allocated string). Returns NULL on error, This is * return it (statically allocated string). Returns NULL on error, This is
* the slow, dumb way, fine for initialization or if only one value is needed * the slow, dumb way, fine for initialization or if only one value is needed
* from a file, slow if called many times. */ * from a file, slow if called many times. */
char *get_acpi_value (const char *file, const char *key) { char *get_acpi_value (const char *file, const char *key) {
@ -173,7 +173,7 @@ int find_items (char *itemname, char infoarray[ACPI_MAXITEM][128],
int num_devices=0; int num_devices=0;
int i; int i;
char **devices = malloc(ACPI_MAXITEM * sizeof(char *)); char **devices = malloc(ACPI_MAXITEM * sizeof(char *));
char pathname[128]; char pathname[128];
sprintf(pathname, SYSFS_PATH); sprintf(pathname, SYSFS_PATH);
@ -185,7 +185,7 @@ int find_items (char *itemname, char infoarray[ACPI_MAXITEM][128],
char filename[128]; char filename[128];
char buf[1024]; char buf[1024];
if (!strcmp(".", ent->d_name) || if (!strcmp(".", ent->d_name) ||
!strcmp("..", ent->d_name)) !strcmp("..", ent->d_name))
continue; continue;
@ -270,10 +270,10 @@ int acpi_supported (void) {
return 0; return 0;
} }
closedir(dir); closedir(dir);
/* If kernel is 2.6.21 or newer, version is in /* If kernel is 2.6.21 or newer, version is in
/sys/module/acpi/parameters/acpica_version */ /sys/module/acpi/parameters/acpica_version */
version = get_acpi_file("/sys/module/acpi/parameters/acpica_version"); version = get_acpi_file("/sys/module/acpi/parameters/acpica_version");
if (version == NULL) { if (version == NULL) {
return 0; return 0;
@ -284,13 +284,13 @@ int acpi_supported (void) {
version, ACPI_VERSION); version, ACPI_VERSION);
return 0; return 0;
} }
find_batteries(); find_batteries();
find_ac_adapters(); find_ac_adapters();
#if ACPI_THERMAL #if ACPI_THERMAL
find_thermal(); find_thermal();
#endif #endif
return 1; return 1;
} }
@ -299,7 +299,7 @@ int acpi_supported (void) {
* apm_info struct. */ * apm_info struct. */
int acpi_read (int battery, apm_info *info) { int acpi_read (int battery, apm_info *info) {
char *buf, *state; char *buf, *state;
if (acpi_batt_count == 0) { if (acpi_batt_count == 0) {
info->battery_percentage = 0; info->battery_percentage = 0;
info->battery_time = 0; info->battery_time = 0;
@ -309,10 +309,10 @@ int acpi_read (int battery, apm_info *info) {
info->ac_line_status = 1; info->ac_line_status = 1;
return 0; return 0;
} }
/* Internally it's zero indexed. */ /* Internally it's zero indexed. */
battery--; battery--;
buf = get_acpi_file(acpi_batt_info[battery]); buf = get_acpi_file(acpi_batt_info[battery]);
if (buf == NULL) { if (buf == NULL) {
fprintf(stderr, "unable to read %s\n", acpi_batt_info[battery]); fprintf(stderr, "unable to read %s\n", acpi_batt_info[battery]);
@ -323,7 +323,7 @@ int acpi_read (int battery, apm_info *info) {
info->ac_line_status = 0; info->ac_line_status = 0;
info->battery_flags = 0; info->battery_flags = 0;
info->using_minutes = 1; info->using_minutes = 1;
/* Work out if the battery is present, and what percentage of full /* Work out if the battery is present, and what percentage of full
* it is and how much time is left. */ * it is and how much time is left. */
if (strcmp(scan_acpi_value(buf, acpi_labels[label_present]), "1") == 0) { if (strcmp(scan_acpi_value(buf, acpi_labels[label_present]), "1") == 0) {
@ -340,7 +340,7 @@ int acpi_read (int battery, apm_info *info) {
info->battery_time = 0; info->battery_time = 0;
} }
else { else {
/* a zero or unknown in the file; time /* a zero or unknown in the file; time
* unknown so use a negative one to * unknown so use a negative one to
* indicate this */ * indicate this */
info->battery_time = -1; info->battery_time = -1;
@ -439,7 +439,7 @@ int acpi_read (int battery, apm_info *info) {
info->ac_line_status = on_ac_power(); info->ac_line_status = on_ac_power();
} }
} }
return 0; return 0;
} }
#endif #endif

View file

@ -1,4 +1,4 @@
/* /*
* A not-yet-general-purpose ACPI library, by Joey Hess <joey@kitenet.net> * A not-yet-general-purpose ACPI library, by Joey Hess <joey@kitenet.net>
*/ */

View file

@ -19,7 +19,7 @@
#define BATTERY_FLAGS_CRITICAL (0x4) #define BATTERY_FLAGS_CRITICAL (0x4)
#define BATTERY_FLAGS_CHARGING (0x8) #define BATTERY_FLAGS_CHARGING (0x8)
#define BATTERY_FLAGS_ABSENT (0x80) #define BATTERY_FLAGS_ABSENT (0x80)
#define BATTERY_PERCENTAGE_UNKNOWN (-1) #define BATTERY_PERCENTAGE_UNKNOWN (-1)
#define BATTERY_TIME_UNKNOWN (-1) #define BATTERY_TIME_UNKNOWN (-1)

View file

@ -115,7 +115,7 @@ fi
if [ x"$dir_arg" != x ]; then if [ x"$dir_arg" != x ]; then
dst=$src dst=$src
src="" src=""
if [ -d $dst ]; then if [ -d $dst ]; then
instcmd=: instcmd=:
else else
@ -124,7 +124,7 @@ if [ x"$dir_arg" != x ]; then
else else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad # might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'. # if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ] if [ -f $src -o -d $src ]
@ -134,7 +134,7 @@ else
echo "install: $src does not exist" echo "install: $src does not exist"
exit 1 exit 1
fi fi
if [ x"$dst" = x ] if [ x"$dst" = x ]
then then
echo "install: no destination specified" echo "install: no destination specified"
@ -162,7 +162,7 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Skip lots of stat calls in the usual case. # Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then if [ ! -d "$dstdir" ]; then
defaultIFS=' defaultIFS='
' '
IFS="${IFS-${defaultIFS}}" IFS="${IFS-${defaultIFS}}"
@ -201,17 +201,17 @@ else
# If we're going to rename the final executable, determine the name now. # If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ] if [ x"$transformarg" = x ]
then then
dstfile=`basename $dst` dstfile=`basename $dst`
else else
dstfile=`basename $dst $transformbasename | dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename sed $transformarg`$transformbasename
fi fi
# don't allow the sed command to completely eliminate the filename # don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ] if [ x"$dstfile" = x ]
then then
dstfile=`basename $dst` dstfile=`basename $dst`
else else
@ -242,7 +242,7 @@ else
# Now rename the file to the real destination. # Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile && $doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile $doit $mvcmd $dsttmp $dstdir/$dstfile
fi && fi &&

View file

@ -51,7 +51,7 @@ int connect_hal (void) {
return 1; return 1;
} }
int hal_ready (void) { int hal_ready (void) {
if (hal_ctx && dbus_connection_get_is_connected(dbus_ctx)) { if (hal_ctx && dbus_connection_get_is_connected(dbus_ctx)) {
return 1; return 1;
@ -83,7 +83,7 @@ signed int get_hal_int (const char *udi, const char *key, int optional) {
dbus_error_init(&error); dbus_error_init(&error);
ret = libhal_device_get_property_int (hal_ctx, udi, key, &error); ret = libhal_device_get_property_int (hal_ctx, udi, key, &error);
if (! dbus_error_is_set (&error)) { if (! dbus_error_is_set (&error)) {
return ret; return ret;
} }
@ -100,15 +100,15 @@ signed int get_hal_int (const char *udi, const char *key, int optional) {
signed int get_hal_bool (const char *udi, const char *key, int optional) { signed int get_hal_bool (const char *udi, const char *key, int optional) {
int ret; int ret;
DBusError error; DBusError error;
if (! hal_ready()) { if (! hal_ready()) {
return -1; return -1;
} }
dbus_error_init(&error); dbus_error_init(&error);
ret = libhal_device_get_property_bool (hal_ctx, udi, key, &error); ret = libhal_device_get_property_bool (hal_ctx, udi, key, &error);
if (! dbus_error_is_set (&error)) { if (! dbus_error_is_set (&error)) {
return ret; return ret;
} }
@ -190,7 +190,7 @@ int simplehal_read (int battery, apm_info *info) {
info->battery_status = BATTERY_STATUS_ABSENT; info->battery_status = BATTERY_STATUS_ABSENT;
return 0; return 0;
} }
/* remaining_time and charge_level.percentage are not a mandatory /* remaining_time and charge_level.percentage are not a mandatory
* keys, so if not present, -1 will be returned */ * keys, so if not present, -1 will be returned */
info->battery_time = get_hal_int(device, "battery.remaining_time", 1); info->battery_time = get_hal_int(device, "battery.remaining_time", 1);

View file

@ -29,9 +29,9 @@ int sonypi_read (apm_info *info) {
__u8 batflags; __u8 batflags;
__u16 cap, rem; __u16 cap, rem;
int havebatt = 0; int havebatt = 0;
info->using_minutes = info->battery_flags = 0; info->using_minutes = info->battery_flags = 0;
if (! sonypi_ioctl(SONYPI_IOCGBATFLAGS, &batflags)) { if (! sonypi_ioctl(SONYPI_IOCGBATFLAGS, &batflags)) {
return 1; return 1;
} }
@ -57,7 +57,7 @@ int sonypi_read (apm_info *info) {
info->battery_percentage = 0; info->battery_percentage = 0;
info->battery_status = BATTERY_STATUS_ABSENT; info->battery_status = BATTERY_STATUS_ABSENT;
} }
if (havebatt) { if (havebatt) {
info->battery_percentage = 100 * rem / cap; info->battery_percentage = 100 * rem / cap;
/* Guess at whether the battery is charging. */ /* Guess at whether the battery is charging. */
@ -66,9 +66,9 @@ int sonypi_read (apm_info *info) {
info->battery_status = BATTERY_STATUS_CHARGING; info->battery_status = BATTERY_STATUS_CHARGING;
} }
} }
/* Sadly, there is no way to estimate this. */ /* Sadly, there is no way to estimate this. */
info->battery_time = 0; info->battery_time = 0;
return 0; return 0;
} }

View file

@ -7,7 +7,7 @@ wmbattery \- dockable battery monitor
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
.B wmbattery .B wmbattery
is a battery monitor. It is used to visually display the system's battery is a battery monitor. It is used to visually display the system's battery
status. status.
.PP .PP
.B wmbattery .B wmbattery
@ -93,7 +93,7 @@ switch.
.B \-e .B \-e
wmbattery contains code for estimating the time remaining before discharge, wmbattery contains code for estimating the time remaining before discharge,
and until full charge, and this code is used if no other source of this and until full charge, and this code is used if no other source of this
informaton is available. This switch makes wmbattery use its time informaton is available. This switch makes wmbattery use its time
estimation code even if some other estimate is available. estimation code even if some other estimate is available.
.TP .TP
.B \-s granularity .B \-s granularity

View file

@ -59,7 +59,7 @@ signed int critical_pct = -1;
void error(const char *fmt, ...) { void error(const char *fmt, ...) {
va_list arglist; va_list arglist;
va_start(arglist, fmt); va_start(arglist, fmt);
fprintf(stderr, "Error: "); fprintf(stderr, "Error: ");
vfprintf(stderr, fmt, arglist); vfprintf(stderr, fmt, arglist);
@ -213,7 +213,7 @@ char *parse_commandline(int argc, char *argv[]) {
char *ret=NULL; char *ret=NULL;
char *s; char *s;
extern char *optarg; extern char *optarg;
while (c != -1) { while (c != -1) {
c=getopt(argc, argv, "hd:g:if:b:w:c:l:es:a:"); c=getopt(argc, argv, "hd:g:if:b:w:c:l:es:a:");
switch (c) { switch (c) {
@ -323,17 +323,17 @@ void make_window(char *display_name, int argc, char *argv[]) {
classhint.res_name = wname; classhint.res_name = wname;
classhint.res_class = wname; classhint.res_class = wname;
XSetClassHint(display, win, &classhint); XSetClassHint(display, win, &classhint);
if (! XStringListToTextProperty(&wname, 1, &name)) if (! XStringListToTextProperty(&wname, 1, &name))
error("Can't allocate window name."); error("Can't allocate window name.");
XSetWMName(display, win, &name); XSetWMName(display, win, &name);
/* Create GC for drawing */ /* Create GC for drawing */
gcv.foreground = fore_pix; gcv.foreground = fore_pix;
gcv.background = back_pix; gcv.background = back_pix;
gcv.graphics_exposures = 0; gcv.graphics_exposures = 0;
NormalGC = XCreateGC(display, root, NormalGC = XCreateGC(display, root,
GCForeground | GCBackground | GCGraphicsExposures, GCForeground | GCBackground | GCGraphicsExposures,
&gcv); &gcv);
@ -343,15 +343,15 @@ void make_window(char *display_name, int argc, char *argv[]) {
pixmask, ShapeSet); pixmask, ShapeSet);
XShapeCombineMask(display, iconwin, ShapeBounding, 0, 0, XShapeCombineMask(display, iconwin, ShapeBounding, 0, 0,
pixmask, ShapeSet); pixmask, ShapeSet);
wmhints.initial_state = initial_state; wmhints.initial_state = initial_state;
wmhints.icon_window = iconwin; wmhints.icon_window = iconwin;
wmhints.icon_x = sizehints.x; wmhints.icon_x = sizehints.x;
wmhints.icon_y = sizehints.y; wmhints.icon_y = sizehints.y;
wmhints.window_group = win; wmhints.window_group = win;
wmhints.flags = StateHint | IconWindowHint | wmhints.flags = StateHint | IconWindowHint |
IconPositionHint | WindowGroupHint; IconPositionHint | WindowGroupHint;
XSetWMHints(display, win, &wmhints); XSetWMHints(display, win, &wmhints);
XSetCommand(display, win, argv, argc); XSetCommand(display, win, argv, argc);
@ -363,7 +363,7 @@ void make_window(char *display_name, int argc, char *argv[]) {
void flush_expose(Window w) { void flush_expose(Window w) {
XEvent dummy; XEvent dummy;
while (XCheckTypedWindowEvent(display, w, Expose, &dummy)); while (XCheckTypedWindowEvent(display, w, Expose, &dummy));
} }
@ -371,7 +371,7 @@ void redraw_window() {
XCopyArea(display, images[FACE], iconwin, NormalGC, 0, 0, XCopyArea(display, images[FACE], iconwin, NormalGC, 0, 0,
image_info[FACE].width, image_info[FACE].height, 0,0); image_info[FACE].width, image_info[FACE].height, 0,0);
flush_expose(iconwin); flush_expose(iconwin);
XCopyArea(display, images[FACE], win, NormalGC, 0, 0, XCopyArea(display, images[FACE], win, NormalGC, 0, 0,
image_info[FACE].width, image_info[FACE].height, 0,0); image_info[FACE].width, image_info[FACE].height, 0,0);
flush_expose(win); flush_expose(win);
} }
@ -388,8 +388,8 @@ void copy_image(int image, int xoffset, int yoffset,
/* /*
* Display a letter in one of two fonts, at the specified x position. * Display a letter in one of two fonts, at the specified x position.
* Note that 10 is passed for special characters `:' or `1' at the * Note that 10 is passed for special characters `:' or `1' at the
* end of the font. * end of the font.
*/ */
void draw_letter(int letter, int font, int x) { void draw_letter(int letter, int font, int x) {
copy_image(font, image_info[font].charwidth * letter, 0, copy_image(font, image_info[font].charwidth * letter, 0,
@ -399,7 +399,7 @@ void draw_letter(int letter, int font, int x) {
/* Display an image at its normal location. */ /* Display an image at its normal location. */
void draw_image(int image) { void draw_image(int image) {
copy_image(image, 0, 0, copy_image(image, 0, 0,
image_info[image].width, image_info[image].height, image_info[image].width, image_info[image].height,
image_info[image].x, image_info[image].y); image_info[image].x, image_info[image].y);
} }
@ -407,7 +407,7 @@ void draw_image(int image) {
void recalc_window(apm_info cur_info) { void recalc_window(apm_info cur_info) {
int time_left, hour_left, min_left, digit, x; int time_left, hour_left, min_left, digit, x;
static int blinked = 0; static int blinked = 0;
/* Display if it's plugged in. */ /* Display if it's plugged in. */
switch (cur_info.ac_line_status) { switch (cur_info.ac_line_status) {
case AC_LINE_STATUS_ON: case AC_LINE_STATUS_ON:
@ -416,7 +416,7 @@ void recalc_window(apm_info cur_info) {
default: default:
draw_image(UNPLUGGED); draw_image(UNPLUGGED);
} }
/* Display the appropriate color battery. */ /* Display the appropriate color battery. */
switch (cur_info.battery_status) { switch (cur_info.battery_status) {
case BATTERY_STATUS_HIGH: case BATTERY_STATUS_HIGH:
@ -447,7 +447,7 @@ void recalc_window(apm_info cur_info) {
/* /*
* Display the percent left dial. This has the side effect of * Display the percent left dial. This has the side effect of
* clearing the time left field. * clearing the time left field.
*/ */
x=DIAL_MULTIPLIER * cur_info.battery_percentage; x=DIAL_MULTIPLIER * cur_info.battery_percentage;
if (x >= 0) { if (x >= 0) {
@ -463,7 +463,7 @@ void recalc_window(apm_info cur_info) {
image_info[DIAL_DIM].height, image_info[DIAL_DIM].height,
image_info[DIAL_DIM].x + x, image_info[DIAL_DIM].x + x,
image_info[DIAL_DIM].y); image_info[DIAL_DIM].y);
/* Show percent remaining */ /* Show percent remaining */
if (cur_info.battery_percentage >= 0) { if (cur_info.battery_percentage >= 0) {
digit = cur_info.battery_percentage / 10; digit = cur_info.battery_percentage / 10;
@ -494,7 +494,7 @@ void recalc_window(apm_info cur_info) {
if (cur_info.using_minutes) if (cur_info.using_minutes)
time_left = cur_info.battery_time; time_left = cur_info.battery_time;
else else
time_left = cur_info.battery_time / 60; time_left = cur_info.battery_time / 60;
hour_left = time_left / 60; hour_left = time_left / 60;
min_left = time_left % 60; min_left = time_left % 60;
digit = hour_left / 10; digit = hour_left / 10;
@ -505,7 +505,7 @@ void recalc_window(apm_info cur_info) {
draw_letter(digit,BIGFONT,MINUTES_TENS_OFFSET); draw_letter(digit,BIGFONT,MINUTES_TENS_OFFSET);
digit = min_left % 10; digit = min_left % 10;
draw_letter(digit,BIGFONT,MINUTES_ONES_OFFSET); draw_letter(digit,BIGFONT,MINUTES_ONES_OFFSET);
redraw_window(); redraw_window();
} }
@ -562,9 +562,9 @@ void alarmhandler(int sig) {
* cannot determine time. */ * cannot determine time. */
if (always_estimate_remaining || cur_info.battery_time < 0) if (always_estimate_remaining || cur_info.battery_time < 0)
estimate_timeleft(&cur_info); estimate_timeleft(&cur_info);
/* Override the battery status? */ /* Override the battery status? */
if ((low_pct > -1 || critical_pct > -1) && if ((low_pct > -1 || critical_pct > -1) &&
cur_info.ac_line_status != AC_LINE_STATUS_ON) { cur_info.ac_line_status != AC_LINE_STATUS_ON) {
if (cur_info.battery_percentage <= critical_pct) if (cur_info.battery_percentage <= critical_pct)
cur_info.battery_status = BATTERY_STATUS_CRITICAL; cur_info.battery_status = BATTERY_STATUS_CRITICAL;
@ -573,7 +573,7 @@ void alarmhandler(int sig) {
else else
cur_info.battery_status = BATTERY_STATUS_HIGH; cur_info.battery_status = BATTERY_STATUS_HIGH;
} }
/* If APM data changes redraw and wait for next update */ /* If APM data changes redraw and wait for next update */
/* Always redraw if the status is critical, to make it blink. */ /* Always redraw if the status is critical, to make it blink. */
if (!apm_change(&cur_info) || cur_info.battery_status == BATTERY_STATUS_CRITICAL) if (!apm_change(&cur_info) || cur_info.battery_status == BATTERY_STATUS_CRITICAL)
@ -638,7 +638,7 @@ int main(int argc, char *argv[]) {
else { else {
error("No APM, ACPI, UPOWER, HAL or SPIC support detected."); error("No APM, ACPI, UPOWER, HAL or SPIC support detected.");
} }
load_images(); load_images();
load_audio(); load_audio();

View file

@ -1,23 +1,23 @@
Copyrights Copyrights
This program was written by Gennady Belyakov [8]gb@ccat.elect.ru This program was written by Gennady Belyakov [8]gb@ccat.elect.ru
Exterior appearance was heavily derived from wminet, written by Exterior appearance was heavily derived from wminet, written by
Dave Clark (clarkd@skynet.ca), Dave Clark (clarkd@skynet.ca),
Antoine Nulle (warp@xs4all.nl), Antoine Nulle (warp@xs4all.nl),
Martijn Pieterse (pieterse@xs4all.nl) Martijn Pieterse (pieterse@xs4all.nl)
Some code (around mailbox checking, with some modifications) was taken Some code (around mailbox checking, with some modifications) was taken
from xled, written by from xled, written by
Jan Schoenepauck (schoenep@uni-wuppertal.de) and Jan Schoenepauck (schoenep@uni-wuppertal.de) and
Joachim Gassen (joachim@fb4-1112.uni-muenster.de) Joachim Gassen (joachim@fb4-1112.uni-muenster.de)
POP3 checking code was taken from wmpop3 by POP3 checking code was taken from wmpop3 by
Scott Holden (scotth@thezone.net) Scott Holden (scotth@thezone.net)
Additional code was taken from xlassie, written by Additional code was taken from xlassie, written by
Trent Piepho <xyzzy@speakeasy.net> Trent Piepho <xyzzy@speakeasy.net>
Many thanks for: Many thanks for:
Angus Mackay (amackay@gusnet.cx) Angus Mackay (amackay@gusnet.cx)
Jordi Mallach Pérez (jordi@sindominio.net) Jordi Mallach Pérez (jordi@sindominio.net)

View file

@ -29,7 +29,7 @@ tracker #706995).
* WMBiff doesn't work. How do I submit a bug? * WMBiff doesn't work. How do I submit a bug?
See the Troubleshooting section of the wmbiffrc man See the Troubleshooting section of the wmbiffrc man
page. page.
If that doesn't work, run 'wmbiff -debug > wmbiff.log' and If that doesn't work, run 'wmbiff -debug > wmbiff.log' and
remove any passwords left in wmbiff.log. Submit this log remove any passwords left in wmbiff.log. Submit this log
@ -48,25 +48,25 @@ Some previously requested features can't be done:
- Count IMAP deleted messages separately (the protocol - Count IMAP deleted messages separately (the protocol
doesn't support it without locking the mailbox). doesn't support it without locking the mailbox).
- Reset the count of new messages to zero when spawning - Reset the count of new messages to zero when spawning
a mailer (it would just jump back again the next time a mailer (it would just jump back again the next time
wmbiff looked). wmbiff looked).
Previously suggested features that are really hard: Previously suggested features that are really hard:
- Support dock sizes other than 64x64 - Support dock sizes other than 64x64
- Inverse video on new mail (or do more visually to grab attention) - Inverse video on new mail (or do more visually to grab attention)
* I'm about to start writing a patch. How do I make sure it will * I'm about to start writing a patch. How do I make sure it will
get incorporated in WMBiff? get incorporated in WMBiff?
Start a conversation on wmbiff-devel, and you'll probably Start a conversation on wmbiff-devel, and you'll probably
get some help. get some help.
Tidbits: Tidbits:
Avoid creating new Clients. Avoid creating new Clients.
- If you want an existing client to do something differently, - If you want an existing client to do something differently,
find a way to parameterize its behavior. find a way to parameterize its behavior.
- If you want to use a shell command to get some - If you want to use a shell command to get some
information, make a recipe for ShellClient (open wmbiff.c information, make a recipe for ShellClient (open wmbiff.c
and search for 'gicu'). and search for 'gicu').
If you must create a new client, Avoid Duplicating Code. If you must create a new client, Avoid Duplicating Code.
Document your patch. Add entries as appropriate to: Document your patch. Add entries as appropriate to:
@ -76,11 +76,11 @@ Tidbits:
* How do I get the very latest WMBiff from SourceForge CVS? * How do I get the very latest WMBiff from SourceForge CVS?
See http://sourceforge.net/cvs/?group_id=26389, or See http://sourceforge.net/cvs/?group_id=26389, or
http://sourceforge.net/projects/wmbiff then click on CVS. http://sourceforge.net/projects/wmbiff then click on CVS.
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wmbiff login cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wmbiff login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wmbiff co wmbiff cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wmbiff co wmbiff
* I added a feature to WMBiff. How do I submit a patch? * I added a feature to WMBiff. How do I submit a patch?
** If you've modified code from a .tar.gz ** If you've modified code from a .tar.gz
@ -88,7 +88,7 @@ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wmbiff co wmbiff
(in the wmbiff-x.x.x/wmbiff directory) (in the wmbiff-x.x.x/wmbiff directory)
make indent make indent
cd .. cd ..
make distclean make distclean
cd .. cd ..
mv wmbiff-x.x.x wmbiff-changed mv wmbiff-x.x.x wmbiff-changed
tar xvfz wmbiff-x.x.x.tar.gz tar xvfz wmbiff-x.x.x.tar.gz
@ -98,24 +98,24 @@ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wmbiff co wmbiff
make indent make indent
cd .. cd ..
[ optionally 'make distcheck' ] [ optionally 'make distcheck' ]
make maintainer-clean make maintainer-clean
cvs update -d cvs update -d
[ resolve any conflicts ] [ resolve any conflicts ]
cvs diff -u | less [ make sure the differences are roughly correct ] cvs diff -u | less [ make sure the differences are roughly correct ]
cd .. cd ..
mv wmbiff wmbiff-changed mv wmbiff wmbiff-changed
[ now checkout a new copy of wmbiff ] [ now checkout a new copy of wmbiff ]
diff --unified --recursive --new-file --exclude CVS wmbiff wmbiff-changed > my-patch diff --unified --recursive --new-file --exclude CVS wmbiff wmbiff-changed > my-patch
** Sending the patch ** Sending the patch
Submit my-patch as an attachment to mail sent to Submit my-patch as an attachment to mail sent to
wmbiff-devel. Don't forget to subscribe to the mailing list wmbiff-devel. Don't forget to subscribe to the mailing list
so that we can discuss your patch. This is roughly the same so that we can discuss your patch. This is roughly the same
procedure you'll use to submit patches to any code, although procedure you'll use to submit patches to any code, although
others may not have the 'make indent' step. others may not have the 'make indent' step.
* This FAQ is wrong.
* This FAQ is wrong.
Send mail to wmbiff-devel@lists.sourceforge.net. Send mail to wmbiff-devel@lists.sourceforge.net.

View file

@ -25,11 +25,11 @@ dist-hook-local: ChangeLog
chmod -R g-s . chmod -R g-s .
indent: indent:
cd wmbiff && make indent cd wmbiff && make indent
cd wmgeneral && make indent cd wmgeneral && make indent
# manually increment version in configure.ac, which should be enough. # manually increment version in configure.ac, which should be enough.
ChangeLog: Makefile configure.ac ChangeLog: Makefile configure.ac
@if test "x$(CVS2CL)" != "x" && test -e maint/changelog.sed; then \ @if test "x$(CVS2CL)" != "x" && test -e maint/changelog.sed; then \
echo "Running $(CVS2CL)..."; \ echo "Running $(CVS2CL)..."; \
$(CVS2CL) --stdout --utc --day-of-week -I TODO -I NEWS -I .cvsignore | \ $(CVS2CL) --stdout --utc --day-of-week -I TODO -I NEWS -I .cvsignore | \

View file

@ -20,7 +20,7 @@ Release 0.4.24 - June 22, 2004
unstable package libgnutls10-dev. unstable package libgnutls10-dev.
Release 0.4.23 - April 27, 2004 Release 0.4.23 - April 27, 2004
* Allow server hostnames in IMAP to be IP addresses * Allow server hostnames in IMAP to be IP addresses
(start with a number). (start with a number).
Release 0.4.22 - March 27, 2004 Release 0.4.22 - March 27, 2004
@ -31,7 +31,7 @@ Release 0.4.21 - February 21, 2004
* Fix a bug where fetch times out to some IMAP servers. * Fix a bug where fetch times out to some IMAP servers.
Release 0.4.20 - January 1, 2004 Release 0.4.20 - January 1, 2004
* Add --disable-crypto for source-based distributions * Add --disable-crypto for source-based distributions
while libgcrypt is unstable. while libgcrypt is unstable.
* Sam Izzo's patch for changing the mouse click action * Sam Izzo's patch for changing the mouse click action
depending on whether a box has new mail. depending on whether a box has new mail.
@ -49,37 +49,37 @@ Release 0.4.18 - November 8, 2003
* Bugfix to OS X keychain use for panther. * Bugfix to OS X keychain use for panther.
Release 0.4.17 - August 31, 2003 Release 0.4.17 - August 31, 2003
* On Mac, ask the keychain for passwords if * On Mac, ask the keychain for passwords if
askpass = internal:apple:keychain askpass = internal:apple:keychain
* Bugfix to an infinite loop found in the * Bugfix to an infinite loop found in the
TLS interface. TLS interface.
Release 0.4.16 - July 7, 2003 Release 0.4.16 - July 7, 2003
* Checks TLS certificates. See wmbiffrc(5) for * Checks TLS certificates. See wmbiffrc(5) for
details on the certfile option. Designed to work details on the certfile option. Designed to work
with mutt. with mutt.
* Show a busy mouse cursor while talking to remote * Show a busy mouse cursor while talking to remote
servers, to show that wmbiff won't be responsive servers, to show that wmbiff won't be responsive
to mouse clicks for a little bit. to mouse clicks for a little bit.
* New buttontwo (middle click) action to complement * New buttontwo (middle click) action to complement
action (left mouse click) and fetchcmd (right mouse). action (left mouse click) and fetchcmd (right mouse).
* #'s are now only comments in .wmbiffrc at the * #'s are now only comments in .wmbiffrc at the
beginning of lines or following whitespace, beginning of lines or following whitespace,
allowing #'s in (most) passwords. allowing #'s in (most) passwords.
* AppleScript examples for driving Apple's Mail * AppleScript examples for driving Apple's Mail
application in sample.wmbiffrc application in sample.wmbiffrc
* Special mailbox action 'msglst' brings up a * Special mailbox action 'msglst' brings up a
transient window showing message headers from IMAP transient window showing message headers from IMAP
and program output for shell methods. This is and program output for shell methods. This is
intended to be faster than starting up a new intended to be faster than starting up a new
mail program or re-executing a script. mail program or re-executing a script.
* Avoid repetitive error messages when disconnected. * Avoid repetitive error messages when disconnected.
* Use conventional -geometry option handling. * Use conventional -geometry option handling.
* Fix bug in 0.4.15 to re-enable *'s in IMAP passwords. * Fix bug in 0.4.15 to re-enable *'s in IMAP passwords.
Release 0.4.15 - Mar 30, 2003 Release 0.4.15 - Mar 30, 2003
* Frobnicate internally stored passwords, partially * Frobnicate internally stored passwords, partially
obfuscating them in memory. Not actually more obfuscating them in memory. Not actually more
secure, but harder to casually discover a password. secure, but harder to casually discover a password.
* Tighten configuration file lines to more quickly * Tighten configuration file lines to more quickly
detect misconfiguration. Add the -relax option if detect misconfiguration. Add the -relax option if
@ -89,13 +89,13 @@ Release 0.4.15 - Mar 30, 2003
Release 0.4.14 - Jan 24, 2003 Release 0.4.14 - Jan 24, 2003
* Handle building on systems with both posix and gnu * Handle building on systems with both posix and gnu
regex in different but conflicting files. regex in different but conflicting files.
* Restart wmbiff on SIGUSR1. You may need to use * Restart wmbiff on SIGUSR1. You may need to use
'killall -USR1 wmbiff' if it gets stuck. 'killall -USR1 wmbiff' if it gets stuck.
* Restart wmbiff on ctrl-shift mouse 1. * Restart wmbiff on ctrl-shift mouse 1.
Release 0.4.13 - Jan 20, 2003 Release 0.4.13 - Jan 20, 2003
* Fix a file descriptor leak when using * Fix a file descriptor leak when using
both Shell and IMAP clients. both Shell and IMAP clients.
* Portability to Mac OS X, Solaris, and probably BSD * Portability to Mac OS X, Solaris, and probably BSD
restored (thanks sourceforge compile farm!) with a restored (thanks sourceforge compile farm!) with a
@ -107,14 +107,14 @@ Release 0.4.12 - Jan 3, 2003
-geometry handling. (Debian #173813) -geometry handling. (Debian #173813)
Release 0.4.11 - Dec 28, 2002 Release 0.4.11 - Dec 28, 2002
* security.debian.rb script to check for updates on * security.debian.rb script to check for updates on
security.debian.org, installed in $prefix/lib/wmbiff/ security.debian.org, installed in $prefix/lib/wmbiff/
add: path.x=/usr/lib/wmbiff/security.debian.rb to add: path.x=/usr/lib/wmbiff/security.debian.rb to
your .wmbiffrc (and install ruby if you haven't already). your .wmbiffrc (and install ruby if you haven't already).
* Internal cleanups to allow long askpass commands. * Internal cleanups to allow long askpass commands.
Release 0.4.10 - Dec 12, 2002 Release 0.4.10 - Dec 12, 2002
* Peter McAlpine's globalnotify feature - elect to play a * Peter McAlpine's globalnotify feature - elect to play a
sound on new mail in *any* mailbox without a chorus of sound on new mail in *any* mailbox without a chorus of
sounds from every mailbox. sounds from every mailbox.
* -skip-certificate-check option for when your imaps server * -skip-certificate-check option for when your imaps server
@ -123,17 +123,17 @@ Release 0.4.10 - Dec 12, 2002
Release 0.4.9 - Dec 1, 2002 Release 0.4.9 - Dec 1, 2002
* GNUTLS v0.5.9 or higher required * GNUTLS v0.5.9 or higher required
* Check TLS certificate hostname against the hostname we're * Check TLS certificate hostname against the hostname we're
connecting to. This raises the bar, but does not make connecting to. This raises the bar, but does not make
wmbiff's TLS implementation secure against man in the wmbiff's TLS implementation secure against man in the
middle attacks. middle attacks.
* WMBiff scales to the number of mailboxes you're * WMBiff scales to the number of mailboxes you're
using. For openbox, this means less wasted space in the using. For openbox, this means less wasted space in the
slit and the possibility of up to 40 mailboxes. For slit and the possibility of up to 40 mailboxes. For
WindowMaker, this means more pretty chrome and less dark WindowMaker, this means more pretty chrome and less dark
LED if you have only a couple boxes. If you prefer the empty LED if you have only a couple boxes. If you prefer the empty
cells at the end, place "path.4=<space><space>" in your cells at the end, place "path.4=<space><space>" in your
.wmbiffrc. .wmbiffrc.
Release 0.4.8 - Sept 18, 2002 Release 0.4.8 - Sept 18, 2002
* GNUTLS v0.5.1-0.5.6, gcrypt v1.1.8 required. * GNUTLS v0.5.1-0.5.6, gcrypt v1.1.8 required.
* Allow spaces in IMAP mailbox paths. The new syntax is: * Allow spaces in IMAP mailbox paths. The new syntax is:
@ -151,7 +151,7 @@ Release 0.4.6 - July 19, 2002
* GNUTLS v0.4.3, gcrypt v1.17 expected * GNUTLS v0.4.3, gcrypt v1.17 expected
Release 0.4.4 - June 27, 2002 Release 0.4.4 - June 27, 2002
* GNUTLS version 0.4.3 required. The API has changed, and * GNUTLS version 0.4.3 required. The API has changed, and
wmbiff is no longer compatible with GNUTLS versions prior wmbiff is no longer compatible with GNUTLS versions prior
to 0.4.3. Certificate checking may be slightly more strict. to 0.4.3. Certificate checking may be slightly more strict.
* GCRYPT version 1.1.7 is expected as well. * GCRYPT version 1.1.7 is expected as well.
@ -167,7 +167,7 @@ Release 0.4.3 - June 8, 2002
will not be completely erased when new mail arrives. will not be completely erased when new mail arrives.
* Mouse handling fix. * Mouse handling fix.
* Cleanup of internals: handling of default configuration when * Cleanup of internals: handling of default configuration when
.wmbiffrc does not exist, vertical position of rows, variable .wmbiffrc does not exist, vertical position of rows, variable
names, etc. names, etc.
* GNUTLS version 0.3.5 is expected; earlier and later versions * GNUTLS version 0.3.5 is expected; earlier and later versions
may be incompatible. may be incompatible.
@ -189,23 +189,23 @@ Release 0.4.0 - May 3, 2002
* GNUTLS version 0.3.5 is expected; earlier and later versions * GNUTLS version 0.3.5 is expected; earlier and later versions
may be incompatible. may be incompatible.
* askpass: Passwords can be left empty for IMAP: ssh-askpass * askpass: Passwords can be left empty for IMAP: ssh-askpass
will be used to prompt the user. See sample.wmbiffrc will be used to prompt the user. See sample.wmbiffrc
and wmbiffrc(5). and wmbiffrc(5).
* skinfile: Background pixmaps can be specified in .wmbiffrc. * skinfile: Background pixmaps can be specified in .wmbiffrc.
This has the effect of "skins." See wmbiffrc(5). This has the effect of "skins." See wmbiffrc(5).
Add "skinfile=wmbiff-master-contrast.xpm" to .wmbiffrc Add "skinfile=wmbiff-master-contrast.xpm" to .wmbiffrc
for a more readable wmbiff. for a more readable wmbiff.
* finger: Finger client added - finger a user's mailbox to get its * finger: Finger client added - finger a user's mailbox to get its
status. Requires perl and finger commands. See wmbiffrc(5). status. Requires perl and finger commands. See wmbiffrc(5).
Thanks to Andelko Horvat. Thanks to Andelko Horvat.
* shell: Improvements to ShellClient - now allows three character * shell: Improvements to ShellClient - now allows three character
text to be printed as status. If "new" is on the output text to be printed as status. If "new" is on the output
line, the text will be in yellow. Thanks to Andelko Horvat. line, the text will be in yellow. Thanks to Andelko Horvat.
* mbox: Paths can be specified including shell expressions * mbox: Paths can be specified including shell expressions
in `'s. If requested, this feature can be expanded to other in `'s. If requested, this feature can be expanded to other
clients. Nested expressions are not supported. clients. Nested expressions are not supported.
* Permissions on .wmbiffrc are checked to protect security. * Permissions on .wmbiffrc are checked to protect security.
Only a warning is printed now. This will degenerate in Only a warning is printed now. This will degenerate in
later releases for .wmbiffrc's that store passwords. later releases for .wmbiffrc's that store passwords.
* Migrated to automake / autoconf to detect defaults for * Migrated to automake / autoconf to detect defaults for
ssh-askpass and prepare for future changes. ssh-askpass and prepare for future changes.
@ -312,26 +312,26 @@ Release 0.2q1 - Fri, 13 Apr 2001 02:47:10 -0400
* Drop all of the ":" after the pop3 and delimit all values with * Drop all of the ":" after the pop3 and delimit all values with
spaces. This works well, as passwords/user-id's all agree that spaces. This works well, as passwords/user-id's all agree that
the space is a non-legit value. the space is a non-legit value.
Example: assume my password is: myEmailhasa@init Example: assume my password is: myEmailhasa@init
Old way: Old way:
path.3=pop3:debian4tux:myEmailhasa@init@mail.telocity.com path.3=pop3:debian4tux:myEmailhasa@init@mail.telocity.com
New way: New way:
path.3=pop3:debian4tux myEmailhasa@init mail.telcoity.com path.3=pop3:debian4tux myEmailhasa@init mail.telcoity.com
Ahh...before you say it. "Backward compatibility?" You will Ahh...before you say it. "Backward compatibility?" You will
also find in the patch, a NEW function. So that the OLD and also find in the patch, a NEW function. So that the OLD and
NEW way is easily compatible with all ".wmbiffrc" files. NEW way is easily compatible with all ".wmbiffrc" files.
Dev. Comments: Dev. Comments:
This was not the cleanest way to implement it, but I had to This was not the cleanest way to implement it, but I had to
suffice with a clean/quick implementation. I originally wrote suffice with a clean/quick implementation. I originally wrote
one function to handle past and new parsing. However, I one function to handle past and new parsing. However, I
thought it would be beneficial to leave them separated, so we thought it would be beneficial to leave them separated, so we
could eventually drop the old method? could eventually drop the old method?
Related Changes: Related Changes:
The man page will need to be updated (not provided in patch). The man page will need to be updated (not provided in patch).
We can weed the "old" style out of the example script as well. We can weed the "old" style out of the example script as well.
@ -357,7 +357,7 @@ Release 0.2q1 - Fri, 13 Apr 2001 02:47:10 -0400
* wmbiff/wmbiff.c: * wmbiff/wmbiff.c:
- for (index = 0; index < 4; index++) - for (index = 0; index < 4; index++)
+ for (index = 0; index < 5; index++) + for (index = 0; index < 5; index++)
BUG! Last postion #4 was not correctly being checked. BUG! Last postion #4 was not correctly being checked.
Now correctly checks each position. Now correctly checks each position.
@ -366,7 +366,7 @@ Release 0.2q - Tue, 20 Mar 2001 05:32:35 +0100
* This release is by Jorge García <Jorge.Garcia@uv.es>. * This release is by Jorge García <Jorge.Garcia@uv.es>.
* wmbiff/{*.[ch]}: removed unnecesary includes. * wmbiff/{*.[ch]}: removed unnecesary includes.
* wmbiff/wmbiff.c: some cleanups and optimizations. * wmbiff/wmbiff.c: some cleanups and optimizations.
+ init_biff: + init_biff:
* show error if user config file does not exists * show error if user config file does not exists
* use of userconfig "interval" (wasn't correctly parsed) * use of userconfig "interval" (wasn't correctly parsed)
@ -374,12 +374,12 @@ Release 0.2q - Tue, 20 Mar 2001 05:32:35 +0100
and Blink_Mode local and Blink_Mode local
+ parse_cmd: some changes to make uconfig_file local + parse_cmd: some changes to make uconfig_file local
+ {BlinkOn, BlinkOff, BlinkToogle}: Removed (merged by do_biff) + {BlinkOn, BlinkOff, BlinkToogle}: Removed (merged by do_biff)
+ {ReadConfigString, ReadConfigInt}: Removed + {ReadConfigString, ReadConfigInt}: Removed
+ countmail: removed init in header (wasn't used) + countmail: removed init in header (wasn't used)
+ ReadLine: Created (new parsing code, extracts pairs of setting + ReadLine: Created (new parsing code, extracts pairs of setting
and value) and value)
+ Read_Config_File: now there is only ONE parse not 36! + Read_Config_File: now there is only ONE parse not 36!
* wmbiff/{IMap4Client.c, Pop3Client.c}: check for correct format line to * wmbiff/{IMap4Client.c, Pop3Client.c}: check for correct format line to
avoid "segmentation fault" while parsing. avoid "segmentation fault" while parsing.
@ -398,7 +398,7 @@ Release 0.2p - Mon, 12 Mar 2001 00:00:00 -0600
* All your base are belong to us. * All your base are belong to us.
* I'm not maintaining wmBiff; I just submitted a big patch. Send your * I'm not maintaining wmBiff; I just submitted a big patch. Send your
complaints (or complements) to Yong-iL Joh. complaints (or complements) to Yong-iL Joh.
Release 0.2o - Mon, 12 Mar 2001 00:00:00 +0900 Release 0.2o - Mon, 12 Mar 2001 00:00:00 +0900
@ -429,7 +429,7 @@ Release 0.2o - Mon, 12 Mar 2001 00:00:00 +0900
Release 0.2n - Tue, 20 Feb 2001 0:00:00 +0900 Release 0.2n - Tue, 20 Feb 2001 0:00:00 +0900
* This release is by Yong-iL Joh <tolkien@mizi.com>. * This release is by Yong-iL Joh <tolkien@mizi.com>.
* Nick Clarey <nclarey@3glab.com> sent me a patch. * Nick Clarey <nclarey@3glab.com> sent me a patch.
that enhances the following: that enhances the following:
@ -445,7 +445,7 @@ Release 0.2m - Mon, 5 Feb 2001 00:00:00 +0900
Release 0.2l - Thu, 11 Jan 2001 00:00:00 +0900 Release 0.2l - Thu, 11 Jan 2001 00:00:00 +0900
* This release is by Yong-iL Joh <tolkien@mizi.com>. * This release is by Yong-iL Joh <tolkien@mizi.com>.
* Imap4Client.c had a bug when trying to connect to an imap4 server. Fixed * Imap4Client.c had a bug when trying to connect to an imap4 server. Fixed
it. it.
@ -465,10 +465,10 @@ Release 0.2-licq - Sat, 1 Jan 2000 00:00:00 +0000
* The actual date of this release is unknown, so I picked New Year's Day, * The actual date of this release is unknown, so I picked New Year's Day,
Y2K. (Dwayne C. Litzenberger) Y2K. (Dwayne C. Litzenberger)
* I found it from http://www.licq.org/download.html. * I found it from http://www.licq.org/download.html.
Release 0.2 - Fri, 26 Nov 1999 00:00:00 +0000
Release 0.2 - Fri, 26 Nov 1999 00:00:00 +0000
* This release is by Gennady Belyakov <gb@ccat.elect.ru>. * This release is by Gennady Belyakov <gb@ccat.elect.ru>.
* We don't actually know the time zone of Gennady's changelog entries * We don't actually know the time zone of Gennady's changelog entries
(Dwayne C. Litzenberger). (Dwayne C. Litzenberger).
@ -480,7 +480,7 @@ Release 0.2 - Fri, 26 Nov 1999 00:00:00 +0000
Release 0.1a - Thu, 18 Nov 1999 00:00:00 +0000 Release 0.1a - Thu, 18 Nov 1999 00:00:00 +0000
* This release is by Gennady Belyakov <gb@ccat.elect.ru>. * This release is by Gennady Belyakov <gb@ccat.elect.ru>.
* Some fixes with intialization * Some fixes with intialization

View file

@ -1,6 +1,6 @@
Introducing Introducing
WMBiff is an WindowMaker docking utility, that displays number of WMBiff is an WindowMaker docking utility, that displays number of
total messages count or unread mail messages count in differrent total messages count or unread mail messages count in differrent
mailboxes. mailboxes.
@ -10,26 +10,26 @@
Green ( cyan? :) ) digits display total number of messages, if there Green ( cyan? :) ) digits display total number of messages, if there
are no unread messages in it. are no unread messages in it.
Yellow digits display number of unread messages, with blinking on new Yellow digits display number of unread messages, with blinking on new
mail arrival, if any. mail arrival, if any.
At this moment unix-style (mbox), maildir, POP3, APOP and IMAP mailboxes At this moment unix-style (mbox), maildir, POP3, APOP and IMAP mailboxes
are supported. WMBiff also understands Licq's history files. are supported. WMBiff also understands Licq's history files.
WMBiff supports up to 5 mailboxes (but you can start 2 or more WMBiff supports up to 5 mailboxes (but you can start 2 or more
wmbiff's with differrent configs). wmbiff's with differrent configs).
Pressing on a 1st (left) mouse button will execute appropriate mail Pressing on a 1st (left) mouse button will execute appropriate mail
reader (if defined in config file). Right-clicking will exec mail reader (if defined in config file). Right-clicking will exec mail
fetching program (if any). fetching program (if any).
It is also possible to execute user-defined command line on new mail It is also possible to execute user-defined command line on new mail
arrival (for example, play .WAV file). arrival (for example, play .WAV file).
_________________________________________________________________ _________________________________________________________________
Compiling and Installation Compiling and Installation
Extract the archive: Extract the archive:
tar -xvzf wmbiff-0.x.tar.gz tar -xvzf wmbiff-0.x.tar.gz
@ -62,12 +62,12 @@ and specify differrent name of config file.
(from environment variable MAIL), labeled with word SPOOL, at first (from environment variable MAIL), labeled with word SPOOL, at first
position. All other positions will be empty. position. All other positions will be empty.
_________________________________________________________________ _________________________________________________________________
See AUTHORS to see who has contributed to WMBiff. See AUTHORS to see who has contributed to WMBiff.
_________________________________________________________________ _________________________________________________________________
Any suggestions/bug reports please send to our mailing list, Any suggestions/bug reports please send to our mailing list,
wmbiff-devel@lists.sourceforge.net wmbiff-devel@lists.sourceforge.net
Please include the output of 'wmbiff -debug'. Please include the output of 'wmbiff -debug'.
@ -81,32 +81,32 @@ wmbiff-devel list:
Hello, Hello,
I just found evidence of what I had believed for a long time. I just found evidence of what I had believed for a long time.
http://www.monkey.org/openbsd/archive/ports/0101/msg00311.html http://www.monkey.org/openbsd/archive/ports/0101/msg00311.html
Gennady Belyakov passed away right after releasing 0.2 and when he Gennady Belyakov passed away right after releasing 0.2 and when he
stopped answering mail :| stopped answering mail :|
I guess we need to update the docs. I guess we need to update the docs.
Jordi Jordi
Here is the message, if that URL becomes unavailable: Here is the message, if that URL becomes unavailable:
To: ports@openbsd.org To: ports@openbsd.org
Subject: Re: mail/wmbiff update Subject: Re: mail/wmbiff update
From: Vladimir Popov <pva48@mail.ru> From: Vladimir Popov <pva48@mail.ru>
Date: Sat, 27 Jan 2001 09:34:15 +0500 Date: Sat, 27 Jan 2001 09:34:15 +0500
On Fri, Jan 26, 2001 at 01:02:59PM +0000, Christian Weisgerber wrote: On Fri, Jan 26, 2001 at 01:02:59PM +0000, Christian Weisgerber wrote:
> >
> The major issue I have with this port is that the master site/home > The major issue I have with this port is that the master site/home
> page is unreachable. > page is unreachable.
> >
Well, wmbiff's author Gennady Belyakov passed away in late November 1999. Well, wmbiff's author Gennady Belyakov passed away in late November 1999.
That's why that url isn't any longer valid. That's why that url isn't any longer valid.
-- --
Vladimir Vladimir

View file

@ -6,7 +6,7 @@ these todo items are welcome.
** # comments make #'s unsuitable for passwords. ** # comments make #'s unsuitable for passwords.
** : and @ delimiters make such characters unsuitable for ** : and @ delimiters make such characters unsuitable for
passwords. passwords.
** the hierarchical configuration is not exported cleanly, ** the hierarchical configuration is not exported cleanly,
setting a default and then propagating or overriding it setting a default and then propagating or overriding it
requires an odd syntax. requires an odd syntax.
** elements with spaces are problematic ** elements with spaces are problematic
@ -14,8 +14,8 @@ these todo items are welcome.
methods) are cumbersome. methods) are cumbersome.
** continuation lines would allow richer shell actions without ** continuation lines would allow richer shell actions without
external shell scripts. external shell scripts.
* GNUTLS 0.5.9 * GNUTLS 0.5.9
** adds gnutls_set_default_priority, which could clean up ** adds gnutls_set_default_priority, which could clean up
a lot of the code to set priorities for ciphers that a lot of the code to set priorities for ciphers that
don't really matter to wmbiff. don't really matter to wmbiff.
* Font support * Font support
@ -33,7 +33,7 @@ these todo items are welcome.
Sometimes my IMAP server is slow... well, it's my fault Sometimes my IMAP server is slow... well, it's my fault
that I keep a few thousand messages on it. The current that I keep a few thousand messages on it. The current
timeout code will cause it to fail prematurely. timeout code will cause it to fail prematurely.
* Generic constructors for mboxes. * Generic constructors for mboxes.
There's some common code across different Clients; There's some common code across different Clients;
this is one piece that could use refactoring. this is one piece that could use refactoring.
* Add more shell "recipes" besides gicu. * Add more shell "recipes" besides gicu.
@ -52,7 +52,7 @@ these todo items are welcome.
but extra complicated, and has a useless default install but extra complicated, and has a useless default install
that requires root. xbuffy's led program seems quite that requires root. xbuffy's led program seems quite
good, but depending on another biff program seems odd. good, but depending on another biff program seems odd.
* Add a failure-expect case in tlsComm. * Add a failure-expect case in tlsComm.
For example, an IMAP status query has a good response (* For example, an IMAP status query has a good response (*
STATUS) and a bad response (a003 NO STATUS). As soon as STATUS) and a bad response (a003 NO STATUS). As soon as
one of them is received, we're done. one of them is received, we're done.
@ -71,10 +71,10 @@ these todo items are welcome.
* Unlikely to get done, unless someone volunteers: * Unlikely to get done, unless someone volunteers:
* KDE/Gnome users: Test with KDE or gnome-panel * KDE/Gnome users: Test with KDE or gnome-panel
Does Debian bug #108529 apply to wmbiff? Can wmbiff Does Debian bug #108529 apply to wmbiff? Can wmbiff
be swallowed by gnome-panel? It seems possible. It be swallowed by gnome-panel? It seems possible. It
appears to be swallowed by FVWM correctly. appears to be swallowed by FVWM correctly.
* Autoconf / Automake Wizards: fix FromCVS.sh * Autoconf / Automake Wizards: fix FromCVS.sh
How best to deal with libgnutls's macros? All How best to deal with libgnutls's macros? All
I can do is hack. I can do is hack.
* Paranoid Pop People: Support POP over TLS. * Paranoid Pop People: Support POP over TLS.
tlsComm.c should make it easy to provide TLS support tlsComm.c should make it easy to provide TLS support
@ -86,9 +86,9 @@ these todo items are welcome.
could be integrated. could be integrated.
* Recursive maildir support * Recursive maildir support
Aggregation in general is an oft-desired feature. Aggregation in general is an oft-desired feature.
* G-Mail support * G-Mail support
Though the business model of free mail forces screen scrubbing, Though the business model of free mail forces screen scrubbing,
having someone else write and maintain the interface seems having someone else write and maintain the interface seems
like it would significantly improve the utility of gmail. like it would significantly improve the utility of gmail.
$Id: TODO,v 1.21 2004/10/31 22:08:42 bluehal Exp $ $Id: TODO,v 1.21 2004/10/31 22:08:42 bluehal Exp $

View file

@ -1,2 +1,2 @@
EXTRA_DIST = EXTRA_DIST =

View file

@ -46,7 +46,7 @@ dnl AC_CHECK_FUNC(asprintf, , VASPRINTF="vasprintf.c")
dnl replacing the old USE_POLL define dnl replacing the old USE_POLL define
AC_CHECK_FUNCS(poll) AC_CHECK_FUNCS(poll)
dnl for gnutls-common.h, which defines this if missing. dnl for gnutls-common.h, which defines this if missing.
AC_CHECK_FUNCS(inet_ntop) AC_CHECK_FUNCS(inet_ntop)
dnl declare RETSIGTYPE dnl declare RETSIGTYPE
@ -68,12 +68,12 @@ dnl Parameter is minimum version
dnl TODO: fix so that GCRYPT is tested only if GNUTLS fails; the dependence dnl TODO: fix so that GCRYPT is tested only if GNUTLS fails; the dependence
dnl between them makes this turn redundant dnl between them makes this turn redundant
AC_ARG_ENABLE(crypto, AC_HELP_STRING([ --disable-crypto ], [ disable gnutls/gcrypt ]), AC_ARG_ENABLE(crypto, AC_HELP_STRING([ --disable-crypto ], [ disable gnutls/gcrypt ]),
[ if test $enableval != yes; then [ if test $enableval != yes; then
gnutls="disabled" gnutls="disabled"
gcrypt="disabled" gcrypt="disabled"
fi ]) fi ])
GNUTLS_MAN_STATUS="This copy of WMBiff was not compiled with GNUTLS." GNUTLS_MAN_STATUS="This copy of WMBiff was not compiled with GNUTLS."
if test "$gnutls" = "ok"; then if test "$gnutls" = "ok"; then
@ -96,7 +96,7 @@ if test "$gcrypt" = "ok"; then
AC_CHECK_HEADERS(gcrypt.h) ], AC_CHECK_HEADERS(gcrypt.h) ],
[ echo libgcrypt can be found at ftp://ftp.gnupg.org/pub/gcrypt/alpha/libgcrypt/ ] ) [ echo libgcrypt can be found at ftp://ftp.gnupg.org/pub/gcrypt/alpha/libgcrypt/ ] )
else else
AC_MSG_RESULT(GCRYPT disabled.) AC_MSG_RESULT(GCRYPT disabled.)
fi; fi;
@ -106,7 +106,7 @@ AC_SUBST(GCRYPT_MAN_STATUS)
AC_SUBST(GNUTLS_COMMON_O) AC_SUBST(GNUTLS_COMMON_O)
dnl regex stuff. dnl regex stuff.
AC_CHECK_HEADERS(regex.h) dnl gnuregex.h AC_CHECK_HEADERS(regex.h) dnl gnuregex.h
dnl no longer needed AC_CHECK_LIB(gnuregex, re_search) dnl BSD. dnl no longer needed AC_CHECK_LIB(gnuregex, re_search) dnl BSD.
dnl X11 stuff. dnl X11 stuff.
@ -136,7 +136,7 @@ dnl AC_SUBST(GNOME_LIBS)
dnl AC_SUBST(GNOME_CFLAGS) dnl AC_SUBST(GNOME_CFLAGS)
dnl see if __attribute__ is supported. modified from AC_C_INLINE dnl see if __attribute__ is supported. modified from AC_C_INLINE
dnl in the autoconf distribution. dnl in the autoconf distribution.
AC_DEFUN([WM_C_ATTRIBUTE], AC_DEFUN([WM_C_ATTRIBUTE],
[AC_CACHE_CHECK([for __attribute__ support], wm_cv_c_attribute, [AC_CACHE_CHECK([for __attribute__ support], wm_cv_c_attribute,
@ -152,7 +152,7 @@ foo_t foo () {return 0; }
]) ])
case $wm_cv_c_attribute in case $wm_cv_c_attribute in
yes)AC_DEFINE(HAVE___ATTRIBUTE__, , yes)AC_DEFINE(HAVE___ATTRIBUTE__, ,
[Define if '__attribute__' is supported by the compiler]) [Define if '__attribute__' is supported by the compiler])
;; ;;
esac esac
])# WM_C_ATTRIBUTE ])# WM_C_ATTRIBUTE

View file

@ -1,6 +1,6 @@
#! /usr/bin/ruby #! /usr/bin/ruby
# Copyright 2002 Neil Spring <nspring@cs.washington.edu> # Copyright 2002 Neil Spring <nspring@cs.washington.edu>
# GPL # GPL
# report bugs to wmbiff-devel@lists.sourceforge.net # report bugs to wmbiff-devel@lists.sourceforge.net
# or (preferred) use the debian BTS via 'reportbug' # or (preferred) use the debian BTS via 'reportbug'
@ -26,7 +26,7 @@ Refetch_Interval_Sec = 6 * 60 * 60
Cachedir = ENV['HOME'] + '/.wmbiff-sdr' Cachedir = ENV['HOME'] + '/.wmbiff-sdr'
# look for updates from this server. This script is designed around # look for updates from this server. This script is designed around
# (and simplified greatly by) using just a single server. # (and simplified greatly by) using just a single server.
Server = 'security.debian.org' Server = 'security.debian.org'
# extend the Array class with a max method. # extend the Array class with a max method.
@ -55,7 +55,7 @@ end
def version_a_gt_b(a, b) def version_a_gt_b(a, b)
cmd = "/usr/bin/dpkg --compare-versions %s le %s" % [ a, b ] cmd = "/usr/bin/dpkg --compare-versions %s le %s" % [ a, b ]
# $stderr.puts cmd # $stderr.puts cmd
return (!Kernel.system(cmd)) return (!Kernel.system(cmd))
end end
# figure out which lists to check # figure out which lists to check
@ -67,10 +67,10 @@ end
# file, the url, the system's cache of the file, and a # file, the url, the system's cache of the file, and a
# per-user cache of the file. # per-user cache of the file.
packagelists = Dir.glob("/var/lib/apt/lists/#{Server}*Packages").map { |pkgfile| packagelists = Dir.glob("/var/lib/apt/lists/#{Server}*Packages").map { |pkgfile|
[ pkgfile.gsub(/.*#{Server}/, '').tr('_','/'), # the url path [ pkgfile.gsub(/.*#{Server}/, '').tr('_','/'), # the url path
pkgfile, # the system cache of the packages file. probably up-to-date. pkgfile, # the system cache of the packages file. probably up-to-date.
# and finally, a user's cache of the page, if needed. # and finally, a user's cache of the page, if needed.
"%s/%s" % [ Cachedir, pkgfile.gsub(/.*#{Server}_/,'') ] "%s/%s" % [ Cachedir, pkgfile.gsub(/.*#{Server}_/,'') ]
] ]
} }
@ -80,41 +80,41 @@ session = nil
# update the user's cache if necessary. # update the user's cache if necessary.
packagelists.each { |urlpath, sc, uc| packagelists.each { |urlpath, sc, uc|
sctime = File.stat(sc).mtime sctime = File.stat(sc).mtime
cached_time = cached_time =
if(test(?e, uc)) then if(test(?e, uc)) then
uctime = File.stat(uc).mtime uctime = File.stat(uc).mtime
if ( uctime < sctime ) then if ( uctime < sctime ) then
# we have a user cache, but it is older than the system cache # we have a user cache, but it is older than the system cache
File.unlink(uc) # delete the obsolete user cache. File.unlink(uc) # delete the obsolete user cache.
sctime sctime
else else
uctime uctime
end end
else else
# the user cache doesn't exist, but we might have # the user cache doesn't exist, but we might have
# talked to the server recently. # talked to the server recently.
if(test(?e, uc + '.stamp')) then if(test(?e, uc + '.stamp')) then
File.stat(uc + '.stamp').mtime File.stat(uc + '.stamp').mtime
else else
sctime sctime
end end
end end
if(Time.now > cached_time + Refetch_Interval_Sec) then if(Time.now > cached_time + Refetch_Interval_Sec) then
debugmsg "fetching #{urlpath} %s > %s + %d" % [Time.now, cached_time, Refetch_Interval_Sec] debugmsg "fetching #{urlpath} %s > %s + %d" % [Time.now, cached_time, Refetch_Interval_Sec]
begin begin
if(session == nil) then if(session == nil) then
session = Net::HTTP.new(Server) session = Net::HTTP.new(Server)
# session.set_pipe($stderr); # session.set_pipe($stderr);
end end
begin begin
# the warning with ruby1.8 on the following line # the warning with ruby1.8 on the following line
# has to do with the resp, data bit, which should # has to do with the resp, data bit, which should
# eventually be replaced with (copied from the # eventually be replaced with (copied from the
# docs with the 1.8 net/http.rb) # docs with the 1.8 net/http.rb)
# response = http.get('/index.html') # response = http.get('/index.html')
# puts response.body # puts response.body
resp, data = session.get(urlpath, resp, data = session.get(urlpath,
{ 'If-Modified-Since' => { 'If-Modified-Since' =>
cached_time.strftime( "%a, %d %b %Y %H:%M:%S GMT" ) }) cached_time.strftime( "%a, %d %b %Y %H:%M:%S GMT" ) })
rescue SocketError => e rescue SocketError => e
# if the net is down, we'll get this error; avoid printing a stack trace. # if the net is down, we'll get this error; avoid printing a stack trace.
@ -189,9 +189,9 @@ updated = Array.new
# we're done. output a count in the format expected by wmbiff. # we're done. output a count in the format expected by wmbiff.
if(updatedcount > 0) then if(updatedcount > 0) then
puts "%d new" % [ updatedcount ] puts "%d new" % [ updatedcount ]
else else
puts "%d old" % [ installed.length ] puts "%d old" % [ installed.length ]
end end
puts updated.join("\n") puts updated.join("\n")

View file

@ -52,7 +52,7 @@ typedef struct _mbox_t {
int UnreadMsgs; /* New (unread) messages in mailbox */ int UnreadMsgs; /* New (unread) messages in mailbox */
int OldMsgs; int OldMsgs;
int OldUnreadMsgs; int OldUnreadMsgs;
char TextStatus[10]; /* if set to a string, toupper() and blit char TextStatus[10]; /* if set to a string, toupper() and blit
* that string. instead of a message count */ * that string. instead of a message count */
int blink_stat; /* blink digits flag-counter */ int blink_stat; /* blink digits flag-counter */
int debug; /* debugging status */ int debug; /* debugging status */

View file

@ -158,7 +158,7 @@ struct connection_state *unbind(
/*@null@*/ /*@null@*/
FILE *imap_open(Pop3 pc) FILE *imap_open(Pop3 pc)
{ {
static int complained_already; /* we have to succeed once before static int complained_already; /* we have to succeed once before
complaining again about failure */ complaining again about failure */
struct connection_state *scs; struct connection_state *scs;
struct imap_authentication_method *a; struct imap_authentication_method *a;
@ -173,7 +173,7 @@ FILE *imap_open(Pop3 pc)
return NULL; return NULL;
} }
/* got this far; we're going to create a connection_state /* got this far; we're going to create a connection_state
structure, although it might be a blacklist entry */ structure, although it might be a blacklist entry */
connection_name = malloc(strlen(PCU.serverName) + 20); connection_name = malloc(strlen(PCU.serverName) + 20);
sprintf(connection_name, "%s:%d", PCU.serverName, PCU.serverPort); sprintf(connection_name, "%s:%d", PCU.serverName, PCU.serverPort);
@ -234,7 +234,7 @@ FILE *imap_open(Pop3 pc)
} }
/* we don't need the unencrypted state anymore */ /* we don't need the unencrypted state anymore */
/* note that communication_failure will close the /* note that communication_failure will close the
socket and free via tls_close() */ socket and free via tls_close() */
free(scs); /* fall through will scs = initialize_gnutls(sd); */ free(scs); /* fall through will scs = initialize_gnutls(sd); */
} }
@ -253,8 +253,8 @@ FILE *imap_open(Pop3 pc)
/* authenticate; first find out how */ /* authenticate; first find out how */
/* note that capabilities may have changed since last /* note that capabilities may have changed since last
time we may have asked, if we called STARTTLS, my time we may have asked, if we called STARTTLS, my
server will allow plain password login within an server will allow plain password login within an
encrypted session. */ encrypted session. */
tlscomm_printf(scs, "a000 CAPABILITY\r\n"); tlscomm_printf(scs, "a000 CAPABILITY\r\n");
if (tlscomm_expect(scs, "* CAPABILITY", capabilities, BUF_SIZE) == 0) { if (tlscomm_expect(scs, "* CAPABILITY", capabilities, BUF_SIZE) == 0) {
@ -584,7 +584,7 @@ static int authenticate_plaintext( /*@notnull@ */ Pop3 pc,
{ {
char buf[BUF_SIZE]; char buf[BUF_SIZE];
/* is login prohibited? */ /* is login prohibited? */
/* "An IMAP client which complies with [rfc2525, section 3.2] /* "An IMAP client which complies with [rfc2525, section 3.2]
* MUST NOT issue the LOGIN command if this capability is present. * MUST NOT issue the LOGIN command if this capability is present.
*/ */
if (strstr(capabilities, "LOGINDISABLED")) { if (strstr(capabilities, "LOGINDISABLED")) {

View file

@ -5,16 +5,16 @@ wmbiff_SOURCES = wmbiff.c socket.c Pop3Client.c mboxClient.c \
maildirClient.c Imap4Client.c tlsComm.c tlsComm.h ShellClient.c \ maildirClient.c Imap4Client.c tlsComm.c tlsComm.h ShellClient.c \
passwordMgr.c passwordMgr.h charutil.c charutil.h Client.h \ passwordMgr.c passwordMgr.h charutil.c charutil.h Client.h \
regulo.c regulo.h MessageList.c MessageList.h regulo.c regulo.h MessageList.c MessageList.h
EXTRA_wmbiff_SOURCES = gnutls-common.c gnutls-common.h EXTRA_wmbiff_SOURCES = gnutls-common.c gnutls-common.h
wmbiff_LDADD = -L../wmgeneral -lwmgeneral @LIBGCRYPT_LIBS@ @GNUTLS_COMMON_O@ wmbiff_LDADD = -L../wmgeneral -lwmgeneral @LIBGCRYPT_LIBS@ @GNUTLS_COMMON_O@
wmbiff_DEPENDENCIES = ../wmgeneral/libwmgeneral.a Makefile @GNUTLS_COMMON_O@ wmbiff_DEPENDENCIES = ../wmgeneral/libwmgeneral.a Makefile @GNUTLS_COMMON_O@
test_wmbiff_SOURCES = ShellClient.c charutil.c charutil.h Client.h \ test_wmbiff_SOURCES = ShellClient.c charutil.c charutil.h Client.h \
test_wmbiff.c passwordMgr.c Imap4Client.c regulo.c Pop3Client.c \ test_wmbiff.c passwordMgr.c Imap4Client.c regulo.c Pop3Client.c \
tlsComm.c tlsComm.h socket.c tlsComm.c tlsComm.h socket.c
test_tlscomm_SOURCES = test_tlscomm.c \ test_tlscomm_SOURCES = test_tlscomm.c \
tlsComm.c tlsComm.h tlsComm.c tlsComm.h
EXTRA_test_wmbiff_SOURCES = gnutls-common.c gnutls-common.h EXTRA_test_wmbiff_SOURCES = gnutls-common.c gnutls-common.h
test_wmbiff_LDADD = @LIBGCRYPT_LIBS@ test_wmbiff_LDADD = @LIBGCRYPT_LIBS@
man_MANS = wmbiff.1 wmbiffrc.5 man_MANS = wmbiff.1 wmbiffrc.5
skindir = $(datadir)/wmbiff/skins skindir = $(datadir)/wmbiff/skins
skin_DATA = wmbiff-master-led.xpm wmbiff-master-contrast.xpm \ skin_DATA = wmbiff-master-led.xpm wmbiff-master-contrast.xpm \
@ -54,7 +54,7 @@ distclean-local:
wmbiff-classic-master-contrast.xpm wmbiff-classic-master-contrast.xpm
# remove colors, then substitute old colors, then repalletize # remove colors, then substitute old colors, then repalletize
# for some reason $< doesn't always work. # for some reason $< doesn't always work.
wmbiff-master-contrast.xpm: wmbiff-master-led.xpm Makefile wmbiff-master-contrast.xpm: wmbiff-master-led.xpm Makefile
egrep -v '^"[:%][[:space:]]c #' < wmbiff-master-led.xpm | \ egrep -v '^"[:%][[:space:]]c #' < wmbiff-master-led.xpm | \
sed -e 's/:/./g' -e 's/%/$$/g' -e 's/ 15 / 13 /' | \ sed -e 's/:/./g' -e 's/%/$$/g' -e 's/ 15 / 13 /' | \

View file

@ -4,7 +4,7 @@
Modified : Jorge García ( Jorge.Garcia@uv.es ) Modified : Jorge García ( Jorge.Garcia@uv.es )
Modified ; Mark Hurley ( debian4tux@telocity.com ) Modified ; Mark Hurley ( debian4tux@telocity.com )
Modified : Neil Spring ( nspring@cs.washington.edu ) Modified : Neil Spring ( nspring@cs.washington.edu )
* *
* Pop3 Email checker. * Pop3 Email checker.
* *
* Last Updated : Tue Nov 13 13:45:23 PST 2001 * Last Updated : Tue Nov 13 13:45:23 PST 2001
@ -52,7 +52,7 @@ extern struct connection_state *state_for_pcu(Pop3 pc);
static struct authentication_method { static struct authentication_method {
const char *name; const char *name;
/* callback returns the connection state pointer if successful, /* callback returns the connection state pointer if successful,
NULL if failed */ NULL if failed */
struct connection_state *(*auth_callback) (Pop3 pc, struct connection_state * scs, char *apop_str); struct connection_state *(*auth_callback) (Pop3 pc, struct connection_state * scs, char *apop_str);
} auth_methods[] = { } auth_methods[] = {
@ -169,7 +169,7 @@ int pop3CheckMail( /*@notnull@ */ Pop3 pc)
/* it is not an error to receive this according to RFC 1725 */ /* it is not an error to receive this according to RFC 1725 */
/* no error should be returned */ /* no error should be returned */
pc->UnreadMsgs = pc->TotalMsgs; pc->UnreadMsgs = pc->TotalMsgs;
// there's also a LIST command... not sure how to make use of it. */ // there's also a LIST command... not sure how to make use of it. */
} else { } else {
sscanf(buf, "+OK %d", &read); sscanf(buf, "+OK %d", &read);
pc->UnreadMsgs = pc->TotalMsgs - read; pc->UnreadMsgs = pc->TotalMsgs - read;
@ -201,9 +201,9 @@ int pop3Create(Pop3 pc, const char *str)
int i; int i;
int matchedchars; int matchedchars;
/* ([^: ]+) user /* ([^: ]+) user
([^@]+) or ([^ ]+) password ([^@]+) or ([^ ]+) password
([^: ]+) server ([^: ]+) server
([: ][0-9]+)? optional port ([: ][0-9]+)? optional port
' *' gobbles trailing whitespace before authentication types. ' *' gobbles trailing whitespace before authentication types.
use separate regexes for old and new types to permit use separate regexes for old and new types to permit
use of '@' in passwords use of '@' in passwords

Some files were not shown because too many files have changed in this diff Show more