Undelete sysutils/wmbsdbatt providing live distfile sources.

Requested by:	Nick Kostirya
This commit is contained in:
Eugene Grosbein 2021-01-01 05:47:59 +00:00
parent 206e918dc6
commit a19860a7aa
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=559806
9 changed files with 333 additions and 1 deletions

1
MOVED
View File

@ -14847,7 +14847,6 @@ sysutils/tmate-slave||2020-05-05|Has expired: Broken for more than 6 months
sysutils/tss||2020-05-05|Has expired: Broken for more than 6 months
sysutils/vstrip||2020-05-05|Has expired: Broken for more than 6 months
sysutils/watchdog||2020-05-05|Has expired: Broken for more than 6 months
sysutils/wmbsdbatt||2020-05-05|Has expired: Broken for more than 6 months
sysutils/wmcpuload||2020-05-05|Has expired: Broken for more than 6 months
sysutils/wtail||2020-05-05|Has expired: Broken for more than 6 months
textproc/csv2latex||2020-05-05|Has expired: Broken for more than 6 months

View File

@ -1477,6 +1477,7 @@
SUBDIR += wimlib
SUBDIR += wmapmload
SUBDIR += wmbluecpu
SUBDIR += wmbsdbatt
SUBDIR += wmcube
SUBDIR += wmdiskmon
SUBDIR += wmflame

View File

@ -0,0 +1,24 @@
# Created by: Josef El-Rayes <josef@FreeBSD.org>
# $FreeBSD$
PORTNAME= wmbsdbatt
PORTVERSION= 0.1
PORTREVISION= 5
CATEGORIES= sysutils windowmaker
MASTER_SITES= http://mirror.its.dal.ca/freebsd/distfiles/ \
https://discovery.midnightbsd.org/mports/distfiles/
MAINTAINER= xride@FreeBSD.org
COMMENT= Dockapp for battery & temperature monitoring through ACPI
LICENSE= GPLv2
USES= xorg
USE_XORG= x11 xpm
PLIST_FILES= bin/wmbsdbatt
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/wmbsdbatt ${STAGEDIR}${PREFIX}/bin
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (wmbsdbatt-0.1.tar.gz) = 943db0f2b72bd4fca3e1a63cec9c90fa18bf49c86ef178a80b1e61e5cb50f983
SIZE (wmbsdbatt-0.1.tar.gz) = 16247

View File

@ -0,0 +1,29 @@
--- Makefile.orig 2003-12-23 12:27:34.000000000 -0600
+++ Makefile 2014-06-23 19:12:15.000000000 -0500
@@ -1,22 +1,19 @@
# Makefile for wmbsdbatt
#
# $Id: Makefile,v 1.1 2003/12/23 18:27:34 le Exp $
-CC = gcc
+#CC = gcc
PROGRAM = wmbsdbatt
OBJS = wmbsdbatt.o dockapp.o
HEADER = dockapp.h
-CFLAGS += -Wall -I/usr/local/include -I/usr/X11R6/include
-LDFLAGS += -L/usr/local/lib -L/usr/X11R6/lib -lX11 -lXext -lXpm
+CFLAGS += -Wall -I$(LOCALBASE)/include
+LDFLAGS += -L$(LOCALBASE)/lib -lX11 -lXext -lXpm
all: ${PROGRAM}
${PROGRAM}: ${OBJS}
- gcc ${CFLAGS} ${LDFLAGS} -o ${PROGRAM} ${OBJS}
+ ${CC} ${CFLAGS} ${LDFLAGS} -o ${PROGRAM} ${OBJS}
${OBJS}: ${HEADER}
-install:
- install -c -o 0 -g 0 -s ${PROGRAM} /usr/X11R6/bin
-
clean:
rm -f *.o *.core ${PROGRAM}

View File

