From owner-svn-ports-head@FreeBSD.ORG Tue Mar 19 18:38:15 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BC29682B; Tue, 19 Mar 2013 18:38:15 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 96782D36; Tue, 19 Mar 2013 18:38:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2JIcFtA095180; Tue, 19 Mar 2013 18:38:15 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2JIcE2i095168; Tue, 19 Mar 2013 18:38:14 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201303191838.r2JIcE2i095168@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 19 Mar 2013 18:38:14 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r314674 - in head/x11/i3status: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Mar 2013 18:38:15 -0000 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 + #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++) {