Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Mar 2013 18:38:14 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r314674 - in head/x11/i3status: . files
Message-ID:  <201303191838.r2JIcE2i095168@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Tue Mar 19 18:38:14 2013
New Revision: 314674
URL: http://svnweb.freebsd.org/changeset/ports/314674

Log:
  - update to 2.7
  Make patch for colours in volume output actually works.
  Add a patch for colours on low remaining battery
  Add a patch for colours on high CPU temperature

Added:
  head/x11/i3status/files/patch-src__print_battery_info.c   (contents, props changed)
  head/x11/i3status/files/patch-src__print_cpu_temperature.c   (contents, props changed)
Modified:
  head/x11/i3status/Makefile   (contents, props changed)
  head/x11/i3status/distinfo   (contents, props changed)
  head/x11/i3status/files/patch-src__print_volume.c

Modified: head/x11/i3status/Makefile
==============================================================================
--- head/x11/i3status/Makefile	Tue Mar 19 18:37:30 2013	(r314673)
+++ head/x11/i3status/Makefile	Tue Mar 19 18:38:14 2013	(r314674)
@@ -1,7 +1,7 @@
 # $FreeBSD$
 
 PORTNAME=	i3status
-PORTVERSION=	2.6
+PORTVERSION=	2.7
 CATEGORIES=	x11
 MASTER_SITES=	http://i3wm.org/i3status/
 

Modified: head/x11/i3status/distinfo
==============================================================================
--- head/x11/i3status/distinfo	Tue Mar 19 18:37:30 2013	(r314673)
+++ head/x11/i3status/distinfo	Tue Mar 19 18:38:14 2013	(r314674)
@@ -1,2 +1,2 @@
-SHA256 (i3status-2.6.tar.bz2) = e7e710cc271887bcd22757269e1b00a5618fb53abdb3455140116b3d38797bce
-SIZE (i3status-2.6.tar.bz2) = 34896
+SHA256 (i3status-2.7.tar.bz2) = 073f4e5de3bc5afc1f23c52ea52e2aa4b90ca8a012f28ba2c5fac3c33474a632
+SIZE (i3status-2.7.tar.bz2) = 37594

Added: head/x11/i3status/files/patch-src__print_battery_info.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11/i3status/files/patch-src__print_battery_info.c	Tue Mar 19 18:38:14 2013	(r314674)
@@ -0,0 +1,18 @@
+--- ./src/print_battery_info.c.orig	2013-03-19 21:06:48.190385644 +0100
++++ ./src/print_battery_info.c	2013-03-19 21:06:52.551387042 +0100
+@@ -234,6 +234,15 @@
+                 minutes -= (hours * 60);
+                 (void)snprintf(remainingbuf, sizeof(remainingbuf), "%02dh%02d",
+                                max(hours, 0), max(minutes, 0));
++		if (strncmp(threshold_type, "percentage", strlen(threshold_type)) == 0
++		    && present_rate < low_threshold) {
++			START_COLOR("color_bad");
++			colorful_output = true;
++		} else if (strncmp(threshold_type, "time", strlen(threshold_type)) == 0
++			   && remaining < (u_int) low_threshold) {
++			START_COLOR("color_bad");
++			colorful_output = true;
++		}
+         }
+ #elif defined(__OpenBSD__)
+ 	/*

Added: head/x11/i3status/files/patch-src__print_cpu_temperature.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11/i3status/files/patch-src__print_cpu_temperature.c	Tue Mar 19 18:38:14 2013	(r314674)
@@ -0,0 +1,27 @@
+--- ./src/print_cpu_temperature.c.orig	2013-03-19 21:07:05.089386424 +0100
++++ ./src/print_cpu_temperature.c	2013-03-19 21:07:14.249384762 +0100
+@@ -14,6 +14,7 @@
+ #include <sys/sysctl.h>
+ #define TZ_ZEROC 2732
+ #define TZ_KELVTOC(x) (((x) - TZ_ZEROC) / 10), abs(((x) - TZ_ZEROC) % 10)
++#define TZ_AVG(x) ((x) - TZ_ZEROC) / 10
+ #endif
+ 
+ #if defined(__OpenBSD__)
+@@ -80,7 +81,16 @@
+                         if (sysctlbyname(path, &sysctl_rslt, &sysctl_size, NULL, 0))
+                                 goto error;
+ 
++                        if (TZ_AVG(sysctl_rslt) >= max_threshold) {
++                                START_COLOR("color_bad");
++                                colorful_output = true;
++                        }
+                         outwalk += sprintf(outwalk, "%d.%d", TZ_KELVTOC(sysctl_rslt));
++                        if (colorful_output) {
++                                END_COLOR;
++                                colorful_output = false;
++                        }
++
+ #elif defined(__OpenBSD__)
+         struct sensordev sensordev;
+         struct sensor sensor;

Modified: head/x11/i3status/files/patch-src__print_volume.c
==============================================================================
--- head/x11/i3status/files/patch-src__print_volume.c	Tue Mar 19 18:37:30 2013	(r314673)
+++ head/x11/i3status/files/patch-src__print_volume.c	Tue Mar 19 18:38:14 2013	(r314674)
@@ -1,25 +1,35 @@
---- ./src/print_volume.c.orig	2012-10-03 13:44:44.000000000 +0200
-+++ ./src/print_volume.c	2012-12-29 01:14:29.384748264 +0100
-@@ -175,8 +175,9 @@
+--- ./src/print_volume.c.orig	2013-03-19 21:06:34.895386349 +0100
++++ ./src/print_volume.c	2013-03-19 21:06:39.429385083 +0100
+@@ -175,16 +175,32 @@
  	}
  #endif
- #if defined(__FreeBSD__) || defined(__OpenBSD__)
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
 -        char mixerpath[] = "/dev/mixer";
-+	char mixerpath[] = "/dev/mixer";
++        char *mixerpath;
++        char defaultmixer[] = "/dev/mixer";
          int mixfd, vol, devmask = 0;
-+	int pbval = 1;
++        pbval = 1;
++
++        if (mixer_idx >= 0)
++                asprintf(&mixerpath, "/dev/mixer%d", mixer_idx);
++        else
++                mixerpath = defaultmixer;
  
          if ((mixfd = open(mixerpath, O_RDWR)) < 0)
                  return;
-@@ -185,6 +186,12 @@
++
++        if (mixer_idx >= 0)
++                free(mixerpath);
++
+         if (ioctl(mixfd, SOUND_MIXER_READ_DEVMASK, &devmask) == -1)
+                 return;
          if (ioctl(mixfd, MIXER_READ(0),&vol) == -1)
                  return;
  
-+	if ((vol & 0x7f) == 0 && (vol >> 8) & 0x7f == 0)
-+		pbval = 0;
-+
-+	if (!pbval)
-+		START_COLOR("color_bad");
++        if (((vol & 0x7f) == 0) && (((vol >> 8) & 0x7f) == 0)) {
++                START_COLOR("color_degraded"); 
++                pbval = 0;
++        }
 +
          const char *walk = fmt;
          for (; *walk != '\0'; walk++) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303191838.r2JIcE2i095168>