@ -0,0 +1,58 @@
--- wmbsdbatt.c.orig Sat Jul 2 15:23:41 2005
+++ wmbsdbatt.c Sat Jul 2 15:35:19 2005
@@ -33,6 +33,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -112,14 +113,26 @@
void draw_all(void);
int init_stats(void);
int acpi_exists(void);
+void usage(void);
#if 0
void draw_rate(void);
#endif
+void
+usage(void)
+{
+ fprintf(stderr, "%s\n%s\n%s\n",
+ "usage: wmbsdbatt [-h | -b]",
+ " -h help",
+ " -b start with backlight on");
+
+ exit(0);
+}
+
int
main(int argc, char **argv)
{
- int charging, ncolor, show;
+ int charging, ncolor, show, ch;
long timeout;
long animation_timeout, update_timeout;
struct sigaction sa;
@@ -132,6 +145,19 @@
sa.sa_handler = SIG_IGN;
sa.sa_flags = SA_NOCLDWAIT;
+ while ((ch = getopt(argc, argv, "bh")) != -1) {
+ switch (ch) {
+ case 'b':
+ backlight = LIGHTON;
+ break;
+ case 'h':
+ usage();
+ break;
+ default:
+ usage();
+ break;
+ }
+ }
sigemptyset(&sa.sa_mask);
sigaction(SIGCHLD, &sa, NULL);

View File

@ -0,0 +1,179 @@
--- backlight_off.xpm Tue Dec 23 19:27:34 2003
+++ backlight_off.xpm Wed Jan 11 17:40:26 2006
@@ -56,15 +56,15 @@
"+@#%&&&%%%&&&&&&&%%%%%%%%&&&%%%%%%%%&&%&&&&%%&&%%&%%%&%&+$",
"+@#%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%%%%%%%%%%%%%%%%%&+$",
"+@#%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&+$",
-"+@#%&&%%%&&&%%%&&&%%%&&&%%%&&&%%%&&&&%&%&&&%&%&&&%%%&&&&+$",
-"+@#%&%&&&%&%&&&%&%&&&%&%&&&%&%&&&%&&%&%&%&%&%&%&%&&&%&&&+$",
-"+@#%&%&&&%&%&&&%&%&&&%&%&&&%&%&&&%&&%&%&%&%&%&%&%&&&%&&&+$",
-"+@#%&%&&&%&%&&&%&%&&&%&%&&&%&%&&&%&&%&%&%&%&%&%&%&&&%&&&+$",
-"+@#%&&%%%&&&%%%&&&%%%&&&%%%&&&%%%&&&&%&%&&&%&%&&&%%%&&&&+$",
-"+@#%&%&&&%&%&&&%&%&&&%&%&&&%&%&&&%&&%&%&%&%&%&%&%&&&%&&&+$",
-"+@#%&%&&&%&%&&&%&%&&&%&%&&&%&%&&&%&&%&%&%&%&%&%&%&&&%&&&+$",
-"+@#%&%&&&%&%&&&%&%&&&%&%&&&%&%&&&%&&%&%&%&%&%&%&%&&&%&&&+$",
-"+@#%&&%%%&&&%%%&&&%%%&&&%%%&&&%%%&&&&%&%&&&%&%&&&%%%&&&&+$",
+"+@#%&%%%&&&%%%&&&%%%&&&%%%&&&&&&&%%%&&&%%%&&&%%%&&&%%%&&+$",
+"+@#%%&&&%&%&&&%&%&&&%&%&&&%&&&&&%&&&%&%&&&%&%&&&%&%&&&%&+$",
+"+@#%%&&&%&%&&&%&%&&&%&%&&&%&&&&&%&&&%&%&&&%&%&&&%&%&&&%&+$",
+"+@#%%&&&%&%&&&%&%&&&%&%&&&%&&&&&%&&&%&%&&&%&%&&&%&%&&&%&+$",
+"+@#%&%%%&&&%%%&&&%%%&&&%%%&&&&&&&%%%&&&%%%&&&%%%&&&%%%&&+$",
+"+@#%%&&&%&%&&&%&%&&&%&%&&&%&&&&&%&&&%&%&&&%&%&&&%&%&&&%&+$",
+"+@#%%&&&%&%&&&%&%&&&%&%&&&%&&&&&%&&&%&%&&&%&%&&&%&%&&&%&+$",
+"+@#%%&&&%&%&&&%&%&&&%&%&&&%&&&&&%&&&%&%&&&%&%&&&%&%&&&%&+$",
+"+@#%&%%%&&&%%%&&&%%%&&&%%%&&&&&&&%%%&&&%%%&&&%%%&&&%%%&&+$",
"+@#%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&++$",
".+++++++++++++++++++++++++++++++++++++++++++++++++++++++$.",
"..$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$.."};
--- backlight_on.xpm Tue Dec 16 00:59:51 2003
+++ backlight_on.xpm Wed Jan 11 17:49:48 2006
@@ -39,7 +39,7 @@
".++++...............................++$$$+$$$+$$$+.+++.++@",
".++++.$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$.+$$$+$$$+$$$++$+.+$+@",
".++++.$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$.+$$$+$$$+$$$+++.+$++@",
-".++++$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$.+$$$+$$$+$$$++.+$+++@",
+".++++.$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$.+$$$+$$$+$$$++.+$+++@",
".++++...............................++$$$+$$$+$$$+.+$+.++@",
".++++++++++++++++++++++++++++++++++++++++++++++++++$+++$+@",
".++++...............................++$$$+$$$+$$$+.+++.++@",
@@ -56,15 +56,15 @@
".++++++$$$+++++++$$$$$$$$+++$$$$$$$$++$++++$$++$$+$$$+$++@",
".+++++++++++++++++++++++++++++++++++++$$$$$$$$$$$$$$$$$++@",
".++++++++++++++++++++++++++++++++++++++++++++++++++++++++@",
-".+++++$$$+++$$$+++$$$+++$$$+++$$$++++$+$+++$+$+++$$$+++++@",
-".++++$+++$+$+++$+$+++$+$+++$+$+++$++$+$+$+$+$+$+$+++$++++@",
-".++++$+++$+$+++$+$+++$+$+++$+$+++$++$+$+$+$+$+$+$+++$++++@",
-".++++$+++$+$+++$+$+++$+$+++$+$+++$++$+$+$+$+$+$+$+++$++++@",
-".+++++$$$+++$$$+++$$$+++$$$+++$$$++++$+$+++$+$+++$$$+++++@",
-".++++$+++$+$+++$+$+++$+$+++$+$+++$++$+$+$+$+$+$+$+++$++++@",
-".++++$+++$+$+++$+$+++$+$+++$+$+++$++$+$+$+$+$+$+$+++$++++@",
-".++++$+++$+$+++$+$+++$+$+++$+$+++$++$+$+$+$+$+$+$+++$++++@",
-".+++++$$$+++$$$+++$$$+++$$$+++$$$++++$+$+++$+$+++$$$+++++@",
+".++++$$$+++$$$+++$$$+++$$$+++++++$$$+++$$$+++$$$+++$$$+++@",
+".+++$+++$+$+++$+$+++$+$+++$+++++$+++$+$+++$+$+++$+$+++$++@",
+".+++$+++$+$+++$+$+++$+$+++$+++++$+++$+$+++$+$+++$+$+++$++@",
+".+++$+++$+$+++$+$+++$+$+++$+++++$+++$+$+++$+$+++$+$+++$++@",
+".++++$$$+++$$$+++$$$+++$$$+++++++$$$+++$$$+++$$$+++$$$+++@",
+".+++$+++$+$+++$+$+++$+$+++$+++++$+++$+$+++$+$+++$+$+++$++@",
+".+++$+++$+$+++$+$+++$+$+++$+++++$+++$+$+++$+$+++$+$+++$++@",
+".+++$+++$+$+++$+$+++$+$+++$+++++$+++$+$+++$+$+++$+$+++$++@",
+".++++$$$+++$$$+++$$$+++$$$+++++++$$$+++$$$+++$$$+++$$$+++@",
".++++++++++++++++++++++++++++++++++++++++++++++++++++++++@",
" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ",
" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ "};
--- parts.xpm Tue Dec 16 00:59:51 2003
+++ parts.xpm Wed Jan 11 17:45:26 2006
@@ -61,13 +61,13 @@
"+...+@...++...@@...+@...+@...++...+@...++...+@...++###+$###++###$$###+$###+$###++###+$###++###+$###++###",
".+++..@@@..+++..+++..@@@..+++..+++..@@@..+++..+++.#+++##$$$##+++##+++##$$$##+++##+++##$$$##+++##+++##+++",
".@@@..@@@..+++..+++..@@@.&+++..+++..+++..+++..+++.#$$$##$$$##+++##+++##$$$##+++##+++##+++##+++##+++##+++",
-"@.@.@+.+.++.@.++.@.@+...++...@+...@@...++...++...+$#$#$+#+#++#$#++#$#$+###++###$+###$$###++###++###++###",
-"@.@.@+.+.++.@.++.@.@+...++...@+...@@...++...++...+$#$#$+#+#++#$#++#$#$+###++###$+###$$###++###++###++###",
-"@.@.@+.+.++.@.++.@.@+...++...@+...@@...++...++...+$#$#$+#+#++#$#++#$#$+###++###$+###$$###++###++###++###",
-".+.+..@.@..+.+..@.@..+++&&+++..+++..@@@..+++..+++.#+#+##$#$##+#+##$#$##+++&&+++##+++##$$$&#+++##+++&&$$$",
-"+.+.++.+.+@.@.@+.@.@@...+@...++...+@...++...+@...++#+#++#+#+$#$#$+#$#$$###+$###++###+$###++###+$###++###",
-"+.+.++.+.+@.@.@+.@.@@...+@...++...+@...++...+@...++#+#++#+#+$#$#$+#$#$$###+$###++###+$###++###+$###++###",
-"+.+.++.+.+@.@.@+.@.@@...+@...++...+@...++...+@...++#+#++#+#+$#$#$+#$#$$###+$###++###+$###++###+$###++###",
+"@.@.@+.+.++...++...@+...++...@+...@@...++...++...+$#$#$+#+#++###++###$+###++###$+###$$###++###++###++###",
+"@.@.@+.+.++...++...@+...++...@+...@@...++...++...+$#$#$+#+#++###++###$+###++###$+###$$###++###++###++###",
+"@.@.@+.+.++...++...@+...++...@+...@@...++...++...+$#$#$+#+#++###++###$+###++###$+###$$###++###++###++###",
+".+.+..@.@..+++..@.@..+++&&+++..+++..@@@..+++..+++.#+#+##$#$##+++##$#$##+++&&+++##+++##$$$&#+++##+++&&$$$",
+"+.+.++.+.+@...@+...@@...+@...++...+@...++...+@...++#+#++#+#+$###$+###$$###+$###++###+$###++###+$###++###",
+"+.+.++.+.+@...@+...@@...+@...++...+@...++...+@...++#+#++#+#+$###$+###$$###+$###++###+$###++###+$###++###",
+"+.+.++.+.+@...@+...@@...+@...++...+@...++...+@...++#+#++#+#+$###$+###$$###+$###++###+$###++###+$###++###",
".@@@..+++..@@@..+++..@@@&&+++..+++..@@@&.+++..+++##$$$##+++##$$$##+++##$$$&&+++##+++##$$$&#+++##+++##+++",
"+++++++++++++++++++++++++++++++....+++....+++++++++++++++++..##+++####+++++++++++++++++#################",
"++++++++++++++++++++++++++++++++.+++..+..++.+++++..++.+++.+..+++##+##++#+++++##++#+++#+#################",
--- wmbsdbatt.c Tue Dec 23 19:27:34 2003
+++ wmbsdbatt.c Wed Jan 11 18:00:47 2006
@@ -67,6 +67,7 @@
int battery_time;
int temperature;
int low;
+ int freq;
#if 0
int capacity;
int rate;
@@ -79,6 +80,7 @@
static char *sysctl_battery_time = "hw.acpi.battery.time";
static char *sysctl_temperature = "hw.acpi.thermal.tz0.temperature";
static char *sysctl_acline = "hw.acpi.acline";
+static char *sysctl_frequency = "dev.cpu.0.freq";
typedef enum { LIGHTOFF, LIGHTON } light;
@@ -106,6 +108,7 @@
void draw_batt(void);
void draw_low(void);
void draw_temp(void);
+void draw_freq(void);
void draw_statusdigit(void);
void draw_pcgraph(void);
void blink_batt(void);
@@ -238,7 +241,6 @@
}
if (show) {
/* show */
- draw_all();
if (charging) {
blink_pos--;
}
@@ -284,6 +286,10 @@
addr -= 273;
acpi_info.temperature = addr;
+ if (sysctlbyname(sysctl_frequency, &addr, &len, NULL, 0) == -1)
+ err(1, "sysctlbyname(\"%s\")", sysctl_frequency);
+ acpi_info.freq = addr;
+
if (sysctlbyname(sysctl_acline, &addr, &len, NULL, 0) == -1)
err(1, "sysctlbyname(\"%s\")", sysctl_acline);
acpi_info.acline = addr;
@@ -372,6 +378,7 @@
draw_temp();
#endif
draw_temp();
+ draw_freq();
if (acpi_info.battery_status == CHARGING)
blink_batt();
@@ -471,13 +478,35 @@
temp = 0;
dockapp_copyarea(parts, pixmap, (temp / 10) * 5 + light_offset, 40, 5,
- 9, 23, 46);
+ 9, 32, 46);
dockapp_copyarea(parts, pixmap, (temp % 10) * 5 + light_offset, 40, 5,
- 9, 29, 46);
+ 9, 38, 46);
/* '°C'. */
- dockapp_copyarea(parts, pixmap, 10 + light_offset, 49, 5, 9, 36, 46);
- dockapp_copyarea(parts, pixmap, 15 + light_offset, 49, 5, 9, 42, 46);
+ dockapp_copyarea(parts, pixmap, 10 + light_offset, 49, 5, 9, 44, 46);
+ dockapp_copyarea(parts, pixmap, 15 + light_offset, 49, 5, 9, 50, 46);
+
+}
+
+void
+draw_freq(void)
+{
+ int light_offset=0;
+ int freq = acpi_info.freq;
+
+ if (backlight == LIGHTON)
+ light_offset = 50;
+
+ if (freq < 0)
+ freq = 0;
+ else if (freq > 9999)
+ freq = 9999;
+ if (freq >= 1000)
+ dockapp_copyarea(parts, pixmap, ((freq / 1000) % 10) * 5 + light_offset, 40, 5, 9, 4, 46);
+ if (freq >= 100)
+ dockapp_copyarea(parts, pixmap, ((freq / 100) % 10) * 5 + light_offset, 40, 5, 9, 10, 46);
+ dockapp_copyarea(parts, pixmap, ((freq / 10) % 10) * 5 + light_offset, 40, 5, 9, 16, 46);
+ dockapp_copyarea(parts, pixmap, (freq % 10) * 5 + light_offset, 40, 5, 9, 22, 46);
}

