Remove trailing whitespace.
This commit is contained in:
parent
b141e5af28
commit
612921ae43
|
@ -34,7 +34,7 @@ void AChannel::setVolume(long value) {
|
|||
|
||||
bool AChannel::isMuted() {
|
||||
int val;
|
||||
|
||||
|
||||
snd_mixer_selem_get_playback_switch(aItem->aElem, (SNDCHID_T) id, &val);
|
||||
|
||||
return (! (bool) val);
|
||||
|
|
|
@ -16,7 +16,7 @@ class AMixer;
|
|||
class AItem {
|
||||
private:
|
||||
AMixer *mixer; // parent mixer
|
||||
std::vector<AChannel *> pbChannels; // item channels
|
||||
std::vector<AChannel *> pbChannels; // item channels
|
||||
|
||||
long minPVolume, maxPVolume; // min/max playback volume
|
||||
bool hPVolume; // has Playback volume
|
||||
|
|
|
@ -115,7 +115,7 @@ bool AMixer::itemOK(unsigned int itemNumber) {
|
|||
int AMixer::itemGetVolume(unsigned int itemNumber) {
|
||||
if (itemNumber >= MIXER_ITEMS || !mixerItems[itemNumber])
|
||||
return (-1);
|
||||
|
||||
|
||||
return ((int) mixerItems[itemNumber]->getVolumePerc());
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,7 @@ void AMixer::itemSetVolume(unsigned int itemNumber, unsigned int volume) {
|
|||
int AMixer::itemIsMuted(unsigned int itemNumber) {
|
||||
if (itemNumber >= MIXER_ITEMS || !mixerItems[itemNumber])
|
||||
return (-1);
|
||||
|
||||
|
||||
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) {
|
||||
static char card[32] = "";
|
||||
int i = snd_card_get_index(cardId);
|
||||
|
||||
|
||||
if (i >= 0 && i < 32)
|
||||
std::snprintf(card, 32, "hw:%i", i);
|
||||
else
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
//
|
||||
// Mixer.app
|
||||
//
|
||||
//
|
||||
// Copyright (c) 1998-2002 Per Liden
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
|
@ -15,7 +15,7 @@
|
|||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
//
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
|||
|
||||
Mixer* app;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
app = new Mixer(argc, argv);
|
||||
app->run();
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
//
|
||||
// Mixer.app
|
||||
//
|
||||
//
|
||||
// Copyright (c) 1998-2002 Per Liden
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
|
@ -15,7 +15,7 @@
|
|||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
//
|
||||
|
||||
|
@ -44,7 +44,7 @@ static const char* MixerSources[] = { "Master", "PCM", "CD" };
|
|||
|
||||
extern Mixer* app;
|
||||
|
||||
void catchBrokenPipe(int sig)
|
||||
void catchBrokenPipe(int sig)
|
||||
{
|
||||
app->saveVolumeSettings();
|
||||
exit(0);
|
||||
|
@ -58,7 +58,7 @@ int percentToPosition(int percent) {
|
|||
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;
|
||||
XSizeHints sizeHints;
|
||||
|
@ -221,7 +221,7 @@ Mixer::Mixer(int argc, char** argv)
|
|||
cerr << APPNAME << ": could not open display " << displayName << endl;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
// Get root window
|
||||
mRoot = RootWindow(mDisplay, DefaultScreen(mDisplay));
|
||||
|
||||
|
@ -311,7 +311,7 @@ void Mixer::tryHelp(char* appname)
|
|||
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
|
||||
<< "options:" << endl
|
||||
|
@ -341,7 +341,7 @@ void Mixer::checkArgument(char** argv, int argc, int index)
|
|||
}
|
||||
}
|
||||
|
||||
void Mixer::showErrorLed()
|
||||
void Mixer::showErrorLed()
|
||||
{
|
||||
Window led;
|
||||
Xpm* image;
|
||||
|
@ -395,7 +395,7 @@ void Mixer::saveVolumeSettings()
|
|||
ofstream file(mSettingsFile);
|
||||
if (file) {
|
||||
// Files in ~/GNUstep/Defaults/ should follow the property list format
|
||||
file << "{" << endl
|
||||
file << "{" << endl
|
||||
<< " Volume1 = " << mVolumePos[0] << ";" << endl
|
||||
<< " Volume2 = " << mVolumePos[1] << ";" << 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 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) {
|
||||
return;
|
||||
|
@ -469,7 +469,7 @@ void Mixer::toggleMute(int button)
|
|||
setButtonType(button);
|
||||
}
|
||||
|
||||
void Mixer::setButtonType(int button)
|
||||
void Mixer::setButtonType(int button)
|
||||
{
|
||||
Xpm* image;
|
||||
|
||||
|
@ -500,10 +500,10 @@ void Mixer::setButtonPosition(int button, int position) {
|
|||
mVolumePos[button] = position;
|
||||
}
|
||||
|
||||
void Mixer::setButtonPositionRelative(int button, int relativePosition)
|
||||
void Mixer::setButtonPositionRelative(int button, int relativePosition)
|
||||
{
|
||||
int y;
|
||||
|
||||
|
||||
// Calc new button position
|
||||
y = mVolumePos[button] + relativePosition;
|
||||
|
||||
|
@ -512,17 +512,17 @@ void Mixer::setButtonPositionRelative(int button, int relativePosition)
|
|||
} else if (y < BUTTON_MAX) {
|
||||
y = BUTTON_MAX;
|
||||
}
|
||||
|
||||
|
||||
// Set button position and volume
|
||||
XMoveWindow(mDisplay, mButton[button], ButtonX[button], y);
|
||||
|
||||
mVolumePos[button] = y;
|
||||
|
||||
|
||||
// set volume
|
||||
setVolume(button, positionToPercent(y));
|
||||
}
|
||||
|
||||
void Mixer::run()
|
||||
void Mixer::run()
|
||||
{
|
||||
XEvent event;
|
||||
int buttonDown = 0;
|
||||
|
@ -532,7 +532,7 @@ void Mixer::run()
|
|||
while(1) {
|
||||
while(XPending(mDisplay) || buttonDown) {
|
||||
XNextEvent(mDisplay, &event);
|
||||
|
||||
|
||||
switch(event.type) {
|
||||
case ButtonPress:
|
||||
if (event.xbutton.button == Button4 || event.xbutton.button == Button5) {
|
||||
|
@ -562,13 +562,13 @@ void Mixer::run()
|
|||
loadVolumeSettings();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ButtonRelease:
|
||||
if (event.xbutton.button == Button1) {
|
||||
buttonDown = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case MotionNotify:
|
||||
if (buttonDown) {
|
||||
// Find button
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
//
|
||||
// Mixer.app
|
||||
//
|
||||
//
|
||||
// Copyright (c) 1998-2002 Per Liden
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
|
@ -15,7 +15,7 @@
|
|||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
//
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
|||
#define BUTTON_MIN 45
|
||||
#define BUTTON_MAX 6
|
||||
|
||||
class Mixer
|
||||
class Mixer
|
||||
{
|
||||
public:
|
||||
Mixer(int argc, char** argv);
|
||||
|
|
|
@ -12,8 +12,8 @@ for URL's), only connection to ALSA driver was added.
|
|||
Hints
|
||||
--------------------------------------------------------------
|
||||
Error led:
|
||||
If the led on Mixer.app is red an error message has
|
||||
been printed to stderr and something is not working
|
||||
If the led on Mixer.app is red an error message has
|
||||
been printed to stderr and something is not working
|
||||
correctly. If the led is green everything is working ok.
|
||||
(Error led doesn't work in AlsaMixer.app, TODO)
|
||||
|
||||
|
@ -21,14 +21,14 @@ Mute:
|
|||
Right click on a volume controller to mute the sound
|
||||
source. The button will then have a red led in one corner.
|
||||
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.
|
||||
|
||||
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
|
||||
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 mouse over Mixer.app and roll the wheel up and down. Use
|
||||
the command line option -w to specify which slider that should
|
||||
react to the wheel movement.
|
||||
|
||||
Label:
|
||||
|
@ -39,8 +39,8 @@ Label:
|
|||
the mixer.
|
||||
|
||||
Save volume settings:
|
||||
Use the option -S (and -f <file>) if you want the volume
|
||||
settings to be saved when AlsaMixer.app exits, and then
|
||||
Use the option -S (and -f <file>) if you want the volume
|
||||
settings to be saved when AlsaMixer.app exits, and then
|
||||
-L to be loaded again when AlsaMixer.app is started the next time.
|
||||
When not using -f the settings are saved in/loaded from
|
||||
~/GNUstep/Defaults/AlsaMixer. Use the -f <file> option
|
||||
|
@ -57,7 +57,7 @@ Configurable middle click:
|
|||
|
||||
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.
|
||||
|
||||
|
||||
|
@ -72,8 +72,8 @@ Alban Hertroys <dalroi@wit401310.student.utwente.nl>
|
|||
Copyright
|
||||
--------------------------------------------------------------
|
||||
AlsaMixer.app, 2004, Petr Hlavka
|
||||
Mixer.app is copyright (c) 1998-2002 by Per Liden and is
|
||||
licensed through the GNU General Public License. Read the
|
||||
Mixer.app is copyright (c) 1998-2002 by Per Liden and is
|
||||
licensed through the GNU General Public License. Read the
|
||||
COPYING file for the complete license.
|
||||
|
||||
Minor parts of this code were taken from asmixer by Rob Malda
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
//
|
||||
// Mixer.app
|
||||
//
|
||||
//
|
||||
// Copyright (c) 1998-2002 Per Liden
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
|
@ -15,7 +15,7 @@
|
|||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
//
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
Xpm::Xpm(Display* display, Window root, char** data)
|
||||
Xpm::Xpm(Display* display, Window root, char** data)
|
||||
{
|
||||
int error;
|
||||
|
||||
|
@ -67,7 +67,7 @@ Xpm::Xpm(Display* display, Window root, char** data)
|
|||
}
|
||||
}
|
||||
|
||||
Xpm::~Xpm()
|
||||
Xpm::~Xpm()
|
||||
{
|
||||
if (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);
|
||||
XSetWindowBackgroundPixmap(mDisplay, win, mImage);
|
||||
}
|
||||
|
||||
void Xpm::setWindowPixmapShaped(Window win)
|
||||
void Xpm::setWindowPixmapShaped(Window win)
|
||||
{
|
||||
XResizeWindow(mDisplay, win, mAttributes.width, mAttributes.height);
|
||||
XSetWindowBackgroundPixmap(mDisplay, win, mImage);
|
||||
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;
|
||||
GC gc;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
//
|
||||
// Mixer.app
|
||||
//
|
||||
//
|
||||
// Copyright (c) 1998-2002 Per Liden
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
|
@ -15,7 +15,7 @@
|
|||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
//
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
|||
#include <X11/Xlib.h>
|
||||
#include <X11/xpm.h>
|
||||
|
||||
class Xpm
|
||||
class Xpm
|
||||
{
|
||||
public:
|
||||
Xpm(Display* display, Window root, char** data);
|
||||
|
|
|
@ -17,7 +17,7 @@ Version Description
|
|||
- New Makefile.
|
||||
|
||||
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.
|
||||
When the option -s is used, settings are loaded from/saved in
|
||||
~/GNUstep/Defaults/Mixer. Use -S <file> if you want Mixer.app
|
||||
|
@ -25,19 +25,19 @@ Version Description
|
|||
- Fixed potential bug in command line parsing.
|
||||
|
||||
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.
|
||||
|
||||
1.4.0 - Released 1999-05-09.
|
||||
- Added support for wheel mice. One of the sliders (use -w to
|
||||
specify which one) will react on wheel movement.
|
||||
- Added support for wheel mice. One of the sliders (use -w to
|
||||
specify which one) will react on wheel movement.
|
||||
- Misc. code clean up.
|
||||
|
||||
1.3.3 - Released 1999-05-02.
|
||||
- Fixed problem that caused Mixer.app to die.
|
||||
|
||||
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.
|
||||
|
||||
1.3.1 - Released 1999-02-09.
|
||||
|
@ -48,25 +48,25 @@ Version Description
|
|||
1.3.0 - Released 1999-02-04.
|
||||
- New design.
|
||||
- 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/.
|
||||
|
||||
1.2.0 - Released 1998-12-01.
|
||||
- Moved back to old design. The design of version 1.1.1 made
|
||||
Mixer.app (and Window Maker) unstable due to some strange
|
||||
race condition at startup. It worked on some machines and
|
||||
- Moved back to old design. The design of version 1.1.1 made
|
||||
Mixer.app (and Window Maker) unstable due to some strange
|
||||
race condition at startup. It worked on some machines and
|
||||
some not, so I desided to go back to the old design.
|
||||
- Increased idle interval to reduce CPU usage.
|
||||
|
||||
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).
|
||||
- Added command line option -m <dev> to set mixer device.
|
||||
- Added command line option -n <name> to set instance name.
|
||||
- Compiling under FreeBSD now works fine.
|
||||
|
||||
|
||||
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!
|
||||
- Mute function.
|
||||
- New design.
|
||||
|
@ -84,7 +84,7 @@ Version Description
|
|||
- Minor changes to eventhandling code.
|
||||
|
||||
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.
|
||||
|
||||
1.0.1 - Released 1998-02-23.
|
||||
|
|
|
@ -19,22 +19,22 @@ support.
|
|||
Hints
|
||||
--------------------------------------------------------------
|
||||
Error led:
|
||||
If the led on Mixer.app is red an error message has
|
||||
been printed to stderr and something is not working
|
||||
If the led on Mixer.app is red an error message has
|
||||
been printed to stderr and something is not working
|
||||
correctly. If the led is green everything is working ok.
|
||||
|
||||
Mute:
|
||||
Right click on a volume controller to mute the sound
|
||||
source. The button will then have a red led in one corner.
|
||||
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.
|
||||
|
||||
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
|
||||
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 mouse over Mixer.app and roll the wheel up and down. Use
|
||||
the command line option -w to specify which slider that should
|
||||
react to the wheel movement.
|
||||
|
||||
Label:
|
||||
|
@ -45,16 +45,16 @@ Label:
|
|||
the mixer.
|
||||
|
||||
Save volume settings:
|
||||
Use the option -s or -S <file> if you want the volume
|
||||
settings to be saved when Mixer.app exits, and then
|
||||
Use the option -s or -S <file> if you want the volume
|
||||
settings to be saved when Mixer.app exits, and then
|
||||
loaded again when Mixer.app is started the next time.
|
||||
When using -s the settings are saved in/loaded from
|
||||
~/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
|
||||
--------------------------------------------------------------
|
||||
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.
|
||||
|
||||
|
||||
|
@ -67,8 +67,8 @@ Alban Hertroys <dalroi@wit401310.student.utwente.nl>
|
|||
|
||||
Copyright
|
||||
--------------------------------------------------------------
|
||||
Mixer.app is copyright (c) 1998-2002 by Per Liden and is
|
||||
licensed through the GNU General Public License. Read the
|
||||
Mixer.app is copyright (c) 1998-2002 by Per Liden and is
|
||||
licensed through the GNU General Public License. Read the
|
||||
COPYING file for the complete license.
|
||||
|
||||
Minor parts of this code were taken from asmixer by Rob Malda
|
||||
|
|
|
@ -13,7 +13,7 @@ Version 1.3 - Jul 2, 2001
|
|||
Version 1.2 - Jun 29, 2001
|
||||
- Temporary files are now unique to the process,
|
||||
so that multiple instances can run at once.
|
||||
|
||||
|
||||
Version 1.1 - Jun 25, 2001
|
||||
- Fixed some compilation problems.
|
||||
- Fixed potential race condition.
|
||||
|
|
|
@ -10,12 +10,12 @@ Requirements
|
|||
|
||||
- ICAO Location Indicator
|
||||
You must find the ICAO Location Indicator (a 4-character string)
|
||||
of a weather station near you. You can search for a station
|
||||
on this site: http://www.nws.noaa.gov/oso/siteloc.shtml
|
||||
of a weather station near you. You can search for a station
|
||||
on this site: http://www.nws.noaa.gov/oso/siteloc.shtml
|
||||
|
||||
- X11, libxpm, C++ development environment
|
||||
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.
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
//
|
||||
// Temperature.app
|
||||
//
|
||||
//
|
||||
// Copyright (c) 2000 Per Liden
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
|
@ -15,13 +15,13 @@
|
|||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
//
|
||||
|
||||
#include "Temperature.h"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
Temperature app(argc, argv);
|
||||
app.run();
|
||||
|
|
|
@ -11,14 +11,14 @@
|
|||
Description
|
||||
--------------------------------------------------------------
|
||||
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).
|
||||
|
||||
|
||||
Hints
|
||||
--------------------------------------------------------------
|
||||
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.
|
||||
If successful the led will stop blinking and go green.
|
||||
If unsuccessful the led will stop blinking and go red.
|
||||
|
@ -30,20 +30,20 @@ The led:
|
|||
|
||||
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.
|
||||
|
||||
|
||||
Special thanks to
|
||||
--------------------------------------------------------------
|
||||
Mike Henderson (mghenderson@lanl.gov) - Author of wmWeather
|
||||
(I didn't know about the weather.noaa.gov ftp-site before I
|
||||
Mike Henderson (mghenderson@lanl.gov) - Author of wmWeather
|
||||
(I didn't know about the weather.noaa.gov ftp-site before I
|
||||
caught sight of his program).
|
||||
|
||||
|
||||
Copyright
|
||||
--------------------------------------------------------------
|
||||
Temperature.app is copyright (c) 2000-2002 by Per Liden and is
|
||||
licensed through the GNU General Public License. Read the
|
||||
Temperature.app is copyright (c) 2000-2002 by Per Liden and is
|
||||
licensed through the GNU General Public License. Read the
|
||||
COPYING file for the complete license.
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
//
|
||||
// Temperature.app
|
||||
//
|
||||
//
|
||||
// Copyright (c) 2000-2002 Per Liden
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
|
@ -15,7 +15,7 @@
|
|||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
//
|
||||
|
||||
|
@ -40,12 +40,12 @@
|
|||
|
||||
volatile static ChildStatus childStatus;
|
||||
|
||||
static void catchBrokenPipe(int sig)
|
||||
static void catchBrokenPipe(int sig)
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
||||
static void catchChildExit(int sig)
|
||||
static void catchChildExit(int sig)
|
||||
{
|
||||
int status;
|
||||
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;
|
||||
XSizeHints sizeHints;
|
||||
|
@ -163,14 +163,14 @@ Temperature::Temperature(int argc, char** argv)
|
|||
std::cerr << APPNAME << ": could not open display " << displayName << std::endl;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
// Get root window
|
||||
mRoot = RootWindow(mDisplay, DefaultScreen(mDisplay));
|
||||
|
||||
// Create windows
|
||||
mAppWin = XCreateSimpleWindow(mDisplay, mRoot, 1, 1, 64, 64, 0, 0, 0);
|
||||
mIconWin = XCreateSimpleWindow(mDisplay, mAppWin, 0, 0, 64, 64, 0, 0, 0);
|
||||
|
||||
|
||||
// Set classhint
|
||||
classHint.res_name = mInstanceName;
|
||||
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;
|
||||
}
|
||||
|
||||
void Temperature::showHelp()
|
||||
void Temperature::showHelp()
|
||||
{
|
||||
std::cerr << APPNAME << " Copyright (c) 2000-2002 by Per Liden (per@fukt.bth.se)" << std::endl << std::endl
|
||||
<< "options:" << std::endl
|
||||
|
@ -241,7 +241,7 @@ void Temperature::showHelp()
|
|||
<< " -n <name> set client instance name" << std::endl
|
||||
<< " -d <disp> set display" << 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
|
||||
<< "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
|
||||
|
@ -294,7 +294,7 @@ void Temperature::setTime(char* utcTime)
|
|||
{
|
||||
char unit[3];
|
||||
int hour = 0;
|
||||
int min = 0;
|
||||
int min = 0;
|
||||
|
||||
strncpy(unit, &utcTime[0], 2);
|
||||
hour = atoi(unit);
|
||||
|
@ -319,7 +319,7 @@ void Temperature::setTime(char* utcTime)
|
|||
|
||||
if (mTime12HourFormat) {
|
||||
if (hour >= 0 && hour <= 11) {
|
||||
mTimeAMPM = "AM";
|
||||
mTimeAMPM = "AM";
|
||||
} else {
|
||||
mTimeAMPM = "PM";
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ bool Temperature::updateTemperture(ifstream& file)
|
|||
strncpy(time, start - 5, 4);
|
||||
setTime(time);
|
||||
}
|
||||
|
||||
|
||||
// Find temperature
|
||||
while (!file.eof()) {
|
||||
file >> buffer;
|
||||
|
@ -365,7 +365,7 @@ bool Temperature::updateTemperture(ifstream& file)
|
|||
sprintf(mTemperature, "%d", (int)rint((atoi(buffer) - 32) / 1.8));
|
||||
unit = " °C";
|
||||
}
|
||||
|
||||
|
||||
Xpm* image = new Xpm(mDisplay, mRoot, main_xpm);
|
||||
if (mShowTime) {
|
||||
if (mTime12HourFormat) {
|
||||
|
@ -389,7 +389,7 @@ bool Temperature::updateTemperture(ifstream& file)
|
|||
return false;
|
||||
}
|
||||
|
||||
void Temperature::run()
|
||||
void Temperature::run()
|
||||
{
|
||||
if (mShowTime) {
|
||||
calcTimeDiff();
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
//
|
||||
// Temperature.app
|
||||
//
|
||||
//
|
||||
// Copyright (c) 2000-2002 Per Liden
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
|
@ -15,7 +15,7 @@
|
|||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
//
|
||||
|
||||
|
@ -47,9 +47,9 @@ using namespace std;
|
|||
|
||||
enum ChildStatus
|
||||
{
|
||||
ChildRunning,
|
||||
ChildDone,
|
||||
ChildError
|
||||
ChildRunning,
|
||||
ChildDone,
|
||||
ChildError
|
||||
};
|
||||
|
||||
class Temperature
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
//
|
||||
// Temperature.app
|
||||
//
|
||||
//
|
||||
// Copyright (c) 2000-2002 Per Liden
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
|
@ -15,7 +15,7 @@
|
|||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
//
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
|||
#include "Temperature.h"
|
||||
#include "Xpm.h"
|
||||
|
||||
Xpm::Xpm(Display* display, Window root, char** data)
|
||||
Xpm::Xpm(Display* display, Window root, char** data)
|
||||
{
|
||||
int error;
|
||||
|
||||
|
@ -65,7 +65,7 @@ Xpm::Xpm(Display* display, Window root, char** data)
|
|||
}
|
||||
}
|
||||
|
||||
Xpm::~Xpm()
|
||||
Xpm::~Xpm()
|
||||
{
|
||||
if (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);
|
||||
XSetWindowBackgroundPixmap(mDisplay, win, mImage);
|
||||
XClearWindow(mDisplay, win);
|
||||
}
|
||||
|
||||
void Xpm::setWindowPixmapShaped(Window win)
|
||||
void Xpm::setWindowPixmapShaped(Window win)
|
||||
{
|
||||
XResizeWindow(mDisplay, win, mAttributes.width, mAttributes.height);
|
||||
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;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
gcv.foreground = WhitePixel(mDisplay, DefaultScreen(mDisplay));
|
||||
gc = XCreateGC(mDisplay, mImage, GCForeground, &gcv);
|
||||
|
||||
int strLength = strlen(str);
|
||||
int strWidth = XTextWidth(fontStruct, str, strLength);
|
||||
|
||||
|
||||
int x = (64 / 2) - (strWidth / 2);
|
||||
XSetFont(mDisplay, gc, fontStruct->fid);
|
||||
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;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
gcv.foreground = WhitePixel(mDisplay, DefaultScreen(mDisplay));
|
||||
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 str2Length = strlen(str2);
|
||||
int str2Width = XTextWidth(fontStruct2, str2, str2Length);
|
||||
|
||||
|
||||
int x = (64 / 2) - ((str1Width + str2Width) / 2);
|
||||
XSetFont(mDisplay, gc, fontStruct1->fid);
|
||||
XDrawString(mDisplay, mImage, gc, x, pos, str1, str1Length);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
//
|
||||
// Temperature.app
|
||||
//
|
||||
//
|
||||
// Copyright (c) 2000-2002 Per Liden
|
||||
//
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
|
@ -15,7 +15,7 @@
|
|||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
//
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
|||
#include <X11/Xlib.h>
|
||||
#include <X11/xpm.h>
|
||||
|
||||
class Xpm
|
||||
class Xpm
|
||||
{
|
||||
public:
|
||||
Xpm(Display* display, Window root, char** data);
|
||||
|
|
|
@ -32,10 +32,10 @@ Version 1.23 - released March 20, 1999.
|
|||
|
||||
Version 1.22 - released February 24, 1999.
|
||||
Added double click detection and -e command-line option.
|
||||
|
||||
|
||||
Version 1.21 - released February 4, 1999.
|
||||
cosmetic for AfterStep users. removed spurious black line at RHS edge an mask.
|
||||
|
||||
|
||||
Version 1.2 - released January 14, 1999.
|
||||
Changed support for LowColor Pixmap. Now, check for Depth
|
||||
automatically. If its <= 8, then use LowColor.
|
||||
|
|
|
@ -21,14 +21,14 @@ usage: wmCalClock [-b <Volume>] [-tc <Color>] [-bc <Color>] [-e "Command"] [-S]
|
|||
-S Do not show seconds.
|
||||
-24 Show 24-hour time. Default is 12 hour AM/PM Time.
|
||||
-g Show Greenwich time.
|
||||
-s Show Greenwich Mean Sidereal Time (GMST) in 24-hour format.
|
||||
-L <Longitude> Show Local Sidereal Time (LST) 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.
|
||||
Longitude is in degrees (- for West + for East).
|
||||
-l Use a low-color pixmap to conserve colors. On 8-bit displays the
|
||||
low color pixmap will always be used.
|
||||
-h Display help screen.
|
||||
|
||||
Example: wmCalClock -b 100 -tc #001100 -bc #7e9e69
|
||||
Example: wmCalClock -b 100 -tc #001100 -bc #7e9e69
|
||||
|
||||
|
||||
WindowMaker.
|
||||
|
@ -38,12 +38,12 @@ In WindowMaker simply drag and drop the wmCalClock App on the WindowMaker Dock o
|
|||
|
||||
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...
|
||||
|
||||
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
|
||||
our fault, but a Wharf problem!
|
||||
our fault, but a Wharf problem!
|
||||
|
||||
Other window managers.
|
||||
----------------------
|
||||
|
|
|
@ -10,8 +10,8 @@ Installation
|
|||
1) gunzip wmCalClock-x.xx.tar.gz
|
||||
1) tar -xvf wmCalClock-x.xx.tar
|
||||
2) cd wmCalClock-x.xx/Src/
|
||||
3) make
|
||||
4) make install (must be root)
|
||||
3) make
|
||||
4) make install (must be root)
|
||||
5) wmCalClock & (or 'wmCalClock -h' for help, or 'man wmCalClock' for the man page)
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
wmCalClock-1.24 release
|
||||
-----------------------
|
||||
Author....: Michael G. Henderson <mghenderson@lanl.gov>
|
||||
|
||||
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
wmCalClock is a simple Calendar Clock that uses anti-aliased characters and
|
||||
|
@ -18,7 +18,7 @@ BUGS Bug reports
|
|||
CHANGES Change history.
|
||||
COPYING GNU General Public License Version 2.
|
||||
TODO Wish list.
|
||||
|
||||
|
||||
|
||||
Bugs
|
||||
-----
|
||||
|
|
|
@ -21,7 +21,7 @@ OBJS = wmCalClock.o \
|
|||
all: wmCalClock.o wmCalClock
|
||||
|
||||
wmCalClock.o: wmCalClock_master.xpm wmCalClock_mask.xbm
|
||||
wmCalClock: $(OBJS)
|
||||
wmCalClock: $(OBJS)
|
||||
$(CC) $(COPTS) $(SYSTEM) -o wmCalClock $^ $(INCDIR) $(LIBDIR) $(LIBS)
|
||||
|
||||
clean:
|
||||
|
@ -32,5 +32,5 @@ clean:
|
|||
|
||||
install:: wmCalClock
|
||||
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
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ OBJS = wmCalClock.o \
|
|||
all: wmCalClock.o wmCalClock
|
||||
|
||||
wmCalClock.o: wmCalClock_master.xpm wmCalClock_mask.xbm
|
||||
wmCalClock: $(OBJS)
|
||||
wmCalClock: $(OBJS)
|
||||
$(CC) $(COPTS) $(SYSTEM) -o wmCalClock $(OBJS) $(INCDIR) $(LIBDIR) $(LIBS)
|
||||
|
||||
clean:
|
||||
|
@ -32,5 +32,5 @@ clean:
|
|||
|
||||
install:: wmCalClock
|
||||
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
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ OBJS = wmCalClock.o \
|
|||
all: wmCalClock.o wmCalClock
|
||||
|
||||
wmCalClock.o: wmCalClock_master.xpm wmCalClock_mask.xbm
|
||||
wmCalClock: $(OBJS)
|
||||
wmCalClock: $(OBJS)
|
||||
$(CC) $(COPTS) $(SYSTEM) -o wmCalClock $^ $(INCDIR) $(LIBDIR) $(LIBS)
|
||||
|
||||
clean:
|
||||
|
@ -32,5 +32,5 @@ clean:
|
|||
|
||||
install:: wmCalClock
|
||||
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
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.TH WMCALCLOCK 1 "16 December 1998"
|
||||
.TH WMCALCLOCK 1 "16 December 1998"
|
||||
.SH NAME
|
||||
WMCALCLOCK \- Dockable Calendar Clock
|
||||
.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]
|
||||
.SH DESCRIPTION
|
||||
.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
|
||||
.TP
|
||||
.B \-h
|
||||
|
@ -19,31 +19,31 @@ Use an alternate X Display.
|
|||
Beep on the hour with specified volume (between -100 and 100).
|
||||
.TP
|
||||
.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).
|
||||
.TP
|
||||
.B \-24
|
||||
Show time in 24-hour format instead of default 12-hour AM/PM format.
|
||||
.TP
|
||||
.B \-s
|
||||
Show Greenwich Mean Sidereal Time (GMST) in 24-hour format.
|
||||
Show Greenwich Mean Sidereal Time (GMST) in 24-hour format.
|
||||
.TP
|
||||
.B \-S
|
||||
Dont show seconds.
|
||||
.TP
|
||||
.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).
|
||||
.TP
|
||||
.B \-l
|
||||
.B \-l
|
||||
Force use of lower color pixmap to conserve colors. On displays with <= 8 bits,
|
||||
the low color Pixmap will always be used.
|
||||
.TP
|
||||
.B \-tc <color>
|
||||
Change color of time-field digits.
|
||||
Change color of time-field digits.
|
||||
.TP
|
||||
.B \-bc <color>
|
||||
Change color of time-field background.
|
||||
Change color of time-field background.
|
||||
.TP
|
||||
.B \-tekton
|
||||
Use the Tekton font for time field.
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/*
|
||||
*
|
||||
* wmCalClock-1.25 (C) 1998, 1999 Mike Henderson (mghenderson@lanl.gov)
|
||||
*
|
||||
*
|
||||
* - Its a Calendar Clock....
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* 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
|
||||
|
@ -19,7 +19,7 @@
|
|||
*
|
||||
* 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
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
*
|
||||
|
@ -31,10 +31,10 @@
|
|||
*
|
||||
* Version 1.24 - released March 27, 1999.
|
||||
* Added support for additional fonts for time field;
|
||||
*
|
||||
*
|
||||
* -tekton for Tekton
|
||||
* -arial for Arial (Helvetica) (this is the same font as usual)
|
||||
* -luggerbug for LuggerBug
|
||||
* -luggerbug for LuggerBug
|
||||
* -comicsans for ComicSans
|
||||
* -jazz for JazzPoster
|
||||
*
|
||||
|
@ -66,7 +66,7 @@
|
|||
*
|
||||
* Version 1.10 - released January 7, 1999.
|
||||
* 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.)
|
||||
*
|
||||
* Version 1.02 - released January 7, 1999.
|
||||
|
@ -84,8 +84,8 @@
|
|||
|
||||
|
||||
|
||||
/*
|
||||
* Includes
|
||||
/*
|
||||
* Includes
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
@ -101,8 +101,8 @@
|
|||
|
||||
|
||||
|
||||
/*
|
||||
* Delay between refreshes (in microseconds)
|
||||
/*
|
||||
* Delay between refreshes (in microseconds)
|
||||
*/
|
||||
#define DELAY 10000L
|
||||
#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 xeMonth[12] = { 168, 188, 210, 231, 254, 275, 292, 314, 335, 355, 377, 398 };
|
||||
int xdMonth[12];
|
||||
int yMonth = 80;
|
||||
int yMonth = 80;
|
||||
int ydMonth = 13;
|
||||
|
||||
int xsDayOfWeek[7] = { 293, 150, 177, 201, 228, 253, 271 };
|
||||
int xeDayOfWeek[7] = { 314, 175, 199, 226, 250, 269, 290 };
|
||||
int xdDayOfWeek[7];
|
||||
int yDayOfWeek = 95;
|
||||
int yDayOfWeek = 95;
|
||||
int ydDayOfWeek = 13;
|
||||
|
||||
/*
|
||||
|
@ -163,7 +163,7 @@ int ydDayOfMonth = 23;
|
|||
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Luggerbug Font Narrow - 13 pixels high.
|
||||
*/
|
||||
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 ydDigits_Luggerbug13n = 13;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Luggerbug Font - 13 pixels high.
|
||||
*/
|
||||
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 ydDigits_Luggerbug13 = 13;
|
||||
|
||||
/*
|
||||
/*
|
||||
* ComicSans Font - 12 pixels high.
|
||||
*/
|
||||
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 ydDigits_ComicSans12n = 12;
|
||||
|
||||
/*
|
||||
/*
|
||||
* ComicSans Font - 11 pixels high.
|
||||
*/
|
||||
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 ydDigits_ComicSans11 = 11;
|
||||
|
||||
/*
|
||||
/*
|
||||
* JazzPoster Font Narrow - 12 pixels high.
|
||||
*/
|
||||
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 ydDigits_JazzPoster12n = 12;
|
||||
|
||||
/*
|
||||
/*
|
||||
* JazzPoster Font - 12 pixels high.
|
||||
*/
|
||||
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;
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* 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 };
|
||||
|
@ -227,7 +227,7 @@ int xdDigits_Tekton12n[11];
|
|||
int yDigits_Tekton12n = 122;
|
||||
int ydDigits_Tekton12n = 13;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Tekton Font - 12 pixels high.
|
||||
*/
|
||||
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[]) {
|
||||
|
||||
|
@ -422,12 +422,12 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
initXwindow(argc, argv);
|
||||
if (DisplayDepth <= 8) UseLowColorPixmap = 1;
|
||||
|
||||
|
@ -440,7 +440,7 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 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...
|
||||
*
|
||||
*/
|
||||
|
@ -522,7 +522,7 @@ int main(int argc, char *argv[]) {
|
|||
Flag = (Hours >= 12) ? 1 : 0;
|
||||
if (Hours == 0)
|
||||
Hours = 12;
|
||||
else
|
||||
else
|
||||
Hours = (Hours > 12) ? Hours-12 : Hours;
|
||||
}
|
||||
|
||||
|
@ -552,10 +552,10 @@ int main(int argc, char *argv[]) {
|
|||
copyXPMArea(5, 110, 54, 15, 5, 5);
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Draw Hours
|
||||
*/
|
||||
|
||||
|
||||
/* dont show leading zeros */
|
||||
if (D[0] > -1){
|
||||
digit = D[0];
|
||||
|
@ -567,14 +567,14 @@ int main(int argc, char *argv[]) {
|
|||
copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady);
|
||||
xoff += (xdDigits[digit]+1);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Draw Colon
|
||||
*/
|
||||
digit = 10;
|
||||
copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady);
|
||||
xoff += (xdDigits[digit]+1);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Draw Minutes
|
||||
*/
|
||||
digit = D[3];
|
||||
|
@ -587,14 +587,14 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
if (ShowSeconds){
|
||||
|
||||
/*
|
||||
/*
|
||||
* Draw Colon
|
||||
*/
|
||||
digit = 10;
|
||||
copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady);
|
||||
xoff += (xdDigits[digit]+1);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Draw Seconds
|
||||
*/
|
||||
digit = D[6];
|
||||
|
@ -625,7 +625,7 @@ int main(int argc, char *argv[]) {
|
|||
if (Beep){
|
||||
if ((Mins == 0)&&(Secs == 0)&&(OldSecs != Secs)) XBell(display, Volume);
|
||||
OldSecs = Secs;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -642,18 +642,18 @@ int main(int argc, char *argv[]) {
|
|||
copyXPMArea(5, 70, 54, 35, 5, 24);
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Draw Day of Week and Month
|
||||
*/
|
||||
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);
|
||||
copyXPMArea(xsMonth[Month], yMonth, xdMonth[Month],
|
||||
copyXPMArea(xsMonth[Month], yMonth, xdMonth[Month],
|
||||
ydMonth, 33-wid/2+xdDayOfWeek[DayOfWeek]+1, 64-24-4-12);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Draw Day of Month
|
||||
*/
|
||||
copyXPMArea(xsDayOfMonth[DayOfMonth], yDayOfMonth[DayOfMonth], xdDayOfMonth[DayOfMonth], ydDayOfMonth, 32-xdDayOfMonth2[DayOfMonth]/2, 36);
|
||||
|
@ -670,7 +670,7 @@ int main(int argc, char *argv[]) {
|
|||
} else {
|
||||
|
||||
/*
|
||||
* Update the counter.
|
||||
* Update the counter.
|
||||
*/
|
||||
++n;
|
||||
|
||||
|
@ -700,7 +700,7 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Process any pending X events.
|
||||
*/
|
||||
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();
|
||||
if( HasExecute == 1) {
|
||||
|
@ -748,13 +748,13 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
|
||||
|
||||
/*
|
||||
* ParseCMDLine()
|
||||
/*
|
||||
* ParseCMDLine()
|
||||
*/
|
||||
void ParseCMDLine(int argc, char *argv[]) {
|
||||
|
||||
int i;
|
||||
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
|
||||
if (!strcmp(argv[i], "-display")){
|
||||
|
@ -857,8 +857,8 @@ int i;
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
if (!ShowSeconds && !UseArial && !UseJazzPoster
|
||||
|
||||
if (!ShowSeconds && !UseArial && !UseJazzPoster
|
||||
&& !UseComicSans && !UseLuggerbug) UseTekton = 1;
|
||||
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
int DblClkDelay;
|
||||
- int HasExecute = 0; /* controls perf optimization */
|
||||
char ExecuteCommand[1024];
|
||||
|
||||
|
||||
|
||||
|
||||
--- 272,277 ----
|
||||
***************
|
||||
*** 451,457 ****
|
||||
|
@ -16,20 +16,20 @@
|
|||
*
|
||||
*/
|
||||
! if ( HasExecute == 0 || n>10){
|
||||
|
||||
|
||||
n = 0;
|
||||
|
||||
|
||||
--- 450,456 ----
|
||||
* to catch expose events, etc...
|
||||
*
|
||||
*/
|
||||
! if (n>10){
|
||||
|
||||
|
||||
n = 0;
|
||||
|
||||
|
||||
***************
|
||||
*** 722,734 ****
|
||||
* Redraw and wait for next update
|
||||
* Redraw and wait for next update
|
||||
*/
|
||||
RedrawWindow();
|
||||
! if( HasExecute == 1) {
|
||||
|
@ -39,16 +39,16 @@
|
|||
! } else {
|
||||
! usleep( 500000L);
|
||||
! }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
--- 721,727 ----
|
||||
* Redraw and wait for next update
|
||||
* Redraw and wait for next update
|
||||
*/
|
||||
RedrawWindow();
|
||||
! usleep(DELAY);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
***************
|
||||
*** 817,823 ****
|
||||
|
@ -56,15 +56,15 @@
|
|||
}
|
||||
strcpy(ExecuteCommand, argv[++i]);
|
||||
- HasExecute = 1;
|
||||
|
||||
|
||||
} else if (!strcmp(argv[i], "-g")){
|
||||
|
||||
|
||||
--- 810,815 ----
|
||||
***************
|
||||
*** 975,981 ****
|
||||
char Command[512];
|
||||
|
||||
|
||||
|
||||
|
||||
- if( HasExecute == 0) return; /* no command specified. Ignore clicks. */
|
||||
DblClkDelay = 0;
|
||||
if ((xev->button == Button1) && (xev->type == ButtonPress)){
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
* 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
|
||||
* (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 <stdio.h>
|
||||
#include <string.h>
|
||||
|
@ -42,7 +42,7 @@
|
|||
|
||||
|
||||
/*
|
||||
* X11 Variables
|
||||
* X11 Variables
|
||||
*/
|
||||
int x_fd;
|
||||
XSizeHints mysizehints;
|
||||
|
@ -93,7 +93,7 @@ static int flush_expose(Window w) {
|
|||
* RedrawWindowXY
|
||||
*/
|
||||
void RedrawWindow(void) {
|
||||
|
||||
|
||||
flush_expose(iconwin);
|
||||
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) {
|
||||
|
||||
|
||||
flush_expose(iconwin);
|
||||
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
|
||||
*/
|
||||
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) {
|
||||
|
||||
unsigned int borderwidth = 1;
|
||||
|
@ -189,9 +189,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
|
|||
{"Color9", NULL, 0}};
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
/*
|
||||
* Create Pixmap
|
||||
*/
|
||||
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.exactColors = False;
|
||||
wmgen.attributes.closeness = 40000;
|
||||
wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols
|
||||
wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols
|
||||
| XpmExactColors | XpmCloseness | XpmSize;
|
||||
if (XpmCreatePixmapFromData(display, Root, pixmap_bytes,
|
||||
if (XpmCreatePixmapFromData(display, Root, pixmap_bytes,
|
||||
&(wmgen.pixmap), &(wmgen.mask), &(wmgen.attributes)) != XpmSuccess){
|
||||
fprintf(stderr, "Not enough free colorcells.\n");
|
||||
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.x = 0;
|
||||
|
@ -235,19 +235,19 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
|
|||
|
||||
mysizehints.width = 64;
|
||||
mysizehints.height = 64;
|
||||
|
||||
|
||||
|
||||
|
||||
win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
|
||||
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
|
||||
|
||||
|
||||
iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
|
||||
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Activate hints
|
||||
/*
|
||||
* Activate hints
|
||||
*/
|
||||
XSetWMNormalHints(display, win, &mysizehints);
|
||||
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
|
||||
* it after you are done...
|
||||
*/
|
||||
XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask
|
||||
| PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask
|
||||
XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask
|
||||
| PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask
|
||||
| KeyPressMask | KeyReleaseMask);
|
||||
XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask
|
||||
| PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask
|
||||
XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask
|
||||
| PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask
|
||||
| KeyPressMask | KeyReleaseMask);
|
||||
|
||||
|
||||
|
@ -278,8 +278,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
|
|||
|
||||
XSetWMName(display, win, &name);
|
||||
|
||||
/*
|
||||
* Create Graphics Context (GC) for drawing
|
||||
/*
|
||||
* Create Graphics Context (GC) for drawing
|
||||
*/
|
||||
gcm = GCForeground | GCBackground | GCGraphicsExposures;
|
||||
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;
|
||||
XAllocColor(display, Attributes.colormap, &Color);
|
||||
|
||||
|
||||
|
||||
*red = Color.red;
|
||||
*grn = Color.green;
|
||||
*blu = Color.blue;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
|
||||
/*
|
||||
* Typedefs
|
||||
* Typedefs
|
||||
*/
|
||||
typedef struct {
|
||||
Pixmap pixmap;
|
||||
|
@ -21,7 +21,7 @@ typedef struct {
|
|||
Display *display;
|
||||
Window Root;
|
||||
Window iconwin, win;
|
||||
int screen;
|
||||
int screen;
|
||||
int DisplayDepth;
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
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)?
|
||||
|
||||
- Allow fonts to be added externally via some sort of config file...
|
||||
|
@ -9,17 +9,17 @@ TODO List
|
|||
- Add alarm clock mode?
|
||||
|
||||
- graphical Moon-Phase Icon in Calendar section.
|
||||
|
||||
|
||||
- Day numbers in Calendar section. This is something that I would really like myself!
|
||||
|
||||
- Allow Changing of fonts/colors for the main Calendar section.
|
||||
|
||||
- Foreign language support...
|
||||
|
||||
|
||||
- Add indicators for Greenwich, sidereal, local sideareal time displays (right now
|
||||
you dont really know what it is displaying just by looking at it)...
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
copyright notice and this permission notice appear in supporting
|
||||
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.
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
CC = gcc
|
||||
CFLAGS = -O2 -Wall
|
||||
INCDIR =
|
||||
CFLAGS = -O2 -Wall
|
||||
INCDIR =
|
||||
DESTDIR= /usr
|
||||
LIBDIR =
|
||||
LIBDIR =
|
||||
LIBS = -lXpm -lX11 -lXext
|
||||
|
||||
OBJS = wmMatrix.o matrix.o xutils.o yarandom.o
|
||||
|
@ -14,7 +14,7 @@ all: wmMatrix
|
|||
|
||||
wmMatrix.o: wmMatrix_master.xpm wmMatrix_mask.xbm
|
||||
|
||||
wmMatrix: $(OBJS)
|
||||
wmMatrix: $(OBJS)
|
||||
$(CC) $(LDFLAGS) -o wmMatrix $^ $(LIBDIR) $(LIBS)
|
||||
|
||||
clean:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/* config.h.in --- xscreensaver, Copyright (c) 1998 Jamie Zawinski.
|
||||
*
|
||||
* 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'.
|
||||
*
|
||||
* If something goes very wrong, you can edit `config.h' directly, but beware
|
||||
|
@ -29,13 +29,13 @@
|
|||
/* #undef HAVE_XHPDISABLERESET */
|
||||
|
||||
/* 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.
|
||||
*
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
* XIDLE extension, this is recommended. (You have this extension if the
|
||||
* 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
|
||||
* idea to compile in support for it if you can.
|
||||
*/
|
||||
|
@ -147,7 +147,7 @@
|
|||
*/
|
||||
#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.)
|
||||
*/
|
||||
/* #undef HAVE_MESA_GL */
|
||||
|
@ -190,13 +190,13 @@
|
|||
/* #undef NO_LOCKING */
|
||||
|
||||
/* 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
|
||||
* 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
|
||||
* 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
|
||||
* need it.
|
||||
* need it.
|
||||
*/
|
||||
/* #undef HAVE_KERBEROS */
|
||||
|
||||
|
@ -226,8 +226,8 @@
|
|||
#define HAVE_SHADOW_PASSWD 1
|
||||
|
||||
/* 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>
|
||||
instead of in /etc/passwd, and one reads them with getprpwnam() instead
|
||||
Security'', that is, the passwords live in /tcb/files/auth/<x>/<xyz>
|
||||
instead of in /etc/passwd, and one reads them with getprpwnam() instead
|
||||
of getpwnam().
|
||||
*/
|
||||
/* #undef HAVE_ENHANCED_PASSWD */
|
||||
|
@ -238,7 +238,7 @@
|
|||
*/
|
||||
/* #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
|
||||
haven't tested this one, let me know if it works.
|
||||
*/
|
||||
|
|
|
@ -1,40 +1,40 @@
|
|||
#define matrix_width 14
|
||||
#define matrix_height 216
|
||||
static char matrix_bits[] = {
|
||||
0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x30, 0xfd, 0x34, 0xeb, 0x2c, 0xef, 0x35,
|
||||
0xeb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3b, 0xfb, 0x3b, 0xf7, 0x39,
|
||||
0xfb, 0x3b, 0xf7, 0x39, 0xfb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x35,
|
||||
0xeb, 0x38, 0xfb, 0x3d, 0xfb, 0x3b, 0xff, 0x31, 0xeb, 0x32, 0xff, 0x3f,
|
||||
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, 0x20, 0xff, 0x39, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3b, 0xf7, 0x31,
|
||||
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, 0x3f, 0xef, 0x3b, 0xfb, 0x31, 0xfb, 0x3b, 0xf7, 0x3b,
|
||||
0xef, 0x3b, 0xff, 0x37, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x35,
|
||||
0xeb, 0x20, 0xe7, 0x31, 0xeb, 0x28, 0xff, 0x35, 0xeb, 0x3b, 0xff, 0x3f,
|
||||
0xff, 0x3f, 0xff, 0x35, 0xeb, 0x28, 0xfb, 0x35, 0xeb, 0x28, 0xff, 0x39,
|
||||
0xef, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xef, 0x3b, 0xff, 0x37,
|
||||
0xeb, 0x2e, 0xcd, 0x24, 0xef, 0x2a, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d,
|
||||
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, 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, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f,
|
||||
0xff, 0x3f, 0xff, 0x35, 0xeb, 0x28, 0xd7, 0x21, 0xeb, 0x20, 0xff, 0x35,
|
||||
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, 0x3a, 0xf3, 0x30, 0xea, 0x28, 0xff, 0x35, 0xeb, 0x2f, 0xff, 0x3f,
|
||||
0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x3a, 0xf5, 0x30, 0xeb, 0x28, 0xff, 0x39,
|
||||
0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x37, 0xef, 0x33, 0xf7, 0x33,
|
||||
0xef, 0x2b, 0xef, 0x31, 0xfb, 0x2a, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d,
|
||||
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, 0xff, 0x3f, 0xfd, 0x34, 0xeb, 0x2a, 0xf7, 0x33,
|
||||
0xef, 0x3b, 0xff, 0x37, 0xff, 0x3f, 0xff, 0x3f, 0xef, 0x2b, 0xff, 0x31,
|
||||
0xeb, 0x22, 0xf7, 0x31, 0xef, 0x2b, 0xff, 0x31, 0xff, 0x3b, 0xff, 0x3f,
|
||||
0xfe, 0x3e, 0xff, 0x20, 0xeb, 0x2a, 0xff, 0x3d, 0xff, 0x2a, 0xff, 0x23,
|
||||
0xef, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x2d, 0xeb, 0x2b, 0xf7, 0x33,
|
||||
0xeb, 0x28, 0xff, 0x3d, 0xff, 0x3f, 0xff, 0x3f, 0xfe, 0x3e, 0xfd, 0x3c,
|
||||
0xfb, 0x2c, 0xff, 0x35, 0xfb, 0x3b, 0xff, 0x37, 0xff, 0x2f, 0xff, 0x3f,
|
||||
0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x30, 0xfd, 0x34, 0xeb, 0x2c, 0xef, 0x35,
|
||||
0xeb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3b, 0xfb, 0x3b, 0xf7, 0x39,
|
||||
0xfb, 0x3b, 0xf7, 0x39, 0xfb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x35,
|
||||
0xeb, 0x38, 0xfb, 0x3d, 0xfb, 0x3b, 0xff, 0x31, 0xeb, 0x32, 0xff, 0x3f,
|
||||
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, 0x20, 0xff, 0x39, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3b, 0xf7, 0x31,
|
||||
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, 0x3f, 0xef, 0x3b, 0xfb, 0x31, 0xfb, 0x3b, 0xf7, 0x3b,
|
||||
0xef, 0x3b, 0xff, 0x37, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x35,
|
||||
0xeb, 0x20, 0xe7, 0x31, 0xeb, 0x28, 0xff, 0x35, 0xeb, 0x3b, 0xff, 0x3f,
|
||||
0xff, 0x3f, 0xff, 0x35, 0xeb, 0x28, 0xfb, 0x35, 0xeb, 0x28, 0xff, 0x39,
|
||||
0xef, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xef, 0x3b, 0xff, 0x37,
|
||||
0xeb, 0x2e, 0xcd, 0x24, 0xef, 0x2a, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d,
|
||||
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, 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, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f,
|
||||
0xff, 0x3f, 0xff, 0x35, 0xeb, 0x28, 0xd7, 0x21, 0xeb, 0x20, 0xff, 0x35,
|
||||
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, 0x3a, 0xf3, 0x30, 0xea, 0x28, 0xff, 0x35, 0xeb, 0x2f, 0xff, 0x3f,
|
||||
0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x3a, 0xf5, 0x30, 0xeb, 0x28, 0xff, 0x39,
|
||||
0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x37, 0xef, 0x33, 0xf7, 0x33,
|
||||
0xef, 0x2b, 0xef, 0x31, 0xfb, 0x2a, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d,
|
||||
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, 0xff, 0x3f, 0xfd, 0x34, 0xeb, 0x2a, 0xf7, 0x33,
|
||||
0xef, 0x3b, 0xff, 0x37, 0xff, 0x3f, 0xff, 0x3f, 0xef, 0x2b, 0xff, 0x31,
|
||||
0xeb, 0x22, 0xf7, 0x31, 0xef, 0x2b, 0xff, 0x31, 0xff, 0x3b, 0xff, 0x3f,
|
||||
0xfe, 0x3e, 0xff, 0x20, 0xeb, 0x2a, 0xff, 0x3d, 0xff, 0x2a, 0xff, 0x23,
|
||||
0xef, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x2d, 0xeb, 0x2b, 0xf7, 0x33,
|
||||
0xeb, 0x28, 0xff, 0x3d, 0xff, 0x3f, 0xff, 0x3f, 0xfe, 0x3e, 0xfd, 0x3c,
|
||||
0xfb, 0x2c, 0xff, 0x35, 0xfb, 0x3b, 0xff, 0x37, 0xff, 0x2f, 0xff, 0x3f,
|
||||
};
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* 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.
|
||||
*
|
||||
* Matrix -- simulate the text scrolls from the movie "The Matrix".
|
||||
|
@ -169,8 +169,8 @@ static void feed_matrix(m_state * state)
|
|||
|
||||
int x;
|
||||
|
||||
/*
|
||||
* Update according to current feeders.
|
||||
/*
|
||||
* Update according to current feeders.
|
||||
*/
|
||||
for (x = 0; x < state->grid_width; x++) {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.TH WMMATRIX 1 "September 1999"
|
||||
.TH WMMATRIX 1 "September 1999"
|
||||
.SH NAME
|
||||
wmMatrix \- Dockable Matrix Display
|
||||
.SH SYNOPSIS
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
* 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
|
||||
* (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"
|
||||
|
||||
/*
|
||||
* X11 Variables
|
||||
* X11 Variables
|
||||
*/
|
||||
int x_fd;
|
||||
XSizeHints mysizehints;
|
||||
|
@ -168,7 +168,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
|
|||
{"Color9", NULL, 0}
|
||||
};
|
||||
|
||||
/*
|
||||
/*
|
||||
* Create Pixmap
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
* Create a window
|
||||
/*
|
||||
* Create a window
|
||||
*/
|
||||
mysizehints.flags = USSize | USPosition;
|
||||
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,
|
||||
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
|
||||
|
||||
/*
|
||||
* Activate hints
|
||||
/*
|
||||
* Activate hints
|
||||
*/
|
||||
XSetWMNormalHints(display, win, &mysizehints);
|
||||
classHint.res_name = wname;
|
||||
|
@ -240,8 +240,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
|
|||
|
||||
XSetWMName(display, win, &name);
|
||||
|
||||
/*
|
||||
* Create Graphics Context (GC) for drawing
|
||||
/*
|
||||
* Create Graphics Context (GC) for drawing
|
||||
*/
|
||||
gcm = GCForeground | GCBackground | GCGraphicsExposures;
|
||||
gcv.foreground = fore_pix;
|
||||
|
@ -249,8 +249,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
|
|||
gcv.graphics_exposures = 0;
|
||||
NormalGC = XCreateGC(display, Root, gcm, &gcv);
|
||||
|
||||
/*
|
||||
* Create Graphics Context (GC) for erasing
|
||||
/*
|
||||
* Create Graphics Context (GC) for erasing
|
||||
*/
|
||||
gcm = GCForeground | GCBackground | GCGraphicsExposures;
|
||||
gcv.foreground = back_pix;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define WMGENERAL_H_INCLUDED
|
||||
|
||||
/*
|
||||
* Typedefs
|
||||
* Typedefs
|
||||
*/
|
||||
typedef struct {
|
||||
Pixmap pixmap;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
- Improved processing of command line options - unknown options and
|
||||
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
|
||||
supported.
|
||||
- man page improved and edited Makefile so man page will get installed as well
|
||||
|
@ -29,4 +29,4 @@
|
|||
2.9.1
|
||||
|
||||
- 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.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#(c)1999-2003 redseb
|
||||
#(c)1999-2003 redseb
|
||||
# Adapted for wmSMPmon 2.9.x and higher: Thomas Ribbrock
|
||||
|
||||
# Change the following two to determine installation location
|
||||
|
@ -33,7 +33,7 @@ $(OBJ): %.o : %.c
|
|||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -rf $(EXE)
|
||||
rm -rf $(EXE)
|
||||
rm -rf *.o
|
||||
rm -rf ../wmgeneral/*.o
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
/*######################################################################
|
||||
# #
|
||||
# This file contains some general utility functions for wmSMPmon. #
|
||||
# #
|
||||
# All of them were taken from the program 'top' from the procps #
|
||||
# suite. #
|
||||
# With thanks to the author of top: #
|
||||
# James C. Warner <warnerjc@worldnet.att.net> #
|
||||
# #
|
||||
/*######################################################################
|
||||
# #
|
||||
# This file contains some general utility functions for wmSMPmon. #
|
||||
# #
|
||||
# All of them were taken from the program 'top' from the procps #
|
||||
# suite. #
|
||||
# With thanks to the author of top: #
|
||||
# James C. Warner <warnerjc@worldnet.att.net> #
|
||||
# #
|
||||
# This file is placed under the conditions of the GNU Library #
|
||||
# General Public License, version 2, or any later version. #
|
||||
# See file COPYING for information on distribution conditions. #
|
||||
# #
|
||||
# #
|
||||
######################################################################*/
|
||||
|
||||
#include "standards.h"
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
/*######################################################################
|
||||
# #
|
||||
# This file contains the definitions of the functions that wmSMPmon #
|
||||
# uses to determine CPU load, memory and swap information. #
|
||||
# All functions should be implemented by any OS dependent module #
|
||||
# that is added to wmSMPmon. See sysinfo-linux.c as an example. #
|
||||
# #
|
||||
# (c) 2004 Thomas Ribbrock <emgaron@gmx.net> #
|
||||
# #
|
||||
/*######################################################################
|
||||
# #
|
||||
# This file contains the definitions of the functions that wmSMPmon #
|
||||
# uses to determine CPU load, memory and swap information. #
|
||||
# All functions should be implemented by any OS dependent module #
|
||||
# that is added to wmSMPmon. See sysinfo-linux.c as an example. #
|
||||
# #
|
||||
# (c) 2004 Thomas Ribbrock <emgaron@gmx.net> #
|
||||
# #
|
||||
# This file is placed under the conditions of the GNU Library #
|
||||
# General Public License, version 2, or any later version. #
|
||||
# See file COPYING for information on distribution conditions. #
|
||||
# #
|
||||
# #
|
||||
######################################################################*/
|
||||
|
||||
#ifndef WMSMP_STANDARDS_H
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* Now supports >256 colors
|
||||
11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl)
|
||||
* 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.
|
||||
* Changed the needed geometry string.
|
||||
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),
|
||||
&(wmgen->mask), &(wmgen->attributes));
|
||||
|
||||
|
||||
if (err != XpmSuccess) {
|
||||
fprintf(stderr, "Not enough free colorcells.\n");
|
||||
exit(1);
|
||||
|
@ -224,9 +224,9 @@ static int flush_expose(Window w) {
|
|||
\***************************************************************************/
|
||||
|
||||
void RedrawWindow(void) {
|
||||
|
||||
|
||||
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);
|
||||
flush_expose(win);
|
||||
XCopyArea(display, wmgen.pixmap, win, NormalGC,
|
||||
|
@ -238,9 +238,9 @@ void RedrawWindow(void) {
|
|||
\***************************************************************************/
|
||||
|
||||
void RedrawWindowXY(int x, int y) {
|
||||
|
||||
|
||||
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);
|
||||
flush_expose(win);
|
||||
XCopyArea(display, wmgen.pixmap, win, NormalGC,
|
||||
|
|
|
@ -18,7 +18,7 @@ Version Description
|
|||
-tc <color>
|
||||
|
||||
Added code to properly decode wind speed when in MPS.
|
||||
|
||||
|
||||
Fixed bug in beaufort wind speed calcs.
|
||||
|
||||
|
||||
|
@ -39,18 +39,18 @@ Version Description
|
|||
-wgc <color> for setting the Wind Gust color.
|
||||
|
||||
Also cleaned up the pixmap to minimize the number of colors used.
|
||||
|
||||
|
||||
Changed metric toggle to work with a key press (any key).
|
||||
|
||||
|
||||
Added double click support. Now double clicking does the following:
|
||||
|
||||
|
||||
Double Mouse Left: pops up the fully decoded METAR file
|
||||
in xmessage.
|
||||
|
||||
|
||||
Double Mouse Middle: Currently undefined.
|
||||
|
||||
|
||||
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
|
||||
meters/second (when in -metric mode).
|
||||
|
||||
|
||||
1.27 - released March 8, 1999.
|
||||
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).
|
||||
|
||||
1.1 - Released Jan. 25, 1999.
|
||||
Bug fixes.
|
||||
Bug fixes.
|
||||
Added Degrees F/C support...
|
||||
Added a bit more info on where to find info on METAR/TAF
|
||||
system...
|
||||
|
|
|
@ -16,7 +16,7 @@ Afterstep users put the following in their .steprc
|
|||
Note: AfterStep's Wharf has a problem with pixmaps that are
|
||||
larger than 60x60 pixels. Please tell the AfterStep authors
|
||||
to fix this, this is not our fault, but a Wharf problem!
|
||||
|
||||
|
||||
|
||||
Other window managers.
|
||||
----------------------
|
||||
|
|
|
@ -17,8 +17,8 @@ Installation
|
|||
1) tar -xvf wmWeather-1.29.tar
|
||||
2) cd wmWeather-1.29/Src/
|
||||
3) make clean
|
||||
4) make
|
||||
5) make install (must be root)
|
||||
4) make
|
||||
5) make install (must be root)
|
||||
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
|
||||
is located in a place other than /usr/bin/
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
|
||||
|
||||
#
|
||||
# Parse HTML File.
|
||||
# Parse HTML File.
|
||||
#
|
||||
$Temp = -999.0;
|
||||
$Chill = -999.0;
|
||||
|
@ -82,7 +82,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Isolate the Wind groups out of the coded METAR report.
|
||||
# There may be two groups - the normal one and a variability set.
|
||||
|
|
|
@ -18,7 +18,7 @@ OBJS = wmWeather.o \
|
|||
all: wmWeather.o wmWeather
|
||||
|
||||
wmWeather.o: wmWeather_master.xpm wmWeather_mask.xbm
|
||||
wmWeather: $(OBJS)
|
||||
wmWeather: $(OBJS)
|
||||
$(CC) $(CFLAGS) $(SYSTEM) -o wmWeather $^ $(INCDIR) $(LIBDIR) $(LIBS)
|
||||
|
||||
clean:
|
||||
|
@ -30,5 +30,5 @@ clean:
|
|||
install:: wmWeather
|
||||
install -c -s -m 0755 wmWeather $(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
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.TH WMWEATHER 1.1 "19 January 1999"
|
||||
.TH WMWEATHER 1.1 "19 January 1999"
|
||||
.SH NAME
|
||||
WMWEATHER \- Dockable Weather Monitor
|
||||
.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).
|
||||
.TP
|
||||
.B \-dc <color>
|
||||
Set the color of the data entries.
|
||||
Set the color of the data entries.
|
||||
.TP
|
||||
.B \-tc <color>
|
||||
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
|
||||
average direction).
|
||||
.SH BUGS
|
||||
Let me know if/when you find any.
|
||||
Let me know if/when you find any.
|
||||
.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/".
|
||||
.SH AUTHOR
|
||||
Michael G. Henderson <mghenderson@lanl.gov>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/*
|
||||
*
|
||||
* wmWeather-1.31 (C) 1999 Mike Henderson (mghenderson@lanl.gov)
|
||||
*
|
||||
*
|
||||
* - Shows Local Weather conditions
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* 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
|
||||
|
@ -19,7 +19,7 @@
|
|||
*
|
||||
* 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
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*
|
||||
*
|
||||
|
@ -29,7 +29,7 @@
|
|||
*
|
||||
* - Add a GTK popup window to display data in a nicer way. Currently just use
|
||||
* xmessage...
|
||||
*
|
||||
*
|
||||
* - 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...
|
||||
*
|
||||
|
@ -47,7 +47,7 @@
|
|||
* Fixed a bug whereby the App would crash when trying to gain input
|
||||
* focus under non-WindowMaker WMs (focus is now grabbed by
|
||||
* `PointerRoot' not `iconwin').
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
@ -75,11 +75,11 @@
|
|||
* -wgc <color> for setting the Wind Gust color.
|
||||
*
|
||||
* 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:
|
||||
*
|
||||
*
|
||||
* Double Mouse Left: pops up the fully decoded METAR file
|
||||
* in xmessage.
|
||||
*
|
||||
|
@ -96,14 +96,14 @@
|
|||
* Since Windchill is not always available, we only show it if its
|
||||
* 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).
|
||||
*
|
||||
* Version 1.27 - released March 8, 1999.
|
||||
* fixed bug in speed calculation when wind is gusting.
|
||||
*
|
||||
* Version 1.26 - released February 24, 1999.
|
||||
* Added -delay option.
|
||||
* Added -delay option.
|
||||
*
|
||||
* Version 1.25 - released February 16, 1999.
|
||||
* Added Wind speeds on the 'Beaufort scale'
|
||||
|
@ -145,8 +145,8 @@
|
|||
|
||||
|
||||
|
||||
/*
|
||||
* Includes
|
||||
/*
|
||||
* Includes
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
@ -162,8 +162,8 @@
|
|||
|
||||
|
||||
|
||||
/*
|
||||
* Delay between refreshes (in microseconds)
|
||||
/*
|
||||
* Delay between refreshes (in microseconds)
|
||||
*/
|
||||
#define DELAY 10000L
|
||||
#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
|
||||
* 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"};
|
||||
|
||||
|
||||
|
@ -216,8 +216,8 @@ char StationTimeColor[30] = "#c5a6ff";
|
|||
|
||||
|
||||
|
||||
/*
|
||||
* main
|
||||
/*
|
||||
* main
|
||||
*/
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
|
@ -249,14 +249,14 @@ FILE *fp;
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Parse any command line arguments.
|
||||
*/
|
||||
ParseCMDLine(argc, argv);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
@ -264,12 +264,12 @@ FILE *fp;
|
|||
* better on a low-color 8-bit display.
|
||||
*/
|
||||
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);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Loop until we die
|
||||
*/
|
||||
|
@ -290,19 +290,19 @@ FILE *fp;
|
|||
* Keep track of # of seconds
|
||||
*/
|
||||
if (m > 100){
|
||||
|
||||
|
||||
m = 0;
|
||||
++dt1;
|
||||
++dt2;
|
||||
++dt3;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
/*
|
||||
* Increment counter
|
||||
*/
|
||||
++m;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -338,7 +338,7 @@ FILE *fp;
|
|||
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Process any pending X events.
|
||||
*/
|
||||
while(XPending(display)){
|
||||
|
@ -369,7 +369,7 @@ FILE *fp;
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
@ -380,7 +380,7 @@ FILE *fp;
|
|||
* may be Up-To-Date!
|
||||
*/
|
||||
if ((dt2 > 5)||(ForceUpdate)){
|
||||
|
||||
|
||||
dt2 = 0;
|
||||
|
||||
/*
|
||||
|
@ -410,7 +410,7 @@ FILE *fp;
|
|||
DT = UT - LT;
|
||||
if (DT > 24.0) DT -= 24.0;
|
||||
if (DT < 0.00) DT += 24.0;
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
@ -477,7 +477,7 @@ FILE *fp;
|
|||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -492,7 +492,7 @@ FILE *fp;
|
|||
|
||||
|
||||
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;
|
||||
|
||||
if (UpdateLTHour != 99){
|
||||
q = 0;
|
||||
q = 0;
|
||||
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;
|
||||
|
@ -575,7 +575,7 @@ FILE *fp;
|
|||
val = DewPoint;
|
||||
copyXPMArea(5, 87, 17, 8, 5, 24);
|
||||
}
|
||||
|
||||
|
||||
if ((val > -999.0)&&(val < 1000.0)){
|
||||
sgn = (val < 0.0) ? -1.0 : 1.0;
|
||||
val *= sgn;
|
||||
|
@ -722,7 +722,7 @@ FILE *fp;
|
|||
q += 2;
|
||||
} else if (Direction > 0.0){
|
||||
|
||||
/*
|
||||
/*
|
||||
* 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'.
|
||||
*/
|
||||
|
@ -735,7 +735,7 @@ FILE *fp;
|
|||
if (Metric && Beaufort) {
|
||||
int beau = 0;
|
||||
int spd;
|
||||
|
||||
|
||||
sgn = (Speed < 0.0) ? -1.0 : 1.0;
|
||||
spd = (int)(sgn * (int)Speed);
|
||||
if (spd > 1) { beau = 1; }
|
||||
|
@ -828,8 +828,8 @@ UpToDate = 0;
|
|||
|
||||
|
||||
|
||||
/*
|
||||
* Wait for next update
|
||||
/*
|
||||
* Wait for next update
|
||||
*/
|
||||
usleep(DELAY);
|
||||
|
||||
|
@ -849,7 +849,7 @@ void ParseCMDLine(int argc, char *argv[]) {
|
|||
|
||||
int i;
|
||||
void print_usage();
|
||||
|
||||
|
||||
StationID[0] = '\0';
|
||||
PressureUnits = 0;
|
||||
MetersPerSecond = 0;
|
||||
|
@ -907,15 +907,15 @@ void ParseCMDLine(int argc, char *argv[]) {
|
|||
strcpy(DataColor, argv[++i]);
|
||||
|
||||
} else if (!strcmp(argv[i], "-beaufort")){
|
||||
|
||||
|
||||
Beaufort = 1;
|
||||
|
||||
} else if (!strcmp(argv[i], "-mps")){
|
||||
|
||||
|
||||
MetersPerSecond = 1;
|
||||
|
||||
} else if (!strcmp(argv[i], "-W")){
|
||||
|
||||
|
||||
ShowWindChill = 1;
|
||||
|
||||
} else if ((!strcmp(argv[i], "-metric"))||(!strcmp(argv[i], "-m"))){
|
||||
|
@ -936,7 +936,7 @@ void ParseCMDLine(int argc, char *argv[]) {
|
|||
|
||||
PressureUnits = 3;
|
||||
PressureConv = 25.4;
|
||||
|
||||
|
||||
} else if ((!strcmp(argv[i], "-station"))||(!strcmp(argv[i], "-s"))){
|
||||
|
||||
if ((i+1 >= argc)||(argv[i+1][0] == '-')) {
|
||||
|
@ -960,13 +960,13 @@ void ParseCMDLine(int argc, char *argv[]) {
|
|||
print_usage();
|
||||
exit(-1);
|
||||
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Convert Time to seconds
|
||||
*/
|
||||
UpdateDelay *= 60;
|
||||
++i;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
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.
|
||||
* - Some other click event should display the full METAR report -- lots of
|
||||
|
@ -1110,7 +1110,7 @@ void ButtonPressEvent(XButtonEvent *xev){
|
|||
if (GotFirstClick1) GotDoubleClick1 = 1;
|
||||
else GotFirstClick1 = 1;
|
||||
|
||||
} else if ((xev->button == Button2) && (xev->type == ButtonPress)){
|
||||
} else if ((xev->button == Button2) && (xev->type == ButtonPress)){
|
||||
|
||||
if (GotFirstClick2) GotDoubleClick2 = 1;
|
||||
else GotFirstClick2 = 1;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
* 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
|
||||
* (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 <stdio.h>
|
||||
#include <string.h>
|
||||
|
@ -42,7 +42,7 @@
|
|||
|
||||
|
||||
/*
|
||||
* X11 Variables
|
||||
* X11 Variables
|
||||
*/
|
||||
int x_fd;
|
||||
XSizeHints mysizehints;
|
||||
|
@ -85,7 +85,7 @@ static int flush_expose(Window w) {
|
|||
* RedrawWindowXY
|
||||
*/
|
||||
void RedrawWindow(void) {
|
||||
|
||||
|
||||
flush_expose(iconwin);
|
||||
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) {
|
||||
|
||||
|
||||
flush_expose(iconwin);
|
||||
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
|
||||
*/
|
||||
void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits,
|
||||
int pixmask_width, int pixmask_height, char *BackColor, char *LabelColor,
|
||||
void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits,
|
||||
int pixmask_width, int pixmask_height, char *BackColor, char *LabelColor,
|
||||
char *WindGustColor, char *DataColor, char *StationTimeColor) {
|
||||
|
||||
unsigned int borderwidth = 1;
|
||||
|
@ -177,9 +177,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
|
|||
{"StationTimeColor", NULL, 0} };
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
/*
|
||||
* Create Pixmap
|
||||
*/
|
||||
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.exactColors = False;
|
||||
wmgen.attributes.closeness = 40000;
|
||||
wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols
|
||||
wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols
|
||||
| XpmExactColors | XpmCloseness | XpmSize;
|
||||
if (XpmCreatePixmapFromData(display, Root, pixmap_bytes,
|
||||
if (XpmCreatePixmapFromData(display, Root, pixmap_bytes,
|
||||
&(wmgen.pixmap), &(wmgen.mask), &(wmgen.attributes)) != XpmSuccess){
|
||||
fprintf(stderr, "Not enough free colorcells.\n");
|
||||
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.x = 0;
|
||||
|
@ -217,19 +217,19 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
|
|||
|
||||
mysizehints.width = 64;
|
||||
mysizehints.height = 64;
|
||||
|
||||
|
||||
|
||||
|
||||
win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
|
||||
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
|
||||
|
||||
|
||||
iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
|
||||
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Activate hints
|
||||
/*
|
||||
* Activate hints
|
||||
*/
|
||||
XSetWMNormalHints(display, win, &mysizehints);
|
||||
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
|
||||
* it after you are done...
|
||||
*/
|
||||
XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask
|
||||
| PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask
|
||||
XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask
|
||||
| PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask
|
||||
| KeyPressMask | KeyReleaseMask);
|
||||
XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask
|
||||
| PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask
|
||||
XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask
|
||||
| PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask
|
||||
| KeyPressMask | KeyReleaseMask);
|
||||
|
||||
|
||||
|
@ -260,8 +260,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
|
|||
|
||||
XSetWMName(display, win, &name);
|
||||
|
||||
/*
|
||||
* Create Graphics Context (GC) for drawing
|
||||
/*
|
||||
* Create Graphics Context (GC) for drawing
|
||||
*/
|
||||
gcm = GCForeground | GCBackground | GCGraphicsExposures;
|
||||
gcv.foreground = fore_pix;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
|
||||
/*
|
||||
* Typedefs
|
||||
* Typedefs
|
||||
*/
|
||||
typedef struct {
|
||||
Pixmap pixmap;
|
||||
|
@ -21,7 +21,7 @@ typedef struct {
|
|||
Display *display;
|
||||
Window Root;
|
||||
Window iconwin, win;
|
||||
int screen;
|
||||
int screen;
|
||||
int DisplayDepth;
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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@japan.co.jp
|
||||
|
|
102
wmacpi/ChangeLog
102
wmacpi/ChangeLog
|
@ -51,8 +51,8 @@
|
|||
Thanks,
|
||||
|
||||
JB.
|
||||
|
||||
|
||||
|
||||
|
||||
2008 March 18 2.2rc3
|
||||
Some fixes for the sysfs interface support, supplied by
|
||||
jblache@debian.org:
|
||||
|
@ -70,7 +70,7 @@
|
|||
|
||||
JB.
|
||||
|
||||
|
||||
|
||||
2008 March 14 2.2rc2
|
||||
Support for the sysfs interface that became mandatory with kernel
|
||||
2.6.24 (patch supplied by jblache@debian.org).
|
||||
|
@ -78,7 +78,7 @@
|
|||
A number of graphics fixes also from jblache@debian.org.
|
||||
|
||||
Removed support for hardware reported critical battery status.
|
||||
|
||||
|
||||
2007 July 14 2.2rc1
|
||||
Major changes to command line handling and to the way we use
|
||||
libdockapp, courtesy of Patrice Dumas. This should hopefully fix
|
||||
|
@ -89,7 +89,7 @@
|
|||
/proc/acpi/info - thanks to Samuel Ortiz.
|
||||
|
||||
Fixed a longstanding issue with redrawing - thanks to Vito
|
||||
Caputo.
|
||||
Caputo.
|
||||
|
||||
This version changes a number of command line options (little used
|
||||
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,
|
||||
long options are now supported for everything in wmacpi (but not
|
||||
acpi, since it doesn't use libdockapp for command line parsing).
|
||||
|
||||
|
||||
2007 January 10 2.2a1
|
||||
Added a patch from Patrice Dumas to support newer versions of
|
||||
libdockapp.
|
||||
|
@ -107,20 +107,20 @@
|
|||
|
||||
2005 February 2 2.1
|
||||
Finalised libdockapp-0.5.0 port - no changes from 2.1rc1.
|
||||
|
||||
|
||||
2005 Jan 5 2.1rc1
|
||||
Typo fix in the manpage.
|
||||
|
||||
Ported to libdockapp-0.5.0 - all this needed was changing the
|
||||
type of the dockapp width and height to unsigned short.
|
||||
|
||||
|
||||
2004 October 24 2.0
|
||||
Upped version number to 2.0.
|
||||
|
||||
Small typo fixes.
|
||||
|
||||
wmacpi 2.0 goes gold . . .
|
||||
|
||||
|
||||
2004 September 28 2.0rc1
|
||||
Added support for switching to capacity mode automatically, on
|
||||
detecting dodgy reports from the battery.
|
||||
|
@ -131,7 +131,7 @@
|
|||
Various cleanups.
|
||||
|
||||
Hopefully last release before the final 2.0.
|
||||
|
||||
|
||||
2004 August 18 1.99r7
|
||||
Implemented the libdockapp port - this seems to close Debian bug
|
||||
#227819, but it hasn't received sufficient testing.
|
||||
|
@ -141,17 +141,17 @@
|
|||
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
|
||||
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
|
||||
|
||||
|
||||
* generic battery number support (rather than just
|
||||
using two pixmaps, one for b1 and one for b2)
|
||||
|
||||
* stopped the battery glyph from blinking when running on AC
|
||||
|
||||
|
||||
2004 July 19 1.99r6
|
||||
Fix for Debian bug #250792 - the parser for the acpi files was
|
||||
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
|
||||
without more bug repots . . .
|
||||
|
||||
|
||||
2004 April 15 1.99r4
|
||||
Collected fixes for various small issues.
|
||||
|
||||
|
@ -202,17 +202,17 @@
|
|||
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
|
||||
that I can get these smaller fixes out. Hopefully soon . . .
|
||||
|
||||
|
||||
2004 January 12 1.99r3
|
||||
. . . and a fix for a fix that didn't fix it . . .
|
||||
|
||||
|
||||
2004 January 12 1.99r2
|
||||
Some cleanups and bugfixes found by the wonderful Debian users.
|
||||
|
||||
It's finally in testing!
|
||||
|
||||
|
||||
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
|
||||
the makefile.
|
||||
|
@ -226,7 +226,7 @@
|
|||
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
|
||||
found by all the extra users.
|
||||
|
||||
|
||||
2003 September 26 0.99
|
||||
Fix the last of the old wmacpi code oddities (specifically, the
|
||||
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
|
||||
0.99, preliminary to either wmacpi-ng 1.0 or wmacpi 2.0 (depending
|
||||
which direction I go with that).
|
||||
|
||||
|
||||
2003 September 23 0.92
|
||||
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
|
||||
all interrupts while reading from the battery, which apparently
|
||||
causes some interactivity issues. I have no idea why reading once
|
||||
every three seconds (which is our default), but there've been some
|
||||
complaints.
|
||||
complaints.
|
||||
|
||||
Also fixed acpi-ng to properly handle the -a option.
|
||||
|
||||
|
||||
2003 August 6 0.91
|
||||
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 . . .
|
||||
|
||||
|
||||
2003 July 16 0.90
|
||||
Make the time display show '--:--' instead of '00:00' when the
|
||||
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
|
||||
common) case where the ACPI subsystem doesn't report sane values
|
||||
for the things we depend on.
|
||||
|
||||
|
||||
2003 July 11 0.50a2
|
||||
Make the time display show nothing (as opposed to 00:00) when the
|
||||
time remaining is unknown, as requested by Emma Jane Hogbin.
|
||||
|
@ -283,7 +283,7 @@
|
|||
annoying about.
|
||||
|
||||
Also, added an acpi-ng manpage.
|
||||
|
||||
|
||||
2003 July 11 0.50a1
|
||||
Properly fix the AC adapter issue - it's not much use adding the
|
||||
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
|
||||
greater than 99:59, since the display area won't fit anything
|
||||
beyond that.
|
||||
|
||||
|
||||
2003 July 10 0.50a
|
||||
Bugfixes, to handle two problems: the case where something like
|
||||
the present rate or some such is "unknown" (reported initially by
|
||||
Emma Jane Hogbin, and where the AC adapter is called something
|
||||
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
|
||||
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
|
||||
|
@ -307,69 +307,69 @@
|
|||
batteries . . .)
|
||||
|
||||
A few more code cleanups.
|
||||
|
||||
|
||||
2003 July 1 0.19
|
||||
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
|
||||
long way to go on that, though . . .
|
||||
|
||||
|
||||
2003 June 24 0.15
|
||||
Removed process_plugin_timer(), since it was doing nothing useful
|
||||
at all . . .
|
||||
|
||||
|
||||
2003 June 23 0.14
|
||||
Removed libapm.c - wmacpi-ng is specifically for ACPI, with no APM
|
||||
support.
|
||||
|
||||
support.
|
||||
|
||||
2003 June 23 0.13
|
||||
Some more code cleanups, designed to move libacpi to more of a
|
||||
library than something built into wmacpi-ng. This is useful with
|
||||
the seperate programs, though at present it's not used much.
|
||||
|
||||
|
||||
2003 June 21 0.12
|
||||
Added a command line tool, acpi-ng to query battery status from
|
||||
the command line.
|
||||
|
||||
|
||||
2003 May 30 0.11
|
||||
Implemented multiple battery support, and averaging of the samples
|
||||
in an attempt to even out the jumpiness of the timer.
|
||||
|
||||
|
||||
2003 May 30 0.10
|
||||
More major code cleanups: in particular the handling of the power
|
||||
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
|
||||
batteries, so that if there's a fully charge second battery
|
||||
available it reports the correct time remaining (based on the
|
||||
present rate of power consumption and the sum of the two battery's
|
||||
remaining capacities).
|
||||
|
||||
|
||||
2003 May 29 0.3
|
||||
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
|
||||
Code cleanups to fix various problems with corner cases.
|
||||
|
||||
|
||||
2003 May 26 0.2
|
||||
Added support for multiple batteries: I took the simple route of
|
||||
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.
|
||||
|
||||
|
||||
Added a -m option to specify the battery number to monitor.
|
||||
|
||||
|
||||
2003 May 26 0.1
|
||||
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
|
||||
I might as well have a go at hacking on it . . .
|
||||
|
||||
-- Simon Fowler, <simon@dreamcraft.com.au>
|
||||
|
||||
|
||||
2002 Feb 17 1.34
|
||||
Updated ACPI statistics gathering code for the latest ACPI patch from
|
||||
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
|
||||
README to learn how to enable it. Obviously, it's disabled by default)
|
||||
|
||||
|
||||
Reorganized apminfo structure and got rid of redundancy.
|
||||
|
||||
|
||||
Reorganized acquire_apm_info. All APM data is processed there.
|
||||
|
||||
|
||||
Fixed display_state to do the Right Thing.
|
||||
|
||||
|
||||
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
|
||||
right in 1.0.
|
||||
|
|
|
@ -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
|
||||
|
||||
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 install BUILD_CLI=1
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# set options. pick one, acpi or apm. comment out the other one. don't
|
||||
# uncomment both, bad things will happen :)
|
||||
|
||||
OPT := -O2
|
||||
OPT := -O2
|
||||
|
||||
# uncomment this to build the command line acpi tool
|
||||
BUILD_CLI = 1
|
||||
|
@ -40,7 +40,7 @@ wmacpi: $(WMOBJ)
|
|||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
# 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
|
||||
CLSRC := wmacpi-cli.c libacpi.c
|
||||
CLOBJ := $(patsubst %.c,%.o,$(filter %.c,$(CLSRC)))
|
||||
|
@ -56,7 +56,7 @@ endif
|
|||
gcc -MM $(CFLAGS) $< > $@
|
||||
|
||||
clean:
|
||||
rm -f TAGS *.o *~ trace *.out *.bb *.bbg
|
||||
rm -f TAGS *.o *~ trace *.out *.bb *.bbg
|
||||
|
||||
clean-all: clean
|
||||
rm -f *.d $(targets)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
2003 November 23 1.99
|
||||
* 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
|
||||
Bowland's acpi tool, so that wmacpi won't conflict with it.
|
||||
|
@ -20,7 +20,7 @@
|
|||
2003 June 24 0.14
|
||||
|
||||
* 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
|
||||
this will actually work with other systems.
|
||||
|
|
124
wmacpi/libacpi.c
124
wmacpi/libacpi.c
|
@ -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);
|
||||
return -3;
|
||||
}
|
||||
|
||||
|
||||
buf[ret] = '\0';
|
||||
|
||||
return 0;
|
||||
|
@ -61,7 +61,7 @@ static int sysfs_init_batteries(global_t *globals)
|
|||
char *names[MAXBATT];
|
||||
char ps_type[16];
|
||||
int i, j;
|
||||
|
||||
|
||||
/* now enumerate batteries */
|
||||
globals->battery_count = 0;
|
||||
battdir = opendir("/sys/class/power_supply");
|
||||
|
@ -72,12 +72,12 @@ static int sysfs_init_batteries(global_t *globals)
|
|||
while ((batt = readdir(battdir))) {
|
||||
/* there's a serious problem with this code when there's
|
||||
* 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
|
||||
* to sort them ourselves before adding them to the
|
||||
* to sort them ourselves before adding them to the
|
||||
* batteries array. */
|
||||
name = batt->d_name;
|
||||
|
||||
|
||||
/* skip ., .. and dotfiles */
|
||||
if (name[0] == '.')
|
||||
continue;
|
||||
|
@ -96,7 +96,7 @@ static int sysfs_init_batteries(global_t *globals)
|
|||
/* A nice quick insertion sort, ala CLR. */
|
||||
{
|
||||
char *tmp1, *tmp2;
|
||||
|
||||
|
||||
for (i = 1; i < globals->battery_count; i++) {
|
||||
tmp1 = names[i];
|
||||
j = i - 1;
|
||||
|
@ -107,7 +107,7 @@ static int sysfs_init_batteries(global_t *globals)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < globals->battery_count; i++) {
|
||||
snprintf(batteries[i].name, MAX_NAME, "%s", names[i]);
|
||||
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 *names[MAXBATT];
|
||||
int i, j;
|
||||
|
||||
|
||||
/* now enumerate batteries */
|
||||
globals->battery_count = 0;
|
||||
battdir = opendir("/proc/acpi/battery");
|
||||
|
@ -152,12 +152,12 @@ static int procfs_init_batteries(global_t *globals)
|
|||
while ((batt = readdir(battdir))) {
|
||||
/* there's a serious problem with this code when there's
|
||||
* 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
|
||||
* to sort them ourselves before adding them to the
|
||||
* to sort them ourselves before adding them to the
|
||||
* batteries array. */
|
||||
name = batt->d_name;
|
||||
|
||||
|
||||
/* skip . and .. */
|
||||
if (!strncmp(".", name, 1) || !strncmp("..", name, 2))
|
||||
continue;
|
||||
|
@ -170,7 +170,7 @@ static int procfs_init_batteries(global_t *globals)
|
|||
/* A nice quick insertion sort, ala CLR. */
|
||||
{
|
||||
char *tmp1, *tmp2;
|
||||
|
||||
|
||||
for (i = 1; i < globals->battery_count; i++) {
|
||||
tmp1 = names[i];
|
||||
j = i - 1;
|
||||
|
@ -181,12 +181,12 @@ static int procfs_init_batteries(global_t *globals)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < globals->battery_count; 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]);
|
||||
snprintf(batteries[i].state_file, MAX_NAME,
|
||||
snprintf(batteries[i].state_file, MAX_NAME,
|
||||
"/proc/acpi/battery/%s/state", names[i]);
|
||||
pdebug("battery detected at %s\n", batteries[i].info_file);
|
||||
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);
|
||||
pinfo("libacpi: found %d batter%s\n", globals->battery_count,
|
||||
(globals->battery_count == 1) ? "y" : "ies");
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -263,7 +263,7 @@ static int sysfs_init_ac_adapters(global_t *globals)
|
|||
/* we'll just use the first adapter we find ... */
|
||||
ap->name = strdup(name);
|
||||
pinfo("libacpi: found ac adapter %s\n", ap->name);
|
||||
|
||||
|
||||
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",
|
||||
ap->name);
|
||||
pinfo("libacpi: found ac adapter %s\n", ap->name);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -374,7 +374,7 @@ int power_reinit(global_t *globals)
|
|||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!(retval = reinit_batteries(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 *val;
|
||||
adapter_t *ap = &globals->adapter;
|
||||
|
||||
|
||||
if ((file = fopen(ap->state_file, "r")) == NULL) {
|
||||
snprintf(buf, 1024, "Could not open state file %s", ap->state_file);
|
||||
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 ... */
|
||||
}
|
||||
|
||||
/* get current rate of burn
|
||||
/* get current rate of burn
|
||||
* note that if it's on AC, this will report 0 */
|
||||
if (read_sysfs_file(info->name, "current_now", buf, sizeof(buf)) < 0)
|
||||
info->present_rate = -1;
|
||||
|
@ -590,7 +590,7 @@ static int procfs_get_battery_info(global_t *globals, int batt_no)
|
|||
perror(NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* grab the contents of the file */
|
||||
buflen = fread(buf, sizeof(buf), 1, file);
|
||||
fclose(file);
|
||||
|
@ -612,13 +612,13 @@ static int procfs_get_battery_info(global_t *globals, int batt_no)
|
|||
info->present = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* get design capacity
|
||||
* note that all these integer values can also contain the
|
||||
* string 'unknown', so we need to check for this. */
|
||||
entry = strstr(buf, "design capacity:");
|
||||
val = get_value(entry);
|
||||
if (val[0] == 'u')
|
||||
if (val[0] == 'u')
|
||||
info->design_cap = -1;
|
||||
else
|
||||
info->design_cap = strtoul(val, NULL, 10);
|
||||
|
@ -639,13 +639,13 @@ static int procfs_get_battery_info(global_t *globals, int batt_no)
|
|||
else
|
||||
info->design_voltage = strtoul(val, NULL, 10);
|
||||
|
||||
|
||||
|
||||
if ((file = fopen(info->state_file, "r")) == NULL) {
|
||||
perr("Could not open %s:", info->state_file );
|
||||
perror(NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* grab the file contents */
|
||||
memset(buf, 0, sizeof(buf));
|
||||
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 */
|
||||
entry = strstr(buf, "charging state:");
|
||||
val = get_value(entry);
|
||||
if (val[0] == 'u')
|
||||
if (val[0] == 'u')
|
||||
info->charge_state = CH_ERR;
|
||||
else if ((strncmp(val, "discharging", 10)) == 0)
|
||||
info->charge_state = DISCHARGE;
|
||||
|
@ -684,7 +684,7 @@ static int procfs_get_battery_info(global_t *globals, int batt_no)
|
|||
else
|
||||
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 */
|
||||
entry = strstr(buf, "present rate:");
|
||||
val = get_value(entry);
|
||||
|
@ -728,12 +728,12 @@ int get_battery_info(global_t *globals, int batt_no)
|
|||
* 2003-7-1.
|
||||
* In order to make this code more convenient for things other than
|
||||
* just plain old wmacpi-ng I'm breaking the basic functionality
|
||||
* up into several chunks: collecting and collating info for a
|
||||
* single battery, calculating the global info (such as rtime), and
|
||||
* up into several chunks: collecting and collating info for a
|
||||
* single battery, calculating the global info (such as rtime), and
|
||||
* 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
|
||||
* the ACPI spec v2.0a, section 3.9.3. */
|
||||
static int calc_remaining_percentage(int batt)
|
||||
|
@ -741,7 +741,7 @@ static int calc_remaining_percentage(int batt)
|
|||
float rcap, lfcap;
|
||||
battery_t *binfo;
|
||||
int retval;
|
||||
|
||||
|
||||
binfo = &batteries[batt];
|
||||
|
||||
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.
|
||||
* when charging, the battery state file reports the
|
||||
* current being used to charge the battery. We can use
|
||||
* when charging, the battery state file reports the
|
||||
* current being used to charge the battery. We can use
|
||||
* this and the remaining capacity to work out how long
|
||||
* until it reaches the last full capacity of the battery.
|
||||
* XXX: make sure this is actually portable . . . */
|
||||
|
@ -816,7 +816,7 @@ static int calc_charge_time_rate(int batt)
|
|||
} else {
|
||||
lfcap = (float)binfo->last_full_cap;
|
||||
rcap = (float)binfo->remaining_cap;
|
||||
|
||||
|
||||
charge_time = (int)(((lfcap - rcap)/binfo->present_rate) * 60.0);
|
||||
}
|
||||
} 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
|
||||
* 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
|
||||
* it's just as neessary . . . */
|
||||
static int calc_charge_time_cap(int batt)
|
||||
|
@ -841,7 +841,7 @@ static int calc_charge_time_cap(int batt)
|
|||
float cdiff;
|
||||
float current_rate;
|
||||
battery_t *binfo = &batteries[batt];
|
||||
|
||||
|
||||
cap_samples[current] = (float) binfo->remaining_cap;
|
||||
time_samples[current] = time(NULL);
|
||||
|
||||
|
@ -863,7 +863,7 @@ static int calc_charge_time_cap(int batt)
|
|||
tdiff = time_samples[current] - time_samples[old];
|
||||
current_rate = cdiff/(float)tdiff;
|
||||
}
|
||||
if (current_rate == 0)
|
||||
if (current_rate == 0)
|
||||
rtime = 0;
|
||||
else {
|
||||
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;
|
||||
adapter_t *ap = &globals->adapter;
|
||||
|
||||
|
||||
get_battery_info(globals, batt);
|
||||
|
||||
|
||||
binfo = &batteries[batt];
|
||||
|
||||
|
||||
if (!binfo->present) {
|
||||
binfo->percentage = 0;
|
||||
binfo->valid = 0;
|
||||
|
@ -915,21 +915,21 @@ void acquire_batt_info(global_t *globals, int 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
|
||||
* less than 25% is LOW. Less than globals->crit_level is CRIT. */
|
||||
if (binfo->percentage == -1)
|
||||
binfo->state = BS_ERR;
|
||||
if (binfo->percentage < globals->crit_level)
|
||||
binfo->state = CRIT;
|
||||
else if (binfo->percentage > 75)
|
||||
else if (binfo->percentage > 75)
|
||||
binfo->state = HIGH;
|
||||
else if (binfo->percentage > 25)
|
||||
binfo->state = MED;
|
||||
else
|
||||
else
|
||||
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 . . . .*/
|
||||
ap->power = get_power_status(globals);
|
||||
|
||||
|
@ -939,11 +939,11 @@ void acquire_batt_info(global_t *globals, int batt)
|
|||
* that it's now valid . . .*/
|
||||
binfo->valid = 1;
|
||||
}
|
||||
|
||||
|
||||
void acquire_all_batt_info(global_t *globals)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for(i = 0; i < globals->battery_count; 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
|
||||
* to calculate the time remaining. What seems most sensible is to
|
||||
* 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 n = 0;
|
||||
|
||||
/* calculate the time remaining, using the battery's remaining
|
||||
* capacity and the reported burn rate (3.9.3).
|
||||
* For added accuracy, we average the value over the last
|
||||
/* calculate the time remaining, using the battery's remaining
|
||||
* capacity and the reported burn rate (3.9.3).
|
||||
* For added accuracy, we average the value over the last
|
||||
* SAMPLES number of calls, or for anything less than this we
|
||||
* 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
|
||||
* -1). */
|
||||
for (i = 0; i < globals->battery_count; i++) {
|
||||
|
@ -999,16 +999,16 @@ int calc_time_remaining_rate(global_t *globals)
|
|||
j++, sample_count++;
|
||||
if (j >= SAMPLES)
|
||||
j = 0;
|
||||
|
||||
|
||||
/* for the first SAMPLES number of calls we calculate the
|
||||
* average based on sample_count, then we use SAMPLES to
|
||||
* calculate the rolling average. */
|
||||
|
||||
|
||||
/* when this fails, n should be equal to SAMPLES. */
|
||||
if (sample_count < SAMPLES)
|
||||
n++;
|
||||
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. */
|
||||
if (rate_samples[i] < 0) {
|
||||
rate = -1;
|
||||
|
@ -1018,16 +1018,16 @@ int calc_time_remaining_rate(global_t *globals)
|
|||
rate += rate_samples[i];
|
||||
}
|
||||
rate = rate/(float)n;
|
||||
|
||||
|
||||
if ((rcap < 1) || (rate < 1)) {
|
||||
rtime = 0;
|
||||
goto out;
|
||||
}
|
||||
if (rate <= 0)
|
||||
if (rate <= 0)
|
||||
rate = 1;
|
||||
/* time remaining in minutes */
|
||||
rtime = (int)((rcap/rate) * 60.0);
|
||||
if(rtime <= 0)
|
||||
if(rtime <= 0)
|
||||
rtime = 0;
|
||||
out:
|
||||
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
|
||||
* resolution, so they don't report any changes until the difference
|
||||
* 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
|
||||
* samples at the old end of the set - this would smooth out the
|
||||
* transitions.
|
||||
* transitions.
|
||||
*/
|
||||
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];
|
||||
current_rate = cdiff/tdiff;
|
||||
}
|
||||
if (current_rate == 0)
|
||||
if (current_rate == 0)
|
||||
rtime = 0;
|
||||
else
|
||||
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);
|
||||
return rtime;
|
||||
}
|
||||
}
|
||||
|
||||
void acquire_global_info(global_t *globals)
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@ typedef enum {
|
|||
BATT,
|
||||
PS_ERR,
|
||||
} power_state_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
HIGH,
|
||||
MED,
|
||||
|
@ -52,7 +52,7 @@ typedef struct {
|
|||
char state_file[MAX_NAME];
|
||||
/* sysfs capacity mode */
|
||||
sysfs_capa_t sysfs_capa_mode;
|
||||
int present;
|
||||
int present;
|
||||
int design_cap; /* assuming mAh */
|
||||
int last_full_cap;
|
||||
int design_voltage; /* in mV */
|
||||
|
@ -68,9 +68,9 @@ typedef struct {
|
|||
/* and a flag to indicate that this is valid . . . */
|
||||
int valid;
|
||||
/* number of times we've gotten bad info on this battery's present rate */
|
||||
int bad_count;
|
||||
int bad_count;
|
||||
} battery_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
char *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
|
||||
* 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.
|
||||
*/
|
||||
|
@ -125,7 +125,7 @@ typedef struct {
|
|||
|
||||
#define pfatal(fmt, arg...) \
|
||||
fprintf(stderr, fmt, ##arg) \
|
||||
|
||||
|
||||
|
||||
/* Since these /are/ needed here . . . */
|
||||
battery_t batteries[MAXBATT];
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Written by Simon Fowler <simon@dreamcraft.com.au>, 2003-06-20.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
@ -95,7 +95,7 @@ int main(int argc, char *argv[])
|
|||
acquire_global_info(globals);
|
||||
usleep(sleep_time);
|
||||
}
|
||||
|
||||
|
||||
ap = &globals->adapter;
|
||||
if(ap->power == AC) {
|
||||
printf("On AC Power");
|
||||
|
@ -104,8 +104,8 @@ int main(int argc, char *argv[])
|
|||
if(binfo->present && (binfo->charge_state == CHARGE)) {
|
||||
printf("; Battery %s charging", binfo->name);
|
||||
printf(", currently at %2d%%", binfo->percentage);
|
||||
if(binfo->charge_time >= 0)
|
||||
printf(", %2d:%02d remaining",
|
||||
if(binfo->charge_time >= 0)
|
||||
printf(", %2d:%02d remaining",
|
||||
binfo->charge_time/60,
|
||||
binfo->charge_time%60);
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ int main(int argc, char *argv[])
|
|||
binfo->percentage);
|
||||
}
|
||||
if(globals->rtime >= 0)
|
||||
printf("; %d:%02d remaining", globals->rtime/60,
|
||||
printf("; %d:%02d remaining", globals->rtime/60,
|
||||
globals->rtime%60);
|
||||
printf("\n");
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
.TP
|
||||
.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.
|
||||
.TP
|
||||
.B \-f, --force-capacity-mode
|
||||
|
@ -114,7 +114,7 @@ works around certain buggy ACPI BIOSes that fail to report the current
|
|||
rate.
|
||||
.TP
|
||||
.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\&.
|
||||
.TP
|
||||
.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.
|
||||
.TP
|
||||
.B \-V, --verbosity=num
|
||||
Increase the verbosity of the program. Setting this to 1 will print extra
|
||||
error information; 2 will produce informational output; 3 will produce
|
||||
Increase the verbosity of the program. Setting this to 1 will print extra
|
||||
error information; 2 will produce informational output; 3 will produce
|
||||
copious debugging output.
|
||||
.TP
|
||||
.B \-v, --version
|
||||
|
@ -143,7 +143,7 @@ accuracy of the reported time remaining.
|
|||
.TP
|
||||
.B \-V
|
||||
Increase the verbosity of the program. If repeated, the result is the
|
||||
same as setting
|
||||
same as setting
|
||||
.B \--verbosity
|
||||
for
|
||||
.B wmacpi
|
||||
|
@ -161,6 +161,6 @@ completely rewritten after 1.34 by Simon Fowler <simon@himi.org>.
|
|||
.PP
|
||||
This manual page was originally written by Simon Richter
|
||||
<sjr@debian.org> for the Debian GNU/Linux system, and then updated by
|
||||
Simon Fowler.
|
||||
Simon Fowler.
|
||||
.br
|
||||
Last modification by Simon Fowler <simon@himi.org>, 2007-07-13.
|
||||
|
|
104
wmacpi/wmacpi.c
104
wmacpi/wmacpi.c
|
@ -80,11 +80,11 @@ struct dockapp *dockapp;
|
|||
int scroll_reset = DEFAULT_SCROLL_RESET;
|
||||
|
||||
/* 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)
|
||||
{
|
||||
XCopyArea(DADisplay, dockapp->pixmap, dockapp->pixmap,
|
||||
DAGC, x, y, w, h, dx, dy);
|
||||
dockapp->update = 1;
|
||||
static void copy_xpm_area(int x, int y, int w, int h, int dx, int dy)
|
||||
{
|
||||
XCopyArea(DADisplay, dockapp->pixmap, dockapp->pixmap,
|
||||
DAGC, x, y, w, h, dx, dy);
|
||||
dockapp->update = 1;
|
||||
}
|
||||
|
||||
/* display AC power symbol */
|
||||
|
@ -156,7 +156,7 @@ static void new_window(char *display, char *name, int argc, char **argv)
|
|||
StructureNotifyMask);
|
||||
|
||||
/* create the main pixmap . . . */
|
||||
DAMakePixmapFromData(master_xpm, &dockapp->pixmap, &dockapp->mask,
|
||||
DAMakePixmapFromData(master_xpm, &dockapp->pixmap, &dockapp->mask,
|
||||
&dockapp->width, &dockapp->height);
|
||||
DASetPixmap(dockapp->pixmap);
|
||||
DASetShape(dockapp->mask);
|
||||
|
@ -181,7 +181,7 @@ static void new_window(char *display, char *name, int argc, char **argv)
|
|||
hints->max_height = 64;
|
||||
XSetWMNormalHints(dockapp->display, dockapp->win, hints);
|
||||
XFree(hints);
|
||||
}
|
||||
}
|
||||
|
||||
DAShow();
|
||||
}
|
||||
|
@ -208,10 +208,10 @@ static void scroll_text(void)
|
|||
int tw = dockapp->tw; /* width of the rendered text */
|
||||
int sx, dx, w;
|
||||
|
||||
if (!dockapp->scroll)
|
||||
if (!dockapp->scroll)
|
||||
return;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Conceptually this is viewing the text through a scrolling
|
||||
* window - the window starts out with the end immediately before
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
@ -246,7 +246,7 @@ static void scroll_text(void)
|
|||
w = end;
|
||||
else if (end > tw)
|
||||
w = 52 - (end - tw);
|
||||
|
||||
|
||||
dx = x + 52 - w;
|
||||
if (end > tw)
|
||||
dx = x;
|
||||
|
@ -368,7 +368,7 @@ static void display_time(int minutes)
|
|||
hour = minutes / 60;
|
||||
/* 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
|
||||
* 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. */
|
||||
if (hour >= 100) {
|
||||
hour = 99;
|
||||
|
@ -392,7 +392,7 @@ static void display_time(int minutes)
|
|||
omin = min;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* The reworked state handling stuff.
|
||||
*/
|
||||
|
||||
|
@ -407,9 +407,9 @@ static void really_blink_power_glyph(void)
|
|||
{
|
||||
static int counter = 0;
|
||||
|
||||
if (counter == 10)
|
||||
if (counter == 10)
|
||||
display_power_glyph();
|
||||
else if (counter == 20)
|
||||
else if (counter == 20)
|
||||
kill_power_glyph();
|
||||
else if (counter > 30)
|
||||
counter = 0;
|
||||
|
@ -435,7 +435,7 @@ static void really_blink_battery_glyph(void)
|
|||
counter = 0;
|
||||
|
||||
counter += dockapp->period_length;
|
||||
}
|
||||
}
|
||||
|
||||
static void blink_battery_glyph(void)
|
||||
{
|
||||
|
@ -484,7 +484,7 @@ void reset_scroll_speed(void) {
|
|||
scroll_reset = DEFAULT_SCROLL_RESET;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* The message that needs to be displayed needs to be decided
|
||||
* according to a heirarchy: a message like not present needs to take
|
||||
* 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
|
||||
* needs to take precedence over the on ac power message. The other
|
||||
* 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
|
||||
* 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 {
|
||||
M_NB, /* no batteries */
|
||||
|
@ -515,7 +515,7 @@ static void set_message(global_t *globals)
|
|||
static enum messages state = M_NULL;
|
||||
battery_t *binfo = globals->binfo;
|
||||
adapter_t *ap = &globals->adapter;
|
||||
|
||||
|
||||
if (globals->battery_count == 0) {
|
||||
if (state != M_NB) {
|
||||
state = M_NB;
|
||||
|
@ -525,7 +525,7 @@ static void set_message(global_t *globals)
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* battery not present case */
|
||||
if (!binfo->present) {
|
||||
if (state != M_NP) {
|
||||
|
@ -567,7 +567,7 @@ static void set_message(global_t *globals)
|
|||
render_text("on battery");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 sx = (bno + 1) * 7; /* source x coord */
|
||||
int sy = 76; /* source y coord */
|
||||
|
||||
|
||||
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;
|
||||
battery_t *binfo;
|
||||
adapter_t *ap;
|
||||
|
||||
|
||||
pdebug("samples: %d\n", samples);
|
||||
if(samples > 1)
|
||||
sleep_time = 1000000/samples;
|
||||
|
@ -621,7 +621,7 @@ void cli_wmacpi(global_t *globals, int samples)
|
|||
acquire_global_info(globals);
|
||||
usleep(sleep_time);
|
||||
}
|
||||
|
||||
|
||||
ap = &globals->adapter;
|
||||
if(ap->power == AC) {
|
||||
printf("On AC Power");
|
||||
|
@ -630,8 +630,8 @@ void cli_wmacpi(global_t *globals, int samples)
|
|||
if(binfo->present && (binfo->charge_state == CHARGE)) {
|
||||
printf("; Battery %s charging", binfo->name);
|
||||
printf(", currently at %2d%%", binfo->percentage);
|
||||
if(binfo->charge_time >= 0)
|
||||
printf(", %2d:%02d remaining",
|
||||
if(binfo->charge_time >= 0)
|
||||
printf(", %2d:%02d remaining",
|
||||
binfo->charge_time/60,
|
||||
binfo->charge_time%60);
|
||||
}
|
||||
|
@ -646,7 +646,7 @@ void cli_wmacpi(global_t *globals, int samples)
|
|||
binfo->percentage);
|
||||
}
|
||||
if(globals->rtime >= 0)
|
||||
printf("; %d:%02d remaining", globals->rtime/60,
|
||||
printf("; %d:%02d remaining", globals->rtime/60,
|
||||
globals->rtime%60);
|
||||
printf("\n");
|
||||
}
|
||||
|
@ -686,14 +686,14 @@ int main(int argc, char **argv)
|
|||
DAProgramOption options[] = {
|
||||
{"-r", "--no-scroll", "disable scrolling message", 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}},
|
||||
{"-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}},
|
||||
{"-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}},
|
||||
{"-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));
|
||||
|
@ -706,8 +706,8 @@ int main(int argc, char **argv)
|
|||
globals->crit_level = 10;
|
||||
battery_no = 1;
|
||||
|
||||
/* after this many samples, we reinit the battery and AC adapter
|
||||
* information.
|
||||
/* after this many samples, we reinit the battery and AC adapter
|
||||
* information.
|
||||
* XXX: make these configurable . . . */
|
||||
batt_reinit = 100;
|
||||
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
|
||||
* monitor is available. */
|
||||
/* parse command-line options */
|
||||
DAParseArguments(argc, argv, options, 10,
|
||||
"A battery monitor dockapp for ACPI based systems",
|
||||
DAParseArguments(argc, argv, options, 10,
|
||||
"A battery monitor dockapp for ACPI based systems",
|
||||
VERSION);
|
||||
|
||||
|
||||
if (options[0].used)
|
||||
dockapp->scroll = 0;
|
||||
if (options[1].used)
|
||||
|
@ -730,7 +730,7 @@ int main(int argc, char **argv)
|
|||
rt_mode = RT_CAP;
|
||||
rt_forced = 1;
|
||||
}
|
||||
|
||||
|
||||
if (samplerate == 0) samplerate = 1;
|
||||
if (samplerate > 600) samplerate = 600;
|
||||
|
||||
|
@ -801,7 +801,7 @@ int main(int argc, char **argv)
|
|||
battery_no--;
|
||||
|
||||
/* 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/.
|
||||
* So, wmacpi it is . . . */
|
||||
new_window(display, "wmacpi", argc, argv);
|
||||
|
@ -854,9 +854,9 @@ int main(int argc, char **argv)
|
|||
/* what /is/ this crap?
|
||||
* Turns out that libdockapp adds the WM_DELETE_WINDOW atom to
|
||||
* 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
|
||||
* 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
|
||||
* manner, because we're expecting to die from a DestroyNotify
|
||||
* 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
|
||||
* 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
|
||||
* interrupts. This causes interactivity to suffer . . .
|
||||
*
|
||||
* interrupts. This causes interactivity to suffer . . .
|
||||
*
|
||||
* So, the workaround/fix for this is to sample at a much
|
||||
* lower rate than we may update/refresh/expose/whatever. The
|
||||
* 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 (battery_no > globals->battery_count)
|
||||
battery_no = 0;
|
||||
|
||||
|
||||
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
|
||||
* and who knows what kind of shit will be happening soon . . . */
|
||||
if (batt_count++ >= batt_reinit) {
|
||||
if(reinit_batteries(globals))
|
||||
if(reinit_batteries(globals))
|
||||
pfatal("Oh my god, the batteries are gone!\n");
|
||||
batt_count = 0;
|
||||
}
|
||||
|
||||
if (ac_count++ >= ac_reinit) {
|
||||
if(reinit_ac_adapters(globals))
|
||||
if(reinit_ac_adapters(globals))
|
||||
pfatal("What happened to our AC adapters?!?\n");
|
||||
ac_count = 0;
|
||||
}
|
||||
|
@ -942,15 +942,15 @@ int main(int argc, char **argv)
|
|||
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
|
||||
* 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
|
||||
* 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
|
||||
* 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
|
||||
* much time remained until the batteries were fully charged . . .
|
||||
* need to reverse the rtime calculation to be able to work out how
|
||||
* much time remained until the batteries were fully charged . . .
|
||||
* 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. */
|
||||
set_time_display(globals);
|
||||
|
@ -960,7 +960,7 @@ int main(int argc, char **argv)
|
|||
if (globals->battery_count == 0) {
|
||||
clear_percentage();
|
||||
clear_batt_id_area();
|
||||
} else
|
||||
} else
|
||||
display_percentage(binfo->percentage);
|
||||
|
||||
scroll_text();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Main Hacker:
|
||||
Main Hacker:
|
||||
Anthony Peacock <bratag44@hotmail.com>
|
||||
|
||||
Main Author:
|
||||
|
|
|
@ -25,9 +25,9 @@ This manual page documents briefly the
|
|||
command.
|
||||
.PP
|
||||
.\" 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.
|
||||
\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
|
||||
Enlightenment.
|
||||
|
||||
|
@ -90,6 +90,6 @@ set command for acpi standby
|
|||
|
||||
.SH AUTHOR
|
||||
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
|
||||
SATO <ssato@sh.rim.or.jp>, WMMemLoad by Mark Staggs <me@markstaggs.net> and wmapm by Chris D.
|
||||
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.
|
||||
Faulhaber <jedgar@speck.ml.org> Michael G. Henderson <mghenderson@lanl.gov>.
|
||||
|
|
|
@ -173,7 +173,7 @@ int main(int argc, char **argv) {
|
|||
pixmap = dockapp_XCreatePixmap(SIZE, SIZE);
|
||||
|
||||
/* Initialize pixmap */
|
||||
if (backlight == LIGHTON)
|
||||
if (backlight == LIGHTON)
|
||||
dockapp_copyarea(backdrop_on, pixmap, 0, 0, SIZE, SIZE, 0, 0);
|
||||
else
|
||||
dockapp_copyarea(backdrop_off, pixmap, 0, 0, SIZE, SIZE, 0, 0);
|
||||
|
@ -261,9 +261,9 @@ static void update() {
|
|||
}
|
||||
|
||||
/* all clear */
|
||||
if (backlight == LIGHTON)
|
||||
if (backlight == LIGHTON)
|
||||
dockapp_copyarea(backdrop_on, pixmap, 0, 0, 58, 58, 0, 0);
|
||||
else
|
||||
else
|
||||
dockapp_copyarea(backdrop_off, pixmap, 0, 0, 58, 58, 0, 0);
|
||||
|
||||
/* draw digit */
|
||||
|
@ -547,7 +547,7 @@ int acpi_read(AcpiInfos *i) {
|
|||
fclose(fd);
|
||||
if(( ptr = strstr(buf,"charging state:"))) {
|
||||
stat = *(ptr + 25);
|
||||
switch (stat)
|
||||
switch (stat)
|
||||
{
|
||||
case 'd':
|
||||
i->battery_status=1;
|
||||
|
|
|
@ -19,7 +19,7 @@ wmauda: $(OBJS) $(HEADERS)
|
|||
|
||||
all: wmauda
|
||||
|
||||
clean:
|
||||
clean:
|
||||
rm -f *.o wmauda
|
||||
|
||||
install: all
|
||||
|
|
|
@ -18,7 +18,7 @@ Show summary of options.
|
|||
.B \-c, \-\-command
|
||||
Command to start Audacious (Default: audacious).
|
||||
.TP
|
||||
.B \-i, \-\-icon
|
||||
.B \-i, \-\-icon
|
||||
Icon to show instead of the default one when Audacious is not running. The
|
||||
icon must be in XPM format.
|
||||
.TP
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* wmauda - Dockapp for controlling Audacious
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2006 Michael Stewart <michael@alteredeclipse.org>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
|
@ -74,15 +74,15 @@ typedef struct
|
|||
{
|
||||
unsigned char ascii; gint x, y;
|
||||
} Charentry;
|
||||
|
||||
|
||||
Charentry chartable[] =
|
||||
{
|
||||
{ '-', 60, 73}, /* put here coordinates of characters */
|
||||
{ '.', 72, 73}, /* in xmms-dock-master.xpm */
|
||||
{ ',', 78, 73},
|
||||
{ ',', 78, 73},
|
||||
{ '\\', 84, 73},
|
||||
{ '/', 90, 73},
|
||||
{ '(', 96, 73},
|
||||
{ '/', 90, 73},
|
||||
{ '(', 96, 73},
|
||||
{ ')', 102, 73},
|
||||
{ '%', 108, 73},
|
||||
{ 'Ä', 114, 73},
|
||||
|
@ -98,10 +98,10 @@ Charentry chartable[] =
|
|||
{ ' ', 66, 73},
|
||||
};
|
||||
#define NUM_CHARS 19
|
||||
|
||||
#define VOLSLIDER_X 8
|
||||
|
||||
#define VOLSLIDER_X 8
|
||||
#define VOLSLIDER_Y 17
|
||||
#define VOLSLIDER_WIDTH 7
|
||||
#define VOLSLIDER_WIDTH 7
|
||||
|
||||
|
||||
#define VOLSLIDER_HEIGHT 40
|
||||
|
@ -116,7 +116,7 @@ Charentry chartable[] =
|
|||
#define SCROLLTEXT_X 5
|
||||
#define SCROLLTEXT_Y 6
|
||||
#define SCROLLTEXT_WIDTH 40
|
||||
#define SCROLLTEXT_HEIGHT 9
|
||||
#define SCROLLTEXT_HEIGHT 9
|
||||
#define SCROLLTEXT_CHARS 9
|
||||
|
||||
gboolean volslider_dragging = FALSE;
|
||||
|
@ -141,7 +141,7 @@ gboolean has_geometry = FALSE, single_click = FALSE, song_title = FALSE;
|
|||
char *icon_name = NULL;
|
||||
int win_x, win_y;
|
||||
|
||||
DBusGProxy *dbus_proxy = NULL;
|
||||
DBusGProxy *dbus_proxy = NULL;
|
||||
static DBusGConnection *connection = NULL;
|
||||
|
||||
GtkTargetEntry drop_types[] =
|
||||
|
@ -267,9 +267,9 @@ void real_draw_scrolltext(GdkWindow * w)
|
|||
char *title = audacious_remote_get_playlist_title(dbus_proxy, pl_pos);
|
||||
if (title)
|
||||
{
|
||||
/* render text */
|
||||
/* render text */
|
||||
gint i = 0, c = 0, pos = 0, dest = 0;
|
||||
|
||||
|
||||
for (i=0; i<SCROLLTEXT_CHARS; i++)
|
||||
{
|
||||
gint x = 66, y = 73;
|
||||
|
@ -300,7 +300,7 @@ void real_draw_scrolltext(GdkWindow * w)
|
|||
break;
|
||||
}
|
||||
}
|
||||
gdk_draw_pixmap(w, dock_gc, pixmap, x, y,
|
||||
gdk_draw_pixmap(w, dock_gc, pixmap, x, y,
|
||||
dest, SCROLLTEXT_Y, 7, 9);
|
||||
|
||||
}
|
||||
|
@ -511,10 +511,10 @@ static void update_tooltip(void)
|
|||
static int pl_pos = -1;
|
||||
static char *filename;
|
||||
int new_pos;
|
||||
|
||||
|
||||
if (!tooltips)
|
||||
return;
|
||||
|
||||
|
||||
new_pos = audacious_remote_get_playlist_pos(dbus_proxy);
|
||||
|
||||
if (new_pos == 0)
|
||||
|
@ -663,17 +663,17 @@ void drag_data_received(GtkWidget *widget, GdkDragContext *context,
|
|||
static gboolean dbus_init(void)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
|
||||
connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
|
||||
if (connection == NULL)
|
||||
return FALSE;
|
||||
|
||||
|
||||
dbus_proxy = dbus_g_proxy_new_for_name(connection, AUDACIOUS_DBUS_SERVICE,
|
||||
AUDACIOUS_DBUS_PATH,
|
||||
AUDACIOUS_DBUS_INTERFACE);
|
||||
if (dbus_proxy == NULL)
|
||||
return FALSE;
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -694,7 +694,7 @@ void init(void)
|
|||
tooltips = gtk_tooltips_new();
|
||||
gtk_tooltips_set_delay(tooltips, 1000);
|
||||
}
|
||||
|
||||
|
||||
icon_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
gtk_widget_set_app_paintable(icon_win, TRUE);
|
||||
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_reparent(icon_win->window, leader, 0, 0);
|
||||
gdk_window_show(leader);
|
||||
|
||||
|
||||
hints.initial_state = WithdrawnState;
|
||||
hints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint;
|
||||
hints.icon_window = GDK_WINDOW_XWINDOW(icon_win->window);
|
||||
hints.icon_x = 0;
|
||||
hints.icon_y = 0;
|
||||
hints.window_group = GDK_WINDOW_XWINDOW(leader);
|
||||
|
||||
|
||||
XSetWMHints(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(leader), &hints);
|
||||
|
||||
|
||||
gtk_widget_show(icon_win);
|
||||
timeout_tag = gtk_timeout_add(100, timeout_func, NULL);
|
||||
|
||||
|
@ -865,7 +865,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
if (!dbus_init())
|
||||
return 1;
|
||||
|
||||
|
||||
init();
|
||||
gtk_main();
|
||||
return 0;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
Main Author:
|
||||
Florian Krohs <florian.krohs@informatik.uni-oldenburg.de>
|
||||
|
||||
Based largely on work on wmacpiload WMMemMon, wmacpiload, WMCPULoad and
|
||||
WMMemLoad done by:
|
||||
Based largely on work on wmacpiload WMMemMon, wmacpiload, WMCPULoad and
|
||||
WMMemLoad done by:
|
||||
|
||||
Anthony Peacock
|
||||
Thomas Nemeth
|
||||
Seiichi SATO
|
||||
Mark Staggs
|
||||
Anthony Peacock
|
||||
Thomas Nemeth
|
||||
Seiichi SATO
|
||||
Mark Staggs
|
||||
And also on wmapm by :
|
||||
Chris D. Faulhaber
|
||||
Michael G. Henderson
|
||||
Chris D. Faulhaber
|
||||
Michael G. Henderson
|
||||
and maybe others
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
this software comes with no warranty.
|
||||
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>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Thanks to those who made the dockapps on which this program is based:
|
||||
Anthony Peacock
|
||||
Thomas Nemeth
|
||||
Seiichi SATO
|
||||
Mark Staggs
|
||||
Chris D. Faulhaber
|
||||
Michael G. Henderson
|
||||
Anthony Peacock
|
||||
Thomas Nemeth
|
||||
Seiichi SATO
|
||||
Mark Staggs
|
||||
Chris D. Faulhaber
|
||||
Michael G. Henderson
|
||||
|
|
|
@ -23,10 +23,10 @@ This manual page documents briefly the
|
|||
command.
|
||||
.PP
|
||||
.\" 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.
|
||||
\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
|
||||
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.
|
||||
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
|
||||
battery is discharging, and animated if it is charging.
|
||||
The animation speed may be set with the -s option.
|
||||
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.
|
||||
|
||||
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).
|
||||
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)
|
||||
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
|
||||
option ,$HOME/.wmbatteriesrc or /etc/wmbatteries, whichever comes first.
|
||||
|
@ -105,7 +105,7 @@ set command for acpi suspend
|
|||
set command for acpi standby
|
||||
.TP
|
||||
.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
|
||||
.TP
|
||||
.B \-ts, \-\-togglespeed <integer>
|
||||
|
|
|
@ -101,7 +101,7 @@ typedef struct AcpiInfos {
|
|||
|
||||
typedef struct RateListElem {
|
||||
long rate[2];
|
||||
struct RateListElem *next;
|
||||
struct RateListElem *next;
|
||||
} RateListElem;
|
||||
|
||||
typedef enum { LIGHTOFF, LIGHTON } light;
|
||||
|
@ -179,7 +179,7 @@ static void debug(char *debug_string){
|
|||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
|
||||
XEvent event;
|
||||
XpmColorSymbol colors[2] = { {"Back0", NULL, 0}, {"Back1", NULL, 0} };
|
||||
int ncolor = 0;
|
||||
|
@ -258,7 +258,7 @@ int main(int argc, char **argv) {
|
|||
pixmap = dockapp_XCreatePixmap(SIZE, SIZE);
|
||||
|
||||
/* Initialize pixmap */
|
||||
if (backlight == LIGHTON)
|
||||
if (backlight == LIGHTON)
|
||||
dockapp_copyarea(backdrop_on, pixmap, 0, 0, SIZE, SIZE, 0, 0);
|
||||
else
|
||||
dockapp_copyarea(backdrop_off, pixmap, 0, 0, SIZE, SIZE, 0, 0);
|
||||
|
@ -274,13 +274,13 @@ int main(int argc, char **argv) {
|
|||
while (1) {
|
||||
if (cur_acpi_infos.battery_status[0]==CHARGING || cur_acpi_infos.battery_status[1]==CHARGING)
|
||||
charging = 1;
|
||||
else
|
||||
else
|
||||
charging = 0;
|
||||
timeout = update_timeout;
|
||||
if( charging && animation_timeout<update_timeout){
|
||||
if(animation_timeout<toggle_timeout)
|
||||
timeout = animation_timeout;
|
||||
else if(togglemode) timeout = toggle_timeout;
|
||||
else if(togglemode) timeout = toggle_timeout;
|
||||
} else if(update_timeout<toggle_timeout)
|
||||
timeout = update_timeout;
|
||||
else if(togglemode) timeout = toggle_timeout;
|
||||
|
@ -300,7 +300,7 @@ int main(int argc, char **argv) {
|
|||
/* Time Out */
|
||||
update_timeout -= timeout;
|
||||
animation_timeout -= timeout;
|
||||
toggle_timeout -= timeout;
|
||||
toggle_timeout -= timeout;
|
||||
if(toggle_timeout<=0){
|
||||
toggle_timeout = togglespeed*1000;
|
||||
if(togglemode){
|
||||
|
@ -309,7 +309,7 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
}
|
||||
if(animation_timeout<=0){
|
||||
animation_timeout = animationspeed;
|
||||
animation_timeout = animationspeed;
|
||||
if(charging){
|
||||
blink_batt();
|
||||
show = 1;
|
||||
|
@ -319,7 +319,7 @@ int main(int argc, char **argv) {
|
|||
update();
|
||||
show = 1;
|
||||
update_timeout = update_interval*1000;
|
||||
}
|
||||
}
|
||||
if(show) {
|
||||
/* show */
|
||||
draw_all();
|
||||
|
@ -404,7 +404,7 @@ int init_stats(AcpiInfos *k) {
|
|||
// initialize buffer
|
||||
if ((rateElements = (RateListElem *) malloc(history_size * sizeof(RateListElem))) == NULL)
|
||||
exit(-1);
|
||||
|
||||
|
||||
firstRateElem = rateElements;
|
||||
|
||||
|
||||
|
@ -418,7 +418,7 @@ int init_stats(AcpiInfos *k) {
|
|||
ptr += 25;
|
||||
sscanf(ptr,"%d",&k->currcap[bat]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((fd = fopen(state_files[bat], "r"))) {
|
||||
fread(buf,512,1,fd);
|
||||
fclose(fd);
|
||||
|
@ -436,7 +436,7 @@ int init_stats(AcpiInfos *k) {
|
|||
(*(rateElements+hist)).rate[i] = k->rate[i];
|
||||
}
|
||||
(*(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);
|
||||
k->ac_line_status = 0;
|
||||
|
@ -519,7 +519,7 @@ static void parse_config_file(char *config){
|
|||
DEBUGSTRING("config file found\n");
|
||||
} else {
|
||||
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"))){
|
||||
DEBUGSTRING("config file found\n");
|
||||
}
|
||||
|
@ -533,7 +533,7 @@ static void parse_config_file(char *config){
|
|||
DEBUGSTRING("begin parsing\n");
|
||||
while( fgets( line, 255, fd ) != NULL )
|
||||
{
|
||||
|
||||
|
||||
item = strtok( line, "\t =\n\r" ) ;
|
||||
if( item != NULL && item[0] != '#' )
|
||||
{
|
||||
|
@ -547,7 +547,7 @@ static void parse_config_file(char *config){
|
|||
} else {
|
||||
backlight = LIGHTOFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!strcmp(item,"lightcolor")){
|
||||
|
@ -610,7 +610,7 @@ static void parse_config_file(char *config){
|
|||
tmp=atoi(value);
|
||||
if(tmp<100) {
|
||||
printf("animationspeed variable is out of range in line %i,must be >= 100\n",linenr);
|
||||
} else {
|
||||
} else {
|
||||
animationspeed=tmp;
|
||||
}
|
||||
}
|
||||
|
@ -619,7 +619,7 @@ static void parse_config_file(char *config){
|
|||
tmp=atoi(value);
|
||||
if(tmp<1 || tmp>1000) {
|
||||
printf("historysize variable is out of range in line %i,must be >=1 and <=1000\n",linenr);
|
||||
} else {
|
||||
} else {
|
||||
history_size=tmp;
|
||||
}
|
||||
}
|
||||
|
@ -627,7 +627,7 @@ static void parse_config_file(char *config){
|
|||
if(!strcmp(item,"mode")){
|
||||
if(strcmp(value,"rate") && strcmp(value,"toggle") && strcmp(value,"toggle")) {
|
||||
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,"temp")) mode=TEMP;
|
||||
if(strcmp(value,"toggle")) togglemode=1;
|
||||
|
@ -650,9 +650,9 @@ static void draw_all(){
|
|||
long allremain=0;
|
||||
long allcapacity=0;
|
||||
/* all clear */
|
||||
if (backlight == LIGHTON)
|
||||
if (backlight == LIGHTON)
|
||||
dockapp_copyarea(backdrop_on, pixmap, 0, 0, 58, 58, 0, 0);
|
||||
else
|
||||
else
|
||||
dockapp_copyarea(backdrop_off, pixmap, 0, 0, 58, 58, 0, 0);
|
||||
/* draw digit */
|
||||
draw_remaining_time(cur_acpi_infos);
|
||||
|
@ -662,7 +662,7 @@ static void draw_all(){
|
|||
draw_pcgraph(cur_acpi_infos);
|
||||
|
||||
if(cur_acpi_infos.low) draw_low();
|
||||
|
||||
|
||||
draw_batt(cur_acpi_infos);
|
||||
}
|
||||
|
||||
|
@ -701,7 +701,7 @@ static void draw_batt(AcpiInfos infos){
|
|||
int i=0;
|
||||
if (backlight == LIGHTON) y = 28;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -757,7 +757,7 @@ static void blink_batt(){
|
|||
if(cur_acpi_infos.battery_status[bat]==CHARGING){
|
||||
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;
|
||||
}
|
||||
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);
|
||||
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);
|
||||
|
@ -806,7 +806,7 @@ static void draw_pcgraph(AcpiInfos infos) {
|
|||
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]%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)
|
||||
fprintf(stderr, "%s: argument %s must be positive integer\n",
|
||||
argv[0], argv[i],update_interval), exit(1);
|
||||
togglespeed=integer;
|
||||
i++;
|
||||
togglespeed=integer;
|
||||
i++;
|
||||
} else if (!strcmp(argv[i], "--animationspeed") || !strcmp(argv[i], "-as")) {
|
||||
if (argc == i + 1)
|
||||
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)
|
||||
fprintf(stderr, "%s: argument %s must be >=100\n",
|
||||
argv[0], argv[i]), exit(1);
|
||||
animationspeed=integer;
|
||||
i++;
|
||||
animationspeed=integer;
|
||||
i++;
|
||||
} else if (!strcmp(argv[i], "--historysize") || !strcmp(argv[i], "-hs")) {
|
||||
if (argc == i + 1)
|
||||
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",
|
||||
argv[0], argv[i]), exit(1);
|
||||
history_size=integer;
|
||||
i++;
|
||||
i++;
|
||||
} else if (!strcmp(argv[i], "--mode") || !strcmp(argv[i], "-m")) {
|
||||
if (argc == i + 1)
|
||||
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);
|
||||
if(character=='s') togglemode=1;
|
||||
else if(character=='t') mode=TEMP;
|
||||
else if(character=='r') mode=RATE;
|
||||
else if(character=='r') mode=RATE;
|
||||
i++;
|
||||
} else if (!strcmp(argv[i], "--standby") || !strcmp(argv[i], "-S")) {
|
||||
standby_cmd = argv[i + 1];
|
||||
|
@ -956,10 +956,10 @@ static void print_help(char *prog)
|
|||
" -S, --standby <string> set command for acpi standby\n"
|
||||
" -m, --mode [t|r|s] set mode for the lower row , \n"
|
||||
" t=temperature,r=current rate,s=toggle\n"
|
||||
" -ts --togglespeed <int> set toggle speed in seconds\n"
|
||||
" -as --animationspeed <int> set speed for charging animation in msec\n"
|
||||
" -ts --togglespeed <int> set toggle speed in seconds\n"
|
||||
" -as --animationspeed <int> set speed for charging animation in msec\n"
|
||||
" -hs --historysize <int> set size of history for calculating\n"
|
||||
" average power consumption rate\n",
|
||||
" average power consumption rate\n",
|
||||
prog, prog);
|
||||
/* OPTIONS SUPP :
|
||||
* ? -f, --file : configuration file
|
||||
|
@ -1035,8 +1035,8 @@ int acpi_read(AcpiInfos *i) {
|
|||
long allremain=0;
|
||||
|
||||
rate = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
DEBUGSTRING("acpi_read()\n")
|
||||
|
||||
/* 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;
|
||||
}
|
||||
for(bat=0;bat<number_of_batteries;bat++){
|
||||
|
||||
|
||||
if ((fd = fopen(state_files[bat], "r"))) {
|
||||
bzero(buf, 512);
|
||||
fread(buf,512,1,fd);
|
||||
fclose(fd);
|
||||
if(( ptr = strstr(buf,"charging state:"))) {
|
||||
stat = *(ptr + 25);
|
||||
switch (stat)
|
||||
switch (stat)
|
||||
{
|
||||
case 'd':
|
||||
i->battery_status[bat]=1;
|
||||
|
@ -1081,7 +1081,7 @@ int acpi_read(AcpiInfos *i) {
|
|||
sscanf(ptr,"%d",&((*firstRateElem).rate[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 {
|
||||
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){
|
||||
time = (float)(i->remain[0]+i->remain[1])/(float)(i->rate[0]+i->rate[1]);
|
||||
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){
|
||||
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)){
|
||||
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;
|
||||
if(allcapacity>0){
|
||||
if(((double)allremain/(double)allcapacity)*100<alarm_level){
|
||||
if(((double)allremain/(double)allcapacity)*100<alarm_level){
|
||||
cur_acpi_infos.low=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DEBUGSTRING("MID acpi_read()\n")
|
||||
firstRateElem = ((*firstRateElem).next);
|
||||
DEBUGSTRING("MID acpi_read()\n")
|
||||
firstRateElem = ((*firstRateElem).next);
|
||||
free(buf);
|
||||
DEBUGSTRING("END acpi_read()\n")
|
||||
return retcode;
|
||||
|
|
|
@ -209,7 +209,7 @@ wmbattery (2.19) unstable; urgency=low
|
|||
on systems that label a fully charged battery's charging rate as
|
||||
unknown and state as charging.
|
||||
* 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
|
||||
battery that is not fully charging.
|
||||
* 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
|
||||
|
||||
* 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
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ Conversely, here are some reasons to stick with wmapm:
|
|||
- You like its look.
|
||||
- It has a neat rainbow-colored progress bar.
|
||||
- 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.
|
||||
|
||||
Still, forking is evil, and if I was doing this all over again, I suppose
|
||||
|
|
|
@ -7,5 +7,5 @@
|
|||
programs use it).
|
||||
* Make -b 0 display an overall average of the status of all batteries,
|
||||
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.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* 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
|
||||
* 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
|
||||
* from a file, slow if called many times. */
|
||||
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 i;
|
||||
char **devices = malloc(ACPI_MAXITEM * sizeof(char *));
|
||||
|
||||
|
||||
char pathname[128];
|
||||
|
||||
sprintf(pathname, SYSFS_PATH);
|
||||
|
@ -185,7 +185,7 @@ int find_items (char *itemname, char infoarray[ACPI_MAXITEM][128],
|
|||
char filename[128];
|
||||
char buf[1024];
|
||||
|
||||
if (!strcmp(".", ent->d_name) ||
|
||||
if (!strcmp(".", ent->d_name) ||
|
||||
!strcmp("..", ent->d_name))
|
||||
continue;
|
||||
|
||||
|
@ -270,10 +270,10 @@ int acpi_supported (void) {
|
|||
return 0;
|
||||
}
|
||||
closedir(dir);
|
||||
|
||||
|
||||
/* If kernel is 2.6.21 or newer, version is in
|
||||
/sys/module/acpi/parameters/acpica_version */
|
||||
|
||||
|
||||
version = get_acpi_file("/sys/module/acpi/parameters/acpica_version");
|
||||
if (version == NULL) {
|
||||
return 0;
|
||||
|
@ -284,13 +284,13 @@ int acpi_supported (void) {
|
|||
version, ACPI_VERSION);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
find_batteries();
|
||||
find_ac_adapters();
|
||||
#if ACPI_THERMAL
|
||||
find_thermal();
|
||||
#endif
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -299,7 +299,7 @@ int acpi_supported (void) {
|
|||
* apm_info struct. */
|
||||
int acpi_read (int battery, apm_info *info) {
|
||||
char *buf, *state;
|
||||
|
||||
|
||||
if (acpi_batt_count == 0) {
|
||||
info->battery_percentage = 0;
|
||||
info->battery_time = 0;
|
||||
|
@ -309,10 +309,10 @@ int acpi_read (int battery, apm_info *info) {
|
|||
info->ac_line_status = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Internally it's zero indexed. */
|
||||
battery--;
|
||||
|
||||
|
||||
buf = get_acpi_file(acpi_batt_info[battery]);
|
||||
if (buf == NULL) {
|
||||
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->battery_flags = 0;
|
||||
info->using_minutes = 1;
|
||||
|
||||
|
||||
/* Work out if the battery is present, and what percentage of full
|
||||
* it is and how much time is left. */
|
||||
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;
|
||||
}
|
||||
else {
|
||||
/* a zero or unknown in the file; time
|
||||
/* a zero or unknown in the file; time
|
||||
* unknown so use a negative one to
|
||||
* indicate this */
|
||||
info->battery_time = -1;
|
||||
|
@ -439,7 +439,7 @@ int acpi_read (int battery, apm_info *info) {
|
|||
info->ac_line_status = on_ac_power();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* A not-yet-general-purpose ACPI library, by Joey Hess <joey@kitenet.net>
|
||||
*/
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#define BATTERY_FLAGS_CRITICAL (0x4)
|
||||
#define BATTERY_FLAGS_CHARGING (0x8)
|
||||
#define BATTERY_FLAGS_ABSENT (0x80)
|
||||
|
||||
|
||||
#define BATTERY_PERCENTAGE_UNKNOWN (-1)
|
||||
|
||||
#define BATTERY_TIME_UNKNOWN (-1)
|
||||
|
|
|
@ -115,7 +115,7 @@ fi
|
|||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
else
|
||||
|
@ -124,7 +124,7 @@ if [ x"$dir_arg" != x ]; then
|
|||
else
|
||||
|
||||
# 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 [ -f $src -o -d $src ]
|
||||
|
@ -134,7 +134,7 @@ else
|
|||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
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.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
|
@ -201,17 +201,17 @@ else
|
|||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
|
@ -242,7 +242,7 @@ else
|
|||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ int connect_hal (void) {
|
|||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int hal_ready (void) {
|
||||
if (hal_ctx && dbus_connection_get_is_connected(dbus_ctx)) {
|
||||
return 1;
|
||||
|
@ -83,7 +83,7 @@ signed int get_hal_int (const char *udi, const char *key, int optional) {
|
|||
dbus_error_init(&error);
|
||||
|
||||
ret = libhal_device_get_property_int (hal_ctx, udi, key, &error);
|
||||
|
||||
|
||||
if (! dbus_error_is_set (&error)) {
|
||||
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) {
|
||||
int ret;
|
||||
DBusError error;
|
||||
|
||||
|
||||
if (! hal_ready()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
dbus_error_init(&error);
|
||||
|
||||
ret = libhal_device_get_property_bool (hal_ctx, udi, key, &error);
|
||||
|
||||
|
||||
if (! dbus_error_is_set (&error)) {
|
||||
return ret;
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ int simplehal_read (int battery, apm_info *info) {
|
|||
info->battery_status = BATTERY_STATUS_ABSENT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* remaining_time and charge_level.percentage are not a mandatory
|
||||
* keys, so if not present, -1 will be returned */
|
||||
info->battery_time = get_hal_int(device, "battery.remaining_time", 1);
|
||||
|
|
|
@ -29,9 +29,9 @@ int sonypi_read (apm_info *info) {
|
|||
__u8 batflags;
|
||||
__u16 cap, rem;
|
||||
int havebatt = 0;
|
||||
|
||||
|
||||
info->using_minutes = info->battery_flags = 0;
|
||||
|
||||
|
||||
if (! sonypi_ioctl(SONYPI_IOCGBATFLAGS, &batflags)) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ int sonypi_read (apm_info *info) {
|
|||
info->battery_percentage = 0;
|
||||
info->battery_status = BATTERY_STATUS_ABSENT;
|
||||
}
|
||||
|
||||
|
||||
if (havebatt) {
|
||||
info->battery_percentage = 100 * rem / cap;
|
||||
/* Guess at whether the battery is charging. */
|
||||
|
@ -66,9 +66,9 @@ int sonypi_read (apm_info *info) {
|
|||
info->battery_status = BATTERY_STATUS_CHARGING;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Sadly, there is no way to estimate this. */
|
||||
info->battery_time = 0;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ wmbattery \- dockable battery monitor
|
|||
.SH DESCRIPTION
|
||||
.PP
|
||||
.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.
|
||||
.PP
|
||||
.B wmbattery
|
||||
|
@ -93,7 +93,7 @@ switch.
|
|||
.B \-e
|
||||
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
|
||||
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.
|
||||
.TP
|
||||
.B \-s granularity
|
||||
|
|
|
@ -59,7 +59,7 @@ signed int critical_pct = -1;
|
|||
|
||||
void error(const char *fmt, ...) {
|
||||
va_list arglist;
|
||||
|
||||
|
||||
va_start(arglist, fmt);
|
||||
fprintf(stderr, "Error: ");
|
||||
vfprintf(stderr, fmt, arglist);
|
||||
|
@ -213,7 +213,7 @@ char *parse_commandline(int argc, char *argv[]) {
|
|||
char *ret=NULL;
|
||||
char *s;
|
||||
extern char *optarg;
|
||||
|
||||
|
||||
while (c != -1) {
|
||||
c=getopt(argc, argv, "hd:g:if:b:w:c:l:es:a:");
|
||||
switch (c) {
|
||||
|
@ -323,17 +323,17 @@ void make_window(char *display_name, int argc, char *argv[]) {
|
|||
classhint.res_name = wname;
|
||||
classhint.res_class = wname;
|
||||
XSetClassHint(display, win, &classhint);
|
||||
|
||||
|
||||
if (! XStringListToTextProperty(&wname, 1, &name))
|
||||
error("Can't allocate window name.");
|
||||
|
||||
XSetWMName(display, win, &name);
|
||||
|
||||
|
||||
/* Create GC for drawing */
|
||||
gcv.foreground = fore_pix;
|
||||
gcv.background = back_pix;
|
||||
gcv.graphics_exposures = 0;
|
||||
NormalGC = XCreateGC(display, root,
|
||||
NormalGC = XCreateGC(display, root,
|
||||
GCForeground | GCBackground | GCGraphicsExposures,
|
||||
&gcv);
|
||||
|
||||
|
@ -343,15 +343,15 @@ void make_window(char *display_name, int argc, char *argv[]) {
|
|||
pixmask, ShapeSet);
|
||||
XShapeCombineMask(display, iconwin, ShapeBounding, 0, 0,
|
||||
pixmask, ShapeSet);
|
||||
|
||||
|
||||
wmhints.initial_state = initial_state;
|
||||
wmhints.icon_window = iconwin;
|
||||
wmhints.icon_x = sizehints.x;
|
||||
wmhints.icon_y = sizehints.y;
|
||||
wmhints.window_group = win;
|
||||
wmhints.flags = StateHint | IconWindowHint |
|
||||
wmhints.flags = StateHint | IconWindowHint |
|
||||
IconPositionHint | WindowGroupHint;
|
||||
|
||||
|
||||
XSetWMHints(display, win, &wmhints);
|
||||
XSetCommand(display, win, argv, argc);
|
||||
|
||||
|
@ -363,7 +363,7 @@ void make_window(char *display_name, int argc, char *argv[]) {
|
|||
|
||||
void flush_expose(Window w) {
|
||||
XEvent dummy;
|
||||
|
||||
|
||||
while (XCheckTypedWindowEvent(display, w, Expose, &dummy));
|
||||
}
|
||||
|
||||
|
@ -371,7 +371,7 @@ void redraw_window() {
|
|||
XCopyArea(display, images[FACE], iconwin, NormalGC, 0, 0,
|
||||
image_info[FACE].width, image_info[FACE].height, 0,0);
|
||||
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);
|
||||
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.
|
||||
* Note that 10 is passed for special characters `:' or `1' at the
|
||||
* end of the font.
|
||||
* Note that 10 is passed for special characters `:' or `1' at the
|
||||
* end of the font.
|
||||
*/
|
||||
void draw_letter(int letter, int font, int x) {
|
||||
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. */
|
||||
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].x, image_info[image].y);
|
||||
}
|
||||
|
@ -407,7 +407,7 @@ void draw_image(int image) {
|
|||
void recalc_window(apm_info cur_info) {
|
||||
int time_left, hour_left, min_left, digit, x;
|
||||
static int blinked = 0;
|
||||
|
||||
|
||||
/* Display if it's plugged in. */
|
||||
switch (cur_info.ac_line_status) {
|
||||
case AC_LINE_STATUS_ON:
|
||||
|
@ -416,7 +416,7 @@ void recalc_window(apm_info cur_info) {
|
|||
default:
|
||||
draw_image(UNPLUGGED);
|
||||
}
|
||||
|
||||
|
||||
/* Display the appropriate color battery. */
|
||||
switch (cur_info.battery_status) {
|
||||
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
|
||||
* clearing the time left field.
|
||||
* clearing the time left field.
|
||||
*/
|
||||
x=DIAL_MULTIPLIER * cur_info.battery_percentage;
|
||||
if (x >= 0) {
|
||||
|
@ -463,7 +463,7 @@ void recalc_window(apm_info cur_info) {
|
|||
image_info[DIAL_DIM].height,
|
||||
image_info[DIAL_DIM].x + x,
|
||||
image_info[DIAL_DIM].y);
|
||||
|
||||
|
||||
/* Show percent remaining */
|
||||
if (cur_info.battery_percentage >= 0) {
|
||||
digit = cur_info.battery_percentage / 10;
|
||||
|
@ -494,7 +494,7 @@ void recalc_window(apm_info cur_info) {
|
|||
if (cur_info.using_minutes)
|
||||
time_left = cur_info.battery_time;
|
||||
else
|
||||
time_left = cur_info.battery_time / 60;
|
||||
time_left = cur_info.battery_time / 60;
|
||||
hour_left = time_left / 60;
|
||||
min_left = time_left % 60;
|
||||
digit = hour_left / 10;
|
||||
|
@ -505,7 +505,7 @@ void recalc_window(apm_info cur_info) {
|
|||
draw_letter(digit,BIGFONT,MINUTES_TENS_OFFSET);
|
||||
digit = min_left % 10;
|
||||
draw_letter(digit,BIGFONT,MINUTES_ONES_OFFSET);
|
||||
|
||||
|
||||
redraw_window();
|
||||
}
|
||||
|
||||
|
@ -562,9 +562,9 @@ void alarmhandler(int sig) {
|
|||
* cannot determine time. */
|
||||
if (always_estimate_remaining || cur_info.battery_time < 0)
|
||||
estimate_timeleft(&cur_info);
|
||||
|
||||
|
||||
/* 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) {
|
||||
if (cur_info.battery_percentage <= critical_pct)
|
||||
cur_info.battery_status = BATTERY_STATUS_CRITICAL;
|
||||
|
@ -573,7 +573,7 @@ void alarmhandler(int sig) {
|
|||
else
|
||||
cur_info.battery_status = BATTERY_STATUS_HIGH;
|
||||
}
|
||||
|
||||
|
||||
/* If APM data changes redraw and wait for next update */
|
||||
/* Always redraw if the status is critical, to make it blink. */
|
||||
if (!apm_change(&cur_info) || cur_info.battery_status == BATTERY_STATUS_CRITICAL)
|
||||
|
@ -638,7 +638,7 @@ int main(int argc, char *argv[]) {
|
|||
else {
|
||||
error("No APM, ACPI, UPOWER, HAL or SPIC support detected.");
|
||||
}
|
||||
|
||||
|
||||
load_images();
|
||||
load_audio();
|
||||
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
Copyrights
|
||||
|
||||
This program was written by Gennady Belyakov [8]gb@ccat.elect.ru
|
||||
|
||||
|
||||
Exterior appearance was heavily derived from wminet, written by
|
||||
Dave Clark (clarkd@skynet.ca),
|
||||
Antoine Nulle (warp@xs4all.nl),
|
||||
Martijn Pieterse (pieterse@xs4all.nl)
|
||||
|
||||
|
||||
Some code (around mailbox checking, with some modifications) was taken
|
||||
from xled, written by
|
||||
Jan Schoenepauck (schoenep@uni-wuppertal.de) and
|
||||
Joachim Gassen (joachim@fb4-1112.uni-muenster.de)
|
||||
|
||||
|
||||
POP3 checking code was taken from wmpop3 by
|
||||
Scott Holden (scotth@thezone.net)
|
||||
|
||||
Additional code was taken from xlassie, written by
|
||||
Trent Piepho <xyzzy@speakeasy.net>
|
||||
|
||||
|
||||
Many thanks for:
|
||||
Angus Mackay (amackay@gusnet.cx)
|
||||
Jordi Mallach Pérez (jordi@sindominio.net)
|
||||
|
|
40
wmbiff/FAQ
40
wmbiff/FAQ
|
@ -29,7 +29,7 @@ tracker #706995).
|
|||
* WMBiff doesn't work. How do I submit a bug?
|
||||
|
||||
See the Troubleshooting section of the wmbiffrc man
|
||||
page.
|
||||
page.
|
||||
|
||||
If that doesn't work, run 'wmbiff -debug > wmbiff.log' and
|
||||
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
|
||||
doesn't support it without locking the mailbox).
|
||||
- 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).
|
||||
|
||||
Previously suggested features that are really hard:
|
||||
- Support dock sizes other than 64x64
|
||||
- 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?
|
||||
|
||||
Start a conversation on wmbiff-devel, and you'll probably
|
||||
get some help.
|
||||
|
||||
Tidbits:
|
||||
Avoid creating new Clients.
|
||||
- If you want an existing client to do something differently,
|
||||
find a way to parameterize its behavior.
|
||||
get some help.
|
||||
|
||||
Tidbits:
|
||||
Avoid creating new Clients.
|
||||
- If you want an existing client to do something differently,
|
||||
find a way to parameterize its behavior.
|
||||
- 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').
|
||||
If you must create a new client, Avoid Duplicating Code.
|
||||
Document your patch. Add entries as appropriate to:
|
||||
|
@ -76,11 +76,11 @@ Tidbits:
|
|||
|
||||
* 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.
|
||||
|
||||
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wmbiff login
|
||||
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wmbiff co wmbiff
|
||||
|
||||
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wmbiff login
|
||||
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wmbiff co wmbiff
|
||||
|
||||
* I added a feature to WMBiff. How do I submit a patch?
|
||||
** 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)
|
||||
make indent
|
||||
cd ..
|
||||
make distclean
|
||||
make distclean
|
||||
cd ..
|
||||
mv wmbiff-x.x.x wmbiff-changed
|
||||
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
|
||||
cd ..
|
||||
[ optionally 'make distcheck' ]
|
||||
make maintainer-clean
|
||||
make maintainer-clean
|
||||
cvs update -d
|
||||
[ resolve any conflicts ]
|
||||
cvs diff -u | less [ make sure the differences are roughly correct ]
|
||||
cd ..
|
||||
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
|
||||
|
||||
|
||||
** Sending the patch
|
||||
Submit my-patch as an attachment to mail sent to
|
||||
wmbiff-devel. Don't forget to subscribe to the mailing list
|
||||
so that we can discuss your patch. This is roughly the same
|
||||
procedure you'll use to submit patches to any code, although
|
||||
others may not have the 'make indent' step.
|
||||
|
||||
|
||||
* This FAQ is wrong.
|
||||
|
||||
* This FAQ is wrong.
|
||||
|
||||
Send mail to wmbiff-devel@lists.sourceforge.net.
|
||||
|
||||
|
|
|
@ -25,11 +25,11 @@ dist-hook-local: ChangeLog
|
|||
chmod -R g-s .
|
||||
|
||||
indent:
|
||||
cd wmbiff && make indent
|
||||
cd wmgeneral && make indent
|
||||
cd wmbiff && make indent
|
||||
cd wmgeneral && make indent
|
||||
|
||||
# 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 \
|
||||
echo "Running $(CVS2CL)..."; \
|
||||
$(CVS2CL) --stdout --utc --day-of-week -I TODO -I NEWS -I .cvsignore | \
|
||||
|
|
100
wmbiff/NEWS
100
wmbiff/NEWS
|
@ -20,7 +20,7 @@ Release 0.4.24 - June 22, 2004
|
|||
unstable package libgnutls10-dev.
|
||||
|
||||
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).
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
* Sam Izzo's patch for changing the mouse click action
|
||||
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.
|
||||
|
||||
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
|
||||
* Bugfix to an infinite loop found in the
|
||||
* Bugfix to an infinite loop found in the
|
||||
TLS interface.
|
||||
|
||||
|
||||
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
|
||||
with mutt.
|
||||
* 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.
|
||||
* New buttontwo (middle click) action to complement
|
||||
* New buttontwo (middle click) action to complement
|
||||
action (left mouse click) and fetchcmd (right mouse).
|
||||
* #'s are now only comments in .wmbiffrc at the
|
||||
beginning of lines or following whitespace,
|
||||
* #'s are now only comments in .wmbiffrc at the
|
||||
beginning of lines or following whitespace,
|
||||
allowing #'s in (most) passwords.
|
||||
* AppleScript examples for driving Apple's Mail
|
||||
* AppleScript examples for driving Apple's Mail
|
||||
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
|
||||
and program output for shell methods. This is
|
||||
intended to be faster than starting up a new
|
||||
and program output for shell methods. This is
|
||||
intended to be faster than starting up a new
|
||||
mail program or re-executing a script.
|
||||
* Avoid repetitive error messages when disconnected.
|
||||
* Use conventional -geometry option handling.
|
||||
* Fix bug in 0.4.15 to re-enable *'s in IMAP passwords.
|
||||
|
||||
Release 0.4.15 - Mar 30, 2003
|
||||
* Frobnicate internally stored passwords, partially
|
||||
obfuscating them in memory. Not actually more
|
||||
* Frobnicate internally stored passwords, partially
|
||||
obfuscating them in memory. Not actually more
|
||||
secure, but harder to casually discover a password.
|
||||
* Tighten configuration file lines to more quickly
|
||||
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
|
||||
* Handle building on systems with both posix and gnu
|
||||
regex in different but conflicting files.
|
||||
* Restart wmbiff on SIGUSR1. You may need to use
|
||||
regex in different but conflicting files.
|
||||
* Restart wmbiff on SIGUSR1. You may need to use
|
||||
'killall -USR1 wmbiff' if it gets stuck.
|
||||
* Restart wmbiff on ctrl-shift mouse 1.
|
||||
|
||||
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.
|
||||
* Portability to Mac OS X, Solaris, and probably BSD
|
||||
restored (thanks sourceforge compile farm!) with a
|
||||
|
@ -107,14 +107,14 @@ Release 0.4.12 - Jan 3, 2003
|
|||
-geometry handling. (Debian #173813)
|
||||
|
||||
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/
|
||||
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).
|
||||
* Internal cleanups to allow long askpass commands.
|
||||
|
||||
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
|
||||
sounds from every mailbox.
|
||||
* -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
|
||||
* GNUTLS v0.5.9 or higher required
|
||||
* Check TLS certificate hostname against the hostname we're
|
||||
connecting to. This raises the bar, but does not make
|
||||
wmbiff's TLS implementation secure against man in the
|
||||
connecting to. This raises the bar, but does not make
|
||||
wmbiff's TLS implementation secure against man in the
|
||||
middle attacks.
|
||||
* WMBiff scales to the number of mailboxes you're
|
||||
using. For openbox, this means less wasted space in the
|
||||
slit and the possibility of up to 40 mailboxes. For
|
||||
WindowMaker, this means more pretty chrome and less dark
|
||||
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.
|
||||
|
||||
|
||||
Release 0.4.8 - Sept 18, 2002
|
||||
* GNUTLS v0.5.1-0.5.6, gcrypt v1.1.8 required.
|
||||
* 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
|
||||
|
||||
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
|
||||
to 0.4.3. Certificate checking may be slightly more strict.
|
||||
* 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.
|
||||
* Mouse handling fix.
|
||||
* 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.
|
||||
* GNUTLS version 0.3.5 is expected; earlier and later versions
|
||||
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
|
||||
may be incompatible.
|
||||
* 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).
|
||||
* skinfile: Background pixmaps can be specified in .wmbiffrc.
|
||||
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.
|
||||
* finger: Finger client added - finger a user's mailbox to get its
|
||||
status. Requires perl and finger commands. See wmbiffrc(5).
|
||||
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
|
||||
line, the text will be in yellow. Thanks to Andelko Horvat.
|
||||
* mbox: Paths can be specified including shell expressions
|
||||
in `'s. If requested, this feature can be expanded to other
|
||||
* mbox: Paths can be specified including shell expressions
|
||||
in `'s. If requested, this feature can be expanded to other
|
||||
clients. Nested expressions are not supported.
|
||||
* 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.
|
||||
* Migrated to automake / autoconf to detect defaults for
|
||||
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
|
||||
spaces. This works well, as passwords/user-id's all agree that
|
||||
the space is a non-legit value.
|
||||
|
||||
|
||||
Example: assume my password is: myEmailhasa@init
|
||||
|
||||
|
||||
Old way:
|
||||
path.3=pop3:debian4tux:myEmailhasa@init@mail.telocity.com
|
||||
|
||||
New way:
|
||||
path.3=pop3:debian4tux myEmailhasa@init mail.telcoity.com
|
||||
|
||||
|
||||
Ahh...before you say it. "Backward compatibility?" You will
|
||||
also find in the patch, a NEW function. So that the OLD and
|
||||
NEW way is easily compatible with all ".wmbiffrc" files.
|
||||
|
||||
|
||||
Dev. Comments:
|
||||
This was not the cleanest way to implement it, but I had to
|
||||
suffice with a clean/quick implementation. I originally wrote
|
||||
one function to handle past and new parsing. However, I
|
||||
thought it would be beneficial to leave them separated, so we
|
||||
could eventually drop the old method?
|
||||
|
||||
|
||||
Related Changes:
|
||||
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.
|
||||
|
@ -357,7 +357,7 @@ Release 0.2q1 - Fri, 13 Apr 2001 02:47:10 -0400
|
|||
* wmbiff/wmbiff.c:
|
||||
- for (index = 0; index < 4; index++)
|
||||
+ for (index = 0; index < 5; index++)
|
||||
|
||||
|
||||
BUG! Last postion #4 was not correctly being checked.
|
||||
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>.
|
||||
* wmbiff/{*.[ch]}: removed unnecesary includes.
|
||||
* wmbiff/wmbiff.c: some cleanups and optimizations.
|
||||
* wmbiff/wmbiff.c: some cleanups and optimizations.
|
||||
+ init_biff:
|
||||
* show error if user config file does not exists
|
||||
* 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
|
||||
+ parse_cmd: some changes to make uconfig_file local
|
||||
+ {BlinkOn, BlinkOff, BlinkToogle}: Removed (merged by do_biff)
|
||||
+ {ReadConfigString, ReadConfigInt}: Removed
|
||||
+ {ReadConfigString, ReadConfigInt}: Removed
|
||||
+ countmail: removed init in header (wasn't used)
|
||||
+ ReadLine: Created (new parsing code, extracts pairs of setting
|
||||
and value)
|
||||
+ 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.
|
||||
|
||||
|
||||
|
@ -398,7 +398,7 @@ Release 0.2p - Mon, 12 Mar 2001 00:00:00 -0600
|
|||
* All your base are belong to us.
|
||||
* I'm not maintaining wmBiff; I just submitted a big patch. Send your
|
||||
complaints (or complements) to Yong-iL Joh.
|
||||
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
* This release is by Yong-iL Joh <tolkien@mizi.com>.
|
||||
* Nick Clarey <nclarey@3glab.com> sent me a patch.
|
||||
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
|
||||
|
||||
|
||||
* This release is by Yong-iL Joh <tolkien@mizi.com>.
|
||||
* Imap4Client.c had a bug when trying to connect to an imap4 server. Fixed
|
||||
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,
|
||||
Y2K. (Dwayne C. Litzenberger)
|
||||
* 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>.
|
||||
* We don't actually know the time zone of Gennady's changelog entries
|
||||
(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
|
||||
|
||||
|
||||
* This release is by Gennady Belyakov <gb@ccat.elect.ru>.
|
||||
* Some fixes with intialization
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
Introducing
|
||||
|
||||
|
||||
WMBiff is an WindowMaker docking utility, that displays number of
|
||||
total messages count or unread mail messages count in differrent
|
||||
mailboxes.
|
||||
|
@ -10,26 +10,26 @@
|
|||
|
||||
Green ( cyan? :) ) digits display total number of messages, if there
|
||||
are no unread messages in it.
|
||||
|
||||
|
||||
Yellow digits display number of unread messages, with blinking on new
|
||||
mail arrival, if any.
|
||||
|
||||
|
||||
At this moment unix-style (mbox), maildir, POP3, APOP and IMAP mailboxes
|
||||
are supported. WMBiff also understands Licq's history files.
|
||||
WMBiff supports up to 5 mailboxes (but you can start 2 or more
|
||||
wmbiff's with differrent configs).
|
||||
|
||||
|
||||
Pressing on a 1st (left) mouse button will execute appropriate mail
|
||||
reader (if defined in config file). Right-clicking will exec mail
|
||||
fetching program (if any).
|
||||
|
||||
|
||||
It is also possible to execute user-defined command line on new mail
|
||||
arrival (for example, play .WAV file).
|
||||
|
||||
|
||||
_________________________________________________________________
|
||||
|
||||
|
||||
Compiling and Installation
|
||||
|
||||
|
||||
Extract the archive:
|
||||
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
|
||||
position. All other positions will be empty.
|
||||
_________________________________________________________________
|
||||
|
||||
|
||||
See AUTHORS to see who has contributed to WMBiff.
|
||||
_________________________________________________________________
|
||||
|
||||
|
||||
Any suggestions/bug reports please send to our mailing list,
|
||||
|
||||
|
||||
wmbiff-devel@lists.sourceforge.net
|
||||
|
||||
Please include the output of 'wmbiff -debug'.
|
||||
|
@ -81,32 +81,32 @@ wmbiff-devel list:
|
|||
|
||||
Hello,
|
||||
I just found evidence of what I had believed for a long time.
|
||||
|
||||
|
||||
http://www.monkey.org/openbsd/archive/ports/0101/msg00311.html
|
||||
|
||||
|
||||
Gennady Belyakov passed away right after releasing 0.2 and when he
|
||||
stopped answering mail :|
|
||||
|
||||
|
||||
I guess we need to update the docs.
|
||||
|
||||
|
||||
Jordi
|
||||
|
||||
Here is the message, if that URL becomes unavailable:
|
||||
|
||||
To: ports@openbsd.org
|
||||
Subject: Re: mail/wmbiff update
|
||||
From: Vladimir Popov <pva48@mail.ru>
|
||||
Date: Sat, 27 Jan 2001 09:34:15 +0500
|
||||
|
||||
To: ports@openbsd.org
|
||||
Subject: Re: mail/wmbiff update
|
||||
From: Vladimir Popov <pva48@mail.ru>
|
||||
Date: Sat, 27 Jan 2001 09:34:15 +0500
|
||||
|
||||
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
|
||||
> page is unreachable.
|
||||
>
|
||||
|
||||
>
|
||||
|
||||
Well, wmbiff's author Gennady Belyakov passed away in late November 1999.
|
||||
That's why that url isn't any longer valid.
|
||||
|
||||
|
||||
--
|
||||
Vladimir
|
||||
|
||||
|
|
18
wmbiff/TODO
18
wmbiff/TODO
|
@ -6,7 +6,7 @@ these todo items are welcome.
|
|||
** # comments make #'s unsuitable for passwords.
|
||||
** : and @ delimiters make such characters unsuitable for
|
||||
passwords.
|
||||
** the hierarchical configuration is not exported cleanly,
|
||||
** the hierarchical configuration is not exported cleanly,
|
||||
setting a default and then propagating or overriding it
|
||||
requires an odd syntax.
|
||||
** elements with spaces are problematic
|
||||
|
@ -14,8 +14,8 @@ these todo items are welcome.
|
|||
methods) are cumbersome.
|
||||
** continuation lines would allow richer shell actions without
|
||||
external shell scripts.
|
||||
* GNUTLS 0.5.9
|
||||
** adds gnutls_set_default_priority, which could clean up
|
||||
* GNUTLS 0.5.9
|
||||
** adds gnutls_set_default_priority, which could clean up
|
||||
a lot of the code to set priorities for ciphers that
|
||||
don't really matter to wmbiff.
|
||||
* Font support
|
||||
|
@ -33,7 +33,7 @@ these todo items are welcome.
|
|||
Sometimes my IMAP server is slow... well, it's my fault
|
||||
that I keep a few thousand messages on it. The current
|
||||
timeout code will cause it to fail prematurely.
|
||||
* Generic constructors for mboxes.
|
||||
* Generic constructors for mboxes.
|
||||
There's some common code across different Clients;
|
||||
this is one piece that could use refactoring.
|
||||
* Add more shell "recipes" besides gicu.
|
||||
|
@ -52,7 +52,7 @@ these todo items are welcome.
|
|||
but extra complicated, and has a useless default install
|
||||
that requires root. xbuffy's led program seems quite
|
||||
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 (*
|
||||
STATUS) and a bad response (a003 NO STATUS). As soon as
|
||||
one of them is received, we're done.
|
||||
|
@ -71,10 +71,10 @@ these todo items are welcome.
|
|||
* Unlikely to get done, unless someone volunteers:
|
||||
* KDE/Gnome users: Test with KDE or gnome-panel
|
||||
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.
|
||||
* 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.
|
||||
* Paranoid Pop People: Support POP over TLS.
|
||||
tlsComm.c should make it easy to provide TLS support
|
||||
|
@ -86,9 +86,9 @@ these todo items are welcome.
|
|||
could be integrated.
|
||||
* Recursive maildir support
|
||||
Aggregation in general is an oft-desired feature.
|
||||
* G-Mail support
|
||||
* G-Mail support
|
||||
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.
|
||||
|
||||
$Id: TODO,v 1.21 2004/10/31 22:08:42 bluehal Exp $
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
|
||||
EXTRA_DIST =
|
||||
EXTRA_DIST =
|
||||
|
|
|
@ -46,7 +46,7 @@ dnl AC_CHECK_FUNC(asprintf, , VASPRINTF="vasprintf.c")
|
|||
dnl replacing the old USE_POLL define
|
||||
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)
|
||||
|
||||
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 between them makes this turn redundant
|
||||
|
||||
AC_ARG_ENABLE(crypto, AC_HELP_STRING([ --disable-crypto ], [ disable gnutls/gcrypt ]),
|
||||
[ if test $enableval != yes; then
|
||||
AC_ARG_ENABLE(crypto, AC_HELP_STRING([ --disable-crypto ], [ disable gnutls/gcrypt ]),
|
||||
[ if test $enableval != yes; then
|
||||
gnutls="disabled"
|
||||
gcrypt="disabled"
|
||||
fi ])
|
||||
|
||||
|
||||
|
||||
GNUTLS_MAN_STATUS="This copy of WMBiff was not compiled with GNUTLS."
|
||||
if test "$gnutls" = "ok"; then
|
||||
|
@ -96,7 +96,7 @@ if test "$gcrypt" = "ok"; then
|
|||
AC_CHECK_HEADERS(gcrypt.h) ],
|
||||
[ echo libgcrypt can be found at ftp://ftp.gnupg.org/pub/gcrypt/alpha/libgcrypt/ ] )
|
||||
else
|
||||
AC_MSG_RESULT(GCRYPT disabled.)
|
||||
AC_MSG_RESULT(GCRYPT disabled.)
|
||||
fi;
|
||||
|
||||
|
||||
|
@ -106,7 +106,7 @@ AC_SUBST(GCRYPT_MAN_STATUS)
|
|||
AC_SUBST(GNUTLS_COMMON_O)
|
||||
|
||||
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 X11 stuff.
|
||||
|
@ -136,7 +136,7 @@ dnl AC_SUBST(GNOME_LIBS)
|
|||
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.
|
||||
AC_DEFUN([WM_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
|
||||
yes)AC_DEFINE(HAVE___ATTRIBUTE__, ,
|
||||
[Define if '__attribute__' is supported by the compiler])
|
||||
[Define if '__attribute__' is supported by the compiler])
|
||||
;;
|
||||
esac
|
||||
])# WM_C_ATTRIBUTE
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#! /usr/bin/ruby
|
||||
|
||||
# Copyright 2002 Neil Spring <nspring@cs.washington.edu>
|
||||
# Copyright 2002 Neil Spring <nspring@cs.washington.edu>
|
||||
# GPL
|
||||
# report bugs to wmbiff-devel@lists.sourceforge.net
|
||||
# or (preferred) use the debian BTS via 'reportbug'
|
||||
|
@ -26,7 +26,7 @@ Refetch_Interval_Sec = 6 * 60 * 60
|
|||
Cachedir = ENV['HOME'] + '/.wmbiff-sdr'
|
||||
|
||||
# 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'
|
||||
|
||||
# extend the Array class with a max method.
|
||||
|
@ -55,7 +55,7 @@ end
|
|||
def version_a_gt_b(a, b)
|
||||
cmd = "/usr/bin/dpkg --compare-versions %s le %s" % [ a, b ]
|
||||
# $stderr.puts cmd
|
||||
return (!Kernel.system(cmd))
|
||||
return (!Kernel.system(cmd))
|
||||
end
|
||||
|
||||
# figure out which lists to check
|
||||
|
@ -67,10 +67,10 @@ end
|
|||
# file, the url, the system's cache of the file, and a
|
||||
# per-user cache of the file.
|
||||
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.
|
||||
# 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.
|
||||
packagelists.each { |urlpath, sc, uc|
|
||||
sctime = File.stat(sc).mtime
|
||||
cached_time =
|
||||
cached_time =
|
||||
if(test(?e, uc)) then
|
||||
uctime = File.stat(uc).mtime
|
||||
uctime = File.stat(uc).mtime
|
||||
if ( uctime < sctime ) then
|
||||
# we have a user cache, but it is older than the system cache
|
||||
File.unlink(uc) # delete the obsolete user cache.
|
||||
sctime
|
||||
sctime
|
||||
else
|
||||
uctime
|
||||
end
|
||||
else
|
||||
else
|
||||
# the user cache doesn't exist, but we might have
|
||||
# talked to the server recently.
|
||||
if(test(?e, uc + '.stamp')) then
|
||||
File.stat(uc + '.stamp').mtime
|
||||
File.stat(uc + '.stamp').mtime
|
||||
else
|
||||
sctime
|
||||
end
|
||||
end
|
||||
end
|
||||
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
|
||||
if(session == nil) then
|
||||
session = Net::HTTP.new(Server)
|
||||
# session.set_pipe($stderr);
|
||||
# session.set_pipe($stderr);
|
||||
end
|
||||
begin
|
||||
# the warning with ruby1.8 on the following line
|
||||
begin
|
||||
# the warning with ruby1.8 on the following line
|
||||
# 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)
|
||||
# response = http.get('/index.html')
|
||||
# puts response.body
|
||||
resp, data = session.get(urlpath,
|
||||
{ 'If-Modified-Since' =>
|
||||
resp, data = session.get(urlpath,
|
||||
{ 'If-Modified-Since' =>
|
||||
cached_time.strftime( "%a, %d %b %Y %H:%M:%S GMT" ) })
|
||||
rescue SocketError => e
|
||||
# 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.
|
||||
if(updatedcount > 0) then
|
||||
puts "%d new" % [ updatedcount ]
|
||||
puts "%d new" % [ updatedcount ]
|
||||
else
|
||||
puts "%d old" % [ installed.length ]
|
||||
puts "%d old" % [ installed.length ]
|
||||
end
|
||||
|
||||
puts updated.join("\n")
|
||||
|
|
|
@ -52,7 +52,7 @@ typedef struct _mbox_t {
|
|||
int UnreadMsgs; /* New (unread) messages in mailbox */
|
||||
int OldMsgs;
|
||||
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 */
|
||||
int blink_stat; /* blink digits flag-counter */
|
||||
int debug; /* debugging status */
|
||||
|
|
|
@ -158,7 +158,7 @@ struct connection_state *unbind(
|
|||
/*@null@*/
|
||||
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 */
|
||||
struct connection_state *scs;
|
||||
struct imap_authentication_method *a;
|
||||
|
@ -173,7 +173,7 @@ FILE *imap_open(Pop3 pc)
|
|||
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 */
|
||||
connection_name = malloc(strlen(PCU.serverName) + 20);
|
||||
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 */
|
||||
/* note that communication_failure will close the
|
||||
/* note that communication_failure will close the
|
||||
socket and free via tls_close() */
|
||||
free(scs); /* fall through will scs = initialize_gnutls(sd); */
|
||||
}
|
||||
|
@ -253,8 +253,8 @@ FILE *imap_open(Pop3 pc)
|
|||
|
||||
/* authenticate; first find out how */
|
||||
/* note that capabilities may have changed since last
|
||||
time we may have asked, if we called STARTTLS, my
|
||||
server will allow plain password login within an
|
||||
time we may have asked, if we called STARTTLS, my
|
||||
server will allow plain password login within an
|
||||
encrypted session. */
|
||||
tlscomm_printf(scs, "a000 CAPABILITY\r\n");
|
||||
if (tlscomm_expect(scs, "* CAPABILITY", capabilities, BUF_SIZE) == 0) {
|
||||
|
@ -584,7 +584,7 @@ static int authenticate_plaintext( /*@notnull@ */ Pop3 pc,
|
|||
{
|
||||
char buf[BUF_SIZE];
|
||||
/* 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.
|
||||
*/
|
||||
if (strstr(capabilities, "LOGINDISABLED")) {
|
||||
|
|
|
@ -5,16 +5,16 @@ wmbiff_SOURCES = wmbiff.c socket.c Pop3Client.c mboxClient.c \
|
|||
maildirClient.c Imap4Client.c tlsComm.c tlsComm.h ShellClient.c \
|
||||
passwordMgr.c passwordMgr.h charutil.c charutil.h Client.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_DEPENDENCIES = ../wmgeneral/libwmgeneral.a Makefile @GNUTLS_COMMON_O@
|
||||
test_wmbiff_SOURCES = ShellClient.c charutil.c charutil.h Client.h \
|
||||
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 \
|
||||
tlsComm.c tlsComm.h
|
||||
EXTRA_test_wmbiff_SOURCES = gnutls-common.c gnutls-common.h
|
||||
test_wmbiff_LDADD = @LIBGCRYPT_LIBS@
|
||||
tlsComm.c tlsComm.h
|
||||
EXTRA_test_wmbiff_SOURCES = gnutls-common.c gnutls-common.h
|
||||
test_wmbiff_LDADD = @LIBGCRYPT_LIBS@
|
||||
man_MANS = wmbiff.1 wmbiffrc.5
|
||||
skindir = $(datadir)/wmbiff/skins
|
||||
skin_DATA = wmbiff-master-led.xpm wmbiff-master-contrast.xpm \
|
||||
|
@ -54,7 +54,7 @@ distclean-local:
|
|||
wmbiff-classic-master-contrast.xpm
|
||||
|
||||
# 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
|
||||
egrep -v '^"[:%][[:space:]]c #' < wmbiff-master-led.xpm | \
|
||||
sed -e 's/:/./g' -e 's/%/$$/g' -e 's/ 15 / 13 /' | \
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
Modified : Jorge García ( Jorge.Garcia@uv.es )
|
||||
Modified ; Mark Hurley ( debian4tux@telocity.com )
|
||||
Modified : Neil Spring ( nspring@cs.washington.edu )
|
||||
*
|
||||
*
|
||||
* Pop3 Email checker.
|
||||
*
|
||||
* 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 {
|
||||
const char *name;
|
||||
/* callback returns the connection state pointer if successful,
|
||||
/* callback returns the connection state pointer if successful,
|
||||
NULL if failed */
|
||||
struct connection_state *(*auth_callback) (Pop3 pc, struct connection_state * scs, char *apop_str);
|
||||
} auth_methods[] = {
|
||||
|
@ -169,7 +169,7 @@ int pop3CheckMail( /*@notnull@ */ Pop3 pc)
|
|||
/* it is not an error to receive this according to RFC 1725 */
|
||||
/* no error should be returned */
|
||||
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 {
|
||||
sscanf(buf, "+OK %d", &read);
|
||||
pc->UnreadMsgs = pc->TotalMsgs - read;
|
||||
|
@ -201,9 +201,9 @@ int pop3Create(Pop3 pc, const char *str)
|
|||
int i;
|
||||
int matchedchars;
|
||||
/* ([^: ]+) user
|
||||
([^@]+) or ([^ ]+) password
|
||||
([^: ]+) server
|
||||
([: ][0-9]+)? optional port
|
||||
([^@]+) or ([^ ]+) password
|
||||
([^: ]+) server
|
||||
([: ][0-9]+)? optional port
|
||||
' *' gobbles trailing whitespace before authentication types.
|
||||
use separate regexes for old and new types to permit
|
||||
use of '@' in passwords
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue