- update to i3status-2.10
tested by many, thanks!
This commit is contained in:
parent
5215172b66
commit
d9c17a6ef1
@ -1,11 +1,10 @@
|
||||
# $OpenBSD: Makefile,v 1.37 2015/09/11 14:58:49 sthen Exp $
|
||||
# $OpenBSD: Makefile,v 1.38 2016/01/04 22:31:17 jasper Exp $
|
||||
|
||||
ONLY_FOR_ARCHS= ${APM_ARCHS}
|
||||
|
||||
COMMENT= generate a statusbar for use with i3/xmobar/dzen2
|
||||
|
||||
DISTNAME= i3status-2.9
|
||||
REVISION= 3
|
||||
DISTNAME= i3status-2.10
|
||||
CATEGORIES= x11 sysutils
|
||||
|
||||
HOMEPAGE= http://i3wm.org/i3status/
|
||||
@ -18,7 +17,7 @@ PERMIT_PACKAGE_CDROM= Yes
|
||||
MASTER_SITES= ${HOMEPAGE}
|
||||
EXTRACT_SUFX= .tar.bz2
|
||||
|
||||
WANTLIB += c confuse yajl
|
||||
WANTLIB += c confuse m pthread yajl
|
||||
|
||||
USE_GMAKE= Yes
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
SHA256 (i3status-2.9.tar.bz2) = QusJUAxiX8rJpxJaKee/UyykuFQJQkGO4yU6oV5eneM=
|
||||
SIZE (i3status-2.9.tar.bz2) = 46615
|
||||
SHA256 (i3status-2.10.tar.bz2) = 2vXQdhGwVKQ9oaPSiFCwXi29vW0l/V4l7emLsbZuJ5E=
|
||||
SIZE (i3status-2.10.tar.bz2) = 53684
|
||||
|
@ -1,20 +0,0 @@
|
||||
$OpenBSD: patch-Makefile,v 1.7 2015/09/01 11:09:37 jasper Exp $
|
||||
|
||||
From 15f2279592032af1507de09ef31eba81aee53191 Mon Sep 17 00:00:00 2001
|
||||
From: "Dmitrij D. Czarkoff" <czarkoff@gmail.com>
|
||||
Date: Fri, 31 Jul 2015 01:51:40 +0200
|
||||
Subject: [PATCH] Use SndIO for volume module on OpenBSD
|
||||
|
||||
--- Makefile.orig Wed Jul 29 20:16:31 2015
|
||||
+++ Makefile Wed Jul 29 20:16:38 2015
|
||||
@@ -39,10 +39,6 @@ CFLAGS+=-I/usr/local/include/
|
||||
LDFLAGS+=-L/usr/local/lib/
|
||||
endif
|
||||
|
||||
-ifeq ($(OS),OpenBSD)
|
||||
-LIBS+=-lossaudio
|
||||
-endif
|
||||
-
|
||||
ifeq ($(OS), NetBSD)
|
||||
LIBS+= -lprop
|
||||
endif
|
@ -1,18 +0,0 @@
|
||||
$OpenBSD: patch-src_print_cpu_usage_c,v 1.7 2015/04/02 18:33:35 jasper Exp $
|
||||
|
||||
https://github.com/i3/i3status/pull/18
|
||||
|
||||
--- src/print_cpu_usage.c.orig Tue Sep 16 13:00:15 2014
|
||||
+++ src/print_cpu_usage.c Tue Sep 16 13:01:43 2014
|
||||
@@ -10,7 +10,11 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
+#if defined(__OpenBSD__)
|
||||
+#include <sys/sched.h>
|
||||
+#else
|
||||
#include <sys/dkstat.h>
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
#if defined(__DragonFly__)
|
@ -1,26 +0,0 @@
|
||||
$OpenBSD: patch-src_print_disk_info_c,v 1.4 2015/04/02 20:16:02 jasper Exp $
|
||||
|
||||
From ae50bbe2575e8e3234a70f89a7897b544cc4f3f0 Mon Sep 17 00:00:00 2001
|
||||
From: Jasper Lievisse Adriaanse <jasper@humppa.nl>
|
||||
Date: Thu, 2 Apr 2015 20:31:17 +0200
|
||||
Subject: [PATCH] sys/dkstat.h has been removed from OpenBSD and it's functionality actually lived/lives in sys/sched.h
|
||||
|
||||
--- src/print_disk_info.c.orig Mon Mar 23 11:07:26 2015
|
||||
+++ src/print_disk_info.c Mon Mar 23 11:07:33 2015
|
||||
@@ -3,7 +3,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
-#include <mntent.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/statvfs.h>
|
||||
@@ -11,6 +10,8 @@
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || (__OpenBSD__) || defined(__DragonFly__)
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
+#else
|
||||
+#include <mntent.h>
|
||||
#endif
|
||||
#include <yajl/yajl_gen.h>
|
||||
#include <yajl/yajl_version.h>
|
@ -1,98 +0,0 @@
|
||||
$OpenBSD: patch-src_print_volume_c,v 1.7 2015/09/01 11:09:37 jasper Exp $
|
||||
|
||||
From 15f2279592032af1507de09ef31eba81aee53191 Mon Sep 17 00:00:00 2001
|
||||
From: "Dmitrij D. Czarkoff" <czarkoff@gmail.com>
|
||||
Date: Fri, 31 Jul 2015 01:51:40 +0200
|
||||
Subject: [PATCH] Use SndIO for volume module on OpenBSD
|
||||
|
||||
--- src/print_volume.c.orig Wed Jul 29 15:31:44 2015
|
||||
+++ src/print_volume.c Wed Jul 29 15:31:47 2015
|
||||
@@ -20,7 +20,8 @@
|
||||
#ifdef __OpenBSD__
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
-#include <soundcard.h>
|
||||
+#include <sys/audioio.h>
|
||||
+#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#include "i3status.h"
|
||||
@@ -145,6 +146,70 @@ void print_volume(yajl_gen json_gen, char *buffer, con
|
||||
if (mixer_idx > 0)
|
||||
free(mixerpath);
|
||||
|
||||
+#if defined(__OpenBSD__)
|
||||
+ int oclass_idx = -1, master_idx = -1, master_mute_idx = -1;
|
||||
+ mixer_devinfo_t devinfo, devinfo2;
|
||||
+ mixer_ctrl_t vinfo;
|
||||
+
|
||||
+ devinfo.index = 0;
|
||||
+ while (ioctl(mixfd, AUDIO_MIXER_DEVINFO, &devinfo) >= 0) {
|
||||
+ if (devinfo.type != AUDIO_MIXER_CLASS) {
|
||||
+ devinfo.index++;
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (strncmp(devinfo.label.name, AudioCoutputs, MAX_AUDIO_DEV_LEN) == 0)
|
||||
+ oclass_idx = devinfo.index;
|
||||
+
|
||||
+ devinfo.index++;
|
||||
+ }
|
||||
+
|
||||
+ devinfo2.index = 0;
|
||||
+ while (ioctl(mixfd, AUDIO_MIXER_DEVINFO, &devinfo2) >= 0) {
|
||||
+ if ((devinfo2.type == AUDIO_MIXER_VALUE)
|
||||
+ && (devinfo2.mixer_class == oclass_idx)
|
||||
+ && (strncmp(devinfo2.label.name, AudioNmaster, MAX_AUDIO_DEV_LEN) == 0))
|
||||
+ master_idx = devinfo2.index;
|
||||
+
|
||||
+ if ((devinfo2.type == AUDIO_MIXER_ENUM)
|
||||
+ && (devinfo2.mixer_class == oclass_idx)
|
||||
+ && (strncmp(devinfo2.label.name, AudioNmute, MAX_AUDIO_DEV_LEN) == 0))
|
||||
+ master_mute_idx = devinfo2.index;
|
||||
+
|
||||
+ devinfo2.index++;
|
||||
+ }
|
||||
+
|
||||
+ if (master_idx == -1)
|
||||
+ goto out;
|
||||
+
|
||||
+ devinfo.index = master_idx;
|
||||
+ if (ioctl(mixfd, AUDIO_MIXER_DEVINFO, &devinfo) == -1)
|
||||
+ goto out;
|
||||
+
|
||||
+ vinfo.dev = master_idx;
|
||||
+ vinfo.type = AUDIO_MIXER_VALUE;
|
||||
+ if (ioctl(mixfd, AUDIO_MIXER_READ, &vinfo) == -1)
|
||||
+ goto out;
|
||||
+
|
||||
+ if (AUDIO_MAX_GAIN != 100) {
|
||||
+ float avgf = ((float)vinfo.un.value.level[AUDIO_MIXER_LEVEL_MONO] / AUDIO_MAX_GAIN) * 100;
|
||||
+ vol = (int)avgf;
|
||||
+ vol = (avgf - vol < 0.5 ? vol : (vol + 1));
|
||||
+ } else {
|
||||
+ vol = (int)vinfo.un.value.level[AUDIO_MIXER_LEVEL_MONO];
|
||||
+ }
|
||||
+
|
||||
+ vinfo.dev = master_mute_idx;
|
||||
+ vinfo.type = AUDIO_MIXER_ENUM;
|
||||
+ if (ioctl(mixfd, AUDIO_MIXER_READ, &vinfo) == -1)
|
||||
+ goto out;
|
||||
+
|
||||
+ if (master_mute_idx != -1 && vinfo.un.ord) {
|
||||
+ START_COLOR("color_degraded");
|
||||
+ fmt = fmt_muted;
|
||||
+ pbval = 0;
|
||||
+ }
|
||||
+
|
||||
+#else
|
||||
if (ioctl(mixfd, SOUND_MIXER_READ_DEVMASK, &devmask) == -1)
|
||||
return;
|
||||
if (ioctl(mixfd, MIXER_READ(0), &vol) == -1)
|
||||
@@ -154,6 +219,7 @@ void print_volume(yajl_gen json_gen, char *buffer, con
|
||||
START_COLOR("color_degraded");
|
||||
pbval = 0;
|
||||
}
|
||||
+#endif
|
||||
|
||||
const char *walk = fmt;
|
||||
for (; *walk != '\0'; walk++) {
|
@ -1,22 +1,11 @@
|
||||
$OpenBSD: patch-src_print_wireless_info_c,v 1.8 2015/04/04 16:07:16 jasper Exp $
|
||||
$OpenBSD: patch-src_print_wireless_info_c,v 1.9 2016/01/04 22:31:17 jasper Exp $
|
||||
--- src/print_wireless_info.c.orig Sun Jan 3 12:55:52 2016
|
||||
+++ src/print_wireless_info.c Sun Jan 3 12:58:06 2016
|
||||
@@ -50,6 +50,7 @@
|
||||
#include <netinet/if_ether.h>
|
||||
#include <net80211/ieee80211.h>
|
||||
#include <net80211/ieee80211_ioctl.h>
|
||||
+#define IW_ESSID_MAX_SIZE IEEE80211_NWID_LEN
|
||||
#endif
|
||||
|
||||
From e91891729e799e45561c707768269bb755ca34e9 Mon Sep 17 00:00:00 2001
|
||||
From: Jasper Lievisse Adriaanse <jasper@humppa.nl>
|
||||
Date: Sat, 4 Apr 2015 10:56:58 +0200
|
||||
Subject: [PATCH] Use the maximum rssi, not the scaled percentage for the signal level.
|
||||
|
||||
--- src/print_wireless_info.c.orig Sat Apr 4 10:51:30 2015
|
||||
+++ src/print_wireless_info.c Sat Apr 4 10:52:18 2015
|
||||
@@ -308,10 +308,9 @@ static int get_wireless_info(const char *interface, wi
|
||||
strlcpy(nr.nr_ifname, interface, sizeof(nr.nr_ifname));
|
||||
|
||||
if (ioctl(s, SIOCG80211NODE, &nr) == 0 && nr.nr_rssi) {
|
||||
+ info->signal_level = nr.nr_rssi;
|
||||
if (nr.nr_max_rssi)
|
||||
- info->signal_level_max = IEEE80211_NODEREQ_RSSI(&nr);
|
||||
- else
|
||||
- info->signal_level = nr.nr_rssi;
|
||||
+ info->signal_level_max = nr.nr_max_rssi;
|
||||
|
||||
info->flags |= WIRELESS_INFO_FLAG_HAS_SIGNAL;
|
||||
}
|
||||
#include "i3status.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user