Group :: Desktop gráfico/Window Maker
RPM: wmdiskmon
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: wmdiskmon-alt-src-shorter_paths.patch
Download
Download
--- wmdiskmon/TODO.orig 2007-10-26 22:37:36 +0700
+++ wmdiskmon/TODO 2007-10-26 22:38:16 +0700
@@ -1,6 +1,3 @@
* other OS support(help!)
* optimize drawing-routines (MIT-SHM)
* Non-GNU make fixes
-
---
-* show only the last part of the device/mount point ?
--- wmdiskmon/src/main.c.orig 2007-10-26 22:37:41 +0700
+++ wmdiskmon/src/main.c 2007-10-26 22:38:16 +0700
@@ -319,12 +319,30 @@ static void switch_light() {
static void draw_bargraph(Partition *p, int y) {
char text[MAXCHARS + 1];
int max, x, pos = 0;
+ const char *str;
bzero(text, MAXCHARS + 1);
- if (show_devs)
- strncpy(text, p->entry ? p->entry : "Error", MAXCHARS);
- else
- strncpy(text, p->mountp ? p->mountp : "Error", MAXCHARS);
+
+ if (show_devs) {
+ str = p->entry ? p->entry : "Error";
+
+ /* Skip "/dev/" in path to device */
+ if (strncmp(str, "/dev/", sizeof("/dev/")-1) == 0) {
+ str += sizeof("/dev/")-1;
+ }
+ } else {
+ str = p->mountp ? p->mountp : "Error";
+
+ /* Skip "/mnt/" or "/media/" in path to mount point */
+ if (strncmp(str, "/mnt/", sizeof("/mnt/")-1) == 0) {
+ str += sizeof("/mnt/")-1;
+
+ } else if (strncmp(str, "/media/", sizeof("/media/")-1) == 0) {
+ str += sizeof("/media/")-1;
+ }
+ }
+
+ strncpy(text, str, MAXCHARS);
draw_letters(text, y);
if (backlight == LIGHTON) pos = 50;