View File

@ -0,0 +1,32 @@
--- wmbsdbatt.c.orig 2011-09-24 19:20:00.000000000 +0200
+++ wmbsdbatt.c 2011-09-24 19:20:23.000000000 +0200
@@ -79,7 +79,9 @@
static char *sysctl_battery_state = "hw.acpi.battery.state";
static char *sysctl_battery_life = "hw.acpi.battery.life";
static char *sysctl_battery_time = "hw.acpi.battery.time";
-static char *sysctl_temperature = "hw.acpi.thermal.tz0.temperature";
+static char *sysctl_temperature;
+static char *sysctl_temperature_acpi = "hw.acpi.thermal.tz0.temperature";
+static char *sysctl_temperature_cpu0 = "dev.cpu.0.temperature";
static char *sysctl_acline = "hw.acpi.acline";
static char *sysctl_frequency = "dev.cpu.0.freq";
@@ -148,11 +150,17 @@
sa.sa_handler = SIG_IGN;
sa.sa_flags = SA_NOCLDWAIT;
- while ((ch = getopt(argc, argv, "bh")) != -1) {
+
+ sysctl_temperature = sysctl_temperature_acpi;
+
+ while ((ch = getopt(argc, argv, "bch")) != -1) {
switch (ch) {
case 'b':
backlight = LIGHTON;
break;
+ case 'c':
+ sysctl_temperature = sysctl_temperature_cpu0;
+ break;
case 'h':
usage();
break;

View File

@ -0,0 +1,8 @@
wmbsdbatt is a WindowMaker dockapp to monitor battery
usage and temperature through ACPI on FreeBSD.
It is a rip-off of Florian Krohs' wmbatteries dockapp.
wmbsdbatt was developed and runs on FreeBSD,
and it is licensed under the terms of the GPL.
WWW: http://mailbox.univie.ac.at/~le/wmbsdbatt/