New Posts  All Forums:Forum Nav:

Show Your Linux - Page 379  

Poll Results: Which Linux Desktop do you use?

This is a multiple choice poll
  • 12% of voters (103)
    Gnome 2 / Mate
  • 10% of voters (85)
    Gnome-Shell
  • 13% of voters (117)
    Unity
  • 18% of voters (158)
    Cinnamon
  • 17% of voters (148)
    KDE
  • 15% of voters (134)
    XFCE
  • 4% of voters (39)
    LXDE
  • 1% of voters (15)
    Enlightenment / E17
  • 6% of voters (55)
    OpenBox / FluxBox
  • 3% of voters (30)
    Awesome / DWM
  • 9% of voters (81)
    Other
845 Total Votes  
post #3781 of 7733
Quote:
Originally Posted by Rookie1337 View Post

Quote:
Originally Posted by Miki View Post

o_O

I'm a linux n00b, deal with it. X3

What icon set are you using?
Quote:
Originally Posted by Shrak View Post


Those are Faenza icons.

The folder icons that are shown are Faenza. My app icons are actually Nitrux-umd. The "places" icons are from neither of those packages (some type of OS X package I found)...

The "action" icons are from Faience.

Trash icon is stock.

edited to add more info
Edited by Miki - 10/1/12 at 8:05pm
post #3782 of 7733
Quote:
Originally Posted by Miki View Post

The folder icons that are shown are Faenza. My app icons are actually Nitrux-umd. The "places" icons are from neither of those packages (some type of OS X package I found)...
The "action" icons are from Faience.
Trash icon is stock.
edited to add more info

Did you add a repo to get them or something?
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
post #3783 of 7733
Quote:
Originally Posted by Rookie1337 View Post

Did you add a repo to get them or something?

http://browse.deviantart.com/customization/icons/os/nix/?order=9

Download, untar, place in ~/.themes/ or /usr/share/themes/
post #3784 of 7733
^ That's right. I just searched around and found what I thought looked cool. ^_^
post #3785 of 7733


Jus' ol' Xmonad with a conky script reading schedule text file))
post #3786 of 7733
hey a shrak? I've run into a problem I can't figure out.

found a patch on the arch forum

downloaded the code Warning: Spoiler! (Click to show)
Code:
diff -u a/dwm.c b/dwm.c
--- a/dwm.c 2011-12-27 09:47:17.000000000 +1300
+++ b/dwm-6.0/dwm.c 2011-12-27 09:46:52.000000000 +1300
@@ -49,6 +49,7 @@
 #define LENGTH(X) (sizeof X / sizeof X[0])
 #define MAX(A, B) ((A) > (B) ? (A) : (B))
 #define MIN(A, B) ((A) < (B) ? (A) : (B))
+#define MAXCOLORS 9
 #define MOUSEMASK (BUTTONMASK|PointerMotionMask)
 #define WIDTH(X) ((X)->w + 2 * (X)->bw)
 #define HEIGHT(X) ((X)->h + 2 * (X)->bw)
@@ -99,8 +100,7 @@
 
 typedef struct {
  int x, y, w, h;
- unsigned long norm[ColLast];
- unsigned long sel[ColLast];
+ unsigned long colors[MAXCOLORS][ColLast];
  Drawable drawable;
  GC gc;
  struct {
@@ -178,8 +178,9 @@
 static Monitor *dirtomon(int dir);
 static void drawbar(Monitor *m);
 static void drawbars(void);
-static void drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]);
-static void drawtext(const char *text, unsigned long col[ColLast], Bool invert);
+static void drawcoloredtext(char *text);
+static void drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]);
+static void drawtext(const char *text, unsigned long col[ColLast], Bool pad);
 static void enternotify(XEvent *e);
 static void expose(XEvent *e);
 static void focus(Client *c);
@@ -730,36 +731,37 @@
  dc.x = 0;
  for(i = 0; i < LENGTH(tags); i++) {
  dc.w = TEXTW(tags[i]);
- col = m->tagset[m->seltags] & 1 << i ? dc.sel : dc.norm;
- drawtext(tags[i], col, urg & 1 << i);
+ col = dc.colors[ (m->tagset[m->seltags] & 1 << i) ?
+ 1 : (urg & 1 << i ? 2:0) ];
+ drawtext(tags[i], col, True);
  drawsquare(m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
- occ & 1 << i, urg & 1 << i, col);
+ occ & 1 << i, col);
  dc.x += dc.w;
  }
  dc.w = blw = TEXTW(m->ltsymbol);
- drawtext(m->ltsymbol, dc.norm, False);
+ drawtext(m->ltsymbol, dc.colors[0], False);
  dc.x += dc.w;
  x = dc.x;
  if(m == selmon) { /* status is only drawn on selected monitor */
- dc.w = TEXTW(stext);
+ dc.w = textnw(stext, strlen(stext)); // no padding
  dc.x = m->ww - dc.w;
  if(dc.x < x) {
  dc.x = x;
  dc.w = m->ww - x;
  }
- drawtext(stext, dc.norm, False);
+ drawcoloredtext(stext);
  }
  else
  dc.x = m->ww;
  if((dc.w = dc.x - x) > bh) {
  dc.x = x;
  if(m->sel) {
- col = m == selmon ? dc.sel : dc.norm;
- drawtext(m->sel->name, col, False);
- drawsquare(m->sel->isfixed, m->sel->isfloating, False, col);
+ col = dc.colors[ m == selmon ? 1 : 0 ];
+ drawtext(m->sel->name, col, True);
+ drawsquare(m->sel->isfixed, m->sel->isfloating, col);
  }
  else
- drawtext(NULL, dc.norm, False);
+ drawtext(NULL, dc.colors[0], False);
  }
  XCopyArea(dpy, dc.drawable, m->barwin, dc.gc, 0, 0, m->ww, bh, 0, 0);
  XSync(dpy, False);
@@ -774,10 +776,35 @@
 }
 
 void
-drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]) {
+drawcoloredtext(char *text) {
+ char *buf = text, *ptr = buf, c = 1;
+ unsigned long *col = dc.colors[0];
+ int i, ox = dc.x;
+
+ while( *ptr ) {
+ for( i = 0; *ptr < 0 || *ptr > NUMCOLORS; i++, ptr++);
+ if( !*ptr ) break;
+ c=*ptr;
+ *ptr=0;
+ if( i ) {
+ dc.w = selmon->ww - dc.x;
+ drawtext(buf, col, False);
+ dc.x += textnw(buf, i);
+ }
+ *ptr = c;
+ col = dc.colors[ c-1 ];
+ buf = ++ptr;
+ }
+ drawtext(buf, col, False);
+ dc.x = ox;
+}
+
+void
+drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]) {
+
  int x;
 
- XSetForeground(dpy, dc.gc, col[invert ? ColBG : ColFG]);
+ XSetForeground(dpy, dc.gc, col[ColFG]);
  x = (dc.font.ascent + dc.font.descent + 2) / 4;
  if(filled)
  XFillRectangle(dpy, dc.drawable, dc.gc, dc.x+1, dc.y+1, x+1, x+1);
@@ -786,17 +813,17 @@
 }
 
 void
-drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
+drawtext(const char *text, unsigned long col[ColLast], Bool pad) {
  char buf[256];
  int i, x, y, h, len, olen;
 
- XSetForeground(dpy, dc.gc, col[invert ? ColFG : ColBG]);
+ XSetForeground(dpy, dc.gc, col[ColBG]);
  XFillRectangle(dpy, dc.drawable, dc.gc, dc.x, dc.y, dc.w, dc.h);
  if(!text)
  return;
  olen = strlen(text);
- h = dc.font.ascent + dc.font.descent;
- y = dc.y + (dc.h / 2) - (h / 2) + dc.font.ascent;
+ h = pad ? (dc.font.ascent + dc.font.descent) : 0;
+ y = dc.y + ((dc.h + dc.font.ascent - dc.font.descent) / 2);
  x = dc.x + (h / 2);
  /* shorten text if necessary */
  for(len = MIN(olen, sizeof buf); len && textnw(text, len) > dc.w - h; len--);
@@ -805,7 +832,7 @@
  memcpy(buf, text, len);
  if(len < olen)
  for(i = len; i && i > len - 3; buf[--i] = '.');
- XSetForeground(dpy, dc.gc, col[invert ? ColBG : ColFG]);
+ XSetForeground(dpy, dc.gc, col[ColFG]);
  if(dc.font.set)
  XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len);
  else
@@ -855,7 +882,7 @@
  detachstack(c);
  attachstack(c);
  grabbuttons(c, True);
- XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
+ XSetWindowBorder(dpy, c->win, dc.colors[1][ColBorder]);
  setfocus(c);
  }
  else
@@ -1144,7 +1171,7 @@
 
  wc.border_width = c->bw;
  XConfigureWindow(dpy, w, CWBorderWidth, &wc);
- XSetWindowBorder(dpy, w, dc.norm[ColBorder]);
+ XSetWindowBorder(dpy, w, dc.colors[0][ColBorder]);
  configure(c); /* propagates border_width, if size doesn't change */
  updatewindowtype(c);
  updatesizehints(c);
@@ -1612,12 +1639,11 @@
  cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
  cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur);
  /* init appearance */
- dc.norm[ColBorder] = getcolor(normbordercolor);
- dc.norm[ColBG] = getcolor(normbgcolor);
- dc.norm[ColFG] = getcolor(normfgcolor);
- dc.sel[ColBorder] = getcolor(selbordercolor);
- dc.sel[ColBG] = getcolor(selbgcolor);
- dc.sel[ColFG] = getcolor(selfgcolor);
+ for(int i=0; i<NUMCOLORS; i++) {
+ dc.colors[i][ColBorder] = getcolor( colors[i][ColBorder] );
+ dc.colors[i][ColFG] = getcolor( colors[i][ColFG] );
+ dc.colors[i][ColBG] = getcolor( colors[i][ColBG] );
+ }
  dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen));
  dc.gc = XCreateGC(dpy, root, 0, NULL);
  XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
@@ -1692,13 +1718,27 @@
 
 int
 textnw(const char *text, unsigned int len) {
+ // remove non-printing color codes before calculating width
+ char *ptr = (char *) text;
+ unsigned int i, ibuf, lenbuf=len;
+ char buf[len+1];
  XRectangle r;
 
+ for(i=0, ibuf=0; *ptr && i<len; i++, ptr++) {
+ if(*ptr <= NUMCOLORS && *ptr > 0) {
+ if (i < len) { lenbuf--; }
+ } else {
+ buf[ibuf]=*ptr;
+ ibuf++;
+ }
+ }
+ buf[ibuf]=0;
+
  if(dc.font.set) {
- XmbTextExtents(dc.font.set, text, len, NULL, &r);
+ XmbTextExtents(dc.font.set, buf, lenbuf, NULL, &r);
  return r.width;
  }
- return XTextWidth(dc.font.xfont, text, len);
+ return XTextWidth(dc.font.xfont, buf, lenbuf);
 }
 
 void
@@ -1776,7 +1816,7 @@
  if(!c)
  return;
  grabbuttons(c, False);
- XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]);
+ XSetWindowBorder(dpy, c->win, dc.colors[0][ColBorder]);
  if(setfocus)
  XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
 }

put it in a file called stauscolors.diff in ~/other

tried to patch
Code:
root@A880GZ:/home/jlloyd13/dwm-6.0# patch -p1 < /home/jlloyd13/other/statuscolors.diff
patching file dwm.c
Hunk #1 FAILED at 49.
Hunk #2 FAILED at 99.
Hunk #4 FAILED at 731.
Hunk #5 FAILED at 775.
Hunk #6 FAILED at 787.
Hunk #7 FAILED at 806.
Hunk #8 FAILED at 856.
Hunk #9 FAILED at 1145.
Hunk #10 FAILED at 1613.
Hunk #11 FAILED at 1693.
Hunk #12 FAILED at 1777.
11 out of 12 hunks FAILED -- saving rejects to file dwm.c.rej
root@A880GZ:/home/jlloyd13/dwm-6.0# 

first of all, what failed, second of all, why did #3 work?!? please help.
post #3787 of 7733
Quote:
Originally Posted by alexx2005 View Post


Jus' ol' Xmonad with a conky script reading schedule text file))

That is pretty klassno (I think I'm using the right word...been a couple years since I've tried Russian).
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
     
CPUGraphicsRAMHard Drive
Intel Core m3-6Y30 Intel HD515 8GB 1866DDR3L Micron M600 MTFDDAV256MBF M.2, 256 GB 
CoolingOSOSMonitor
Fanless Win10 Home x64 Kubuntu 16.04 (requires Linux kernel 4.5/4.6) 13.3 inch 16:9, 1920x1080 pixel, AU Optronics A... 
CPUMotherboardGraphicsRAM
AthlonIIX4 640 3.62GHz (250x14.5) 2.5GHz NB Asus M4A785TD-M EVO MSI GTX275 (Stock 666) 8GBs of GSkill 1600 
RAMHard DriveHard DriveHard Drive
4GBs of Adata 1333 Kingston HyperX 3k 120GB WD Caviar Black 500GB Hitachi Deskstar 1TB 
Optical DriveCoolingOSOS
LG 8X BDR (WHL08S20) Cooler Master Hyper 212+ Kubuntu x64 Windows 7 x64 
OSMonitorPowerCase
Bodhi Linux x64 Acer G215H (1920x1080) Seasonic 520 HAF912 
CPUMotherboardGraphicsRAM
N450 1.8GHz AC and 1.66GHz batt ASUS proprietary for 1001P GMA3150 (can play bluray now!?) 1GB DDR2 
Hard DriveOptical DriveOSOS
160GB LGLHDLBDRE32X Bodhi Linux Fedora LXDE 
OSOSMonitorKeyboard
Kubuntu SLAX 1280x600 + Dell 15inch Excellent! 
PowerCase
6 cells=6-12hrs and a charger 1001P MU17 Black 
  hide details  
post #3788 of 7733
Quote:
Originally Posted by jrl1357 View Post

hey a shrak? I've run into a problem I can't figure out.
found a patch on the arch forum
downloaded the code Warning: Spoiler! (Click to show)
Code:
diff -u a/dwm.c b/dwm.c
--- a/dwm.c 2011-12-27 09:47:17.000000000 +1300
+++ b/dwm-6.0/dwm.c 2011-12-27 09:46:52.000000000 +1300
@@ -49,6 +49,7 @@
 #define LENGTH(X) (sizeof X / sizeof X[0])
 #define MAX(A, B) ((A) > (B) ? (A) : (B))
 #define MIN(A, B) ((A) < (B) ? (A) : (B))
+#define MAXCOLORS 9
 #define MOUSEMASK (BUTTONMASK|PointerMotionMask)
 #define WIDTH(X) ((X)->w + 2 * (X)->bw)
 #define HEIGHT(X) ((X)->h + 2 * (X)->bw)
@@ -99,8 +100,7 @@
 
 typedef struct {
  int x, y, w, h;
- unsigned long norm[ColLast];
- unsigned long sel[ColLast];
+ unsigned long colors[MAXCOLORS][ColLast];
  Drawable drawable;
  GC gc;
  struct {
@@ -178,8 +178,9 @@
 static Monitor *dirtomon(int dir);
 static void drawbar(Monitor *m);
 static void drawbars(void);
-static void drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]);
-static void drawtext(const char *text, unsigned long col[ColLast], Bool invert);
+static void drawcoloredtext(char *text);
+static void drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]);
+static void drawtext(const char *text, unsigned long col[ColLast], Bool pad);
 static void enternotify(XEvent *e);
 static void expose(XEvent *e);
 static void focus(Client *c);
@@ -730,36 +731,37 @@
  dc.x = 0;
  for(i = 0; i < LENGTH(tags); i++) {
  dc.w = TEXTW(tags[i]);
- col = m->tagset[m->seltags] & 1 << i ? dc.sel : dc.norm;
- drawtext(tags[i], col, urg & 1 << i);
+ col = dc.colors[ (m->tagset[m->seltags] & 1 << i) ?
+ 1 : (urg & 1 << i ? 2:0) ];
+ drawtext(tags[i], col, True);
  drawsquare(m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
- occ & 1 << i, urg & 1 << i, col);
+ occ & 1 << i, col);
  dc.x += dc.w;
  }
  dc.w = blw = TEXTW(m->ltsymbol);
- drawtext(m->ltsymbol, dc.norm, False);
+ drawtext(m->ltsymbol, dc.colors[0], False);
  dc.x += dc.w;
  x = dc.x;
  if(m == selmon) { /* status is only drawn on selected monitor */
- dc.w = TEXTW(stext);
+ dc.w = textnw(stext, strlen(stext)); // no padding
  dc.x = m->ww - dc.w;
  if(dc.x < x) {
  dc.x = x;
  dc.w = m->ww - x;
  }
- drawtext(stext, dc.norm, False);
+ drawcoloredtext(stext);
  }
  else
  dc.x = m->ww;
  if((dc.w = dc.x - x) > bh) {
  dc.x = x;
  if(m->sel) {
- col = m == selmon ? dc.sel : dc.norm;
- drawtext(m->sel->name, col, False);
- drawsquare(m->sel->isfixed, m->sel->isfloating, False, col);
+ col = dc.colors[ m == selmon ? 1 : 0 ];
+ drawtext(m->sel->name, col, True);
+ drawsquare(m->sel->isfixed, m->sel->isfloating, col);
  }
  else
- drawtext(NULL, dc.norm, False);
+ drawtext(NULL, dc.colors[0], False);
  }
  XCopyArea(dpy, dc.drawable, m->barwin, dc.gc, 0, 0, m->ww, bh, 0, 0);
  XSync(dpy, False);
@@ -774,10 +776,35 @@
 }
 
 void
-drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]) {
+drawcoloredtext(char *text) {
+ char *buf = text, *ptr = buf, c = 1;
+ unsigned long *col = dc.colors[0];
+ int i, ox = dc.x;
+
+ while( *ptr ) {
+ for( i = 0; *ptr < 0 || *ptr > NUMCOLORS; i++, ptr++);
+ if( !*ptr ) break;
+ c=*ptr;
+ *ptr=0;
+ if( i ) {
+ dc.w = selmon->ww - dc.x;
+ drawtext(buf, col, False);
+ dc.x += textnw(buf, i);
+ }
+ *ptr = c;
+ col = dc.colors[ c-1 ];
+ buf = ++ptr;
+ }
+ drawtext(buf, col, False);
+ dc.x = ox;
+}
+
+void
+drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]) {
+
  int x;
 
- XSetForeground(dpy, dc.gc, col[invert ? ColBG : ColFG]);
+ XSetForeground(dpy, dc.gc, col[ColFG]);
  x = (dc.font.ascent + dc.font.descent + 2) / 4;
  if(filled)
  XFillRectangle(dpy, dc.drawable, dc.gc, dc.x+1, dc.y+1, x+1, x+1);
@@ -786,17 +813,17 @@
 }
 
 void
-drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
+drawtext(const char *text, unsigned long col[ColLast], Bool pad) {
  char buf[256];
  int i, x, y, h, len, olen;
 
- XSetForeground(dpy, dc.gc, col[invert ? ColFG : ColBG]);
+ XSetForeground(dpy, dc.gc, col[ColBG]);
  XFillRectangle(dpy, dc.drawable, dc.gc, dc.x, dc.y, dc.w, dc.h);
  if(!text)
  return;
  olen = strlen(text);
- h = dc.font.ascent + dc.font.descent;
- y = dc.y + (dc.h / 2) - (h / 2) + dc.font.ascent;
+ h = pad ? (dc.font.ascent + dc.font.descent) : 0;
+ y = dc.y + ((dc.h + dc.font.ascent - dc.font.descent) / 2);
  x = dc.x + (h / 2);
  /* shorten text if necessary */
  for(len = MIN(olen, sizeof buf); len && textnw(text, len) > dc.w - h; len--);
@@ -805,7 +832,7 @@
  memcpy(buf, text, len);
  if(len < olen)
  for(i = len; i && i > len - 3; buf[--i] = '.');
- XSetForeground(dpy, dc.gc, col[invert ? ColBG : ColFG]);
+ XSetForeground(dpy, dc.gc, col[ColFG]);
  if(dc.font.set)
  XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len);
  else
@@ -855,7 +882,7 @@
  detachstack(c);
  attachstack(c);
  grabbuttons(c, True);
- XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
+ XSetWindowBorder(dpy, c->win, dc.colors[1][ColBorder]);
  setfocus(c);
  }
  else
@@ -1144,7 +1171,7 @@
 
  wc.border_width = c->bw;
  XConfigureWindow(dpy, w, CWBorderWidth, &wc);
- XSetWindowBorder(dpy, w, dc.norm[ColBorder]);
+ XSetWindowBorder(dpy, w, dc.colors[0][ColBorder]);
  configure(c); /* propagates border_width, if size doesn't change */
  updatewindowtype(c);
  updatesizehints(c);
@@ -1612,12 +1639,11 @@
  cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
  cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur);
  /* init appearance */
- dc.norm[ColBorder] = getcolor(normbordercolor);
- dc.norm[ColBG] = getcolor(normbgcolor);
- dc.norm[ColFG] = getcolor(normfgcolor);
- dc.sel[ColBorder] = getcolor(selbordercolor);
- dc.sel[ColBG] = getcolor(selbgcolor);
- dc.sel[ColFG] = getcolor(selfgcolor);
+ for(int i=0; i<NUMCOLORS; i++) {
+ dc.colors[i][ColBorder] = getcolor( colors[i][ColBorder] );
+ dc.colors[i][ColFG] = getcolor( colors[i][ColFG] );
+ dc.colors[i][ColBG] = getcolor( colors[i][ColBG] );
+ }
  dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen));
  dc.gc = XCreateGC(dpy, root, 0, NULL);
  XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
@@ -1692,13 +1718,27 @@
 
 int
 textnw(const char *text, unsigned int len) {
+ // remove non-printing color codes before calculating width
+ char *ptr = (char *) text;
+ unsigned int i, ibuf, lenbuf=len;
+ char buf[len+1];
  XRectangle r;
 
+ for(i=0, ibuf=0; *ptr && i<len; i++, ptr++) {
+ if(*ptr <= NUMCOLORS && *ptr > 0) {
+ if (i < len) { lenbuf--; }
+ } else {
+ buf[ibuf]=*ptr;
+ ibuf++;
+ }
+ }
+ buf[ibuf]=0;
+
  if(dc.font.set) {
- XmbTextExtents(dc.font.set, text, len, NULL, &r);
+ XmbTextExtents(dc.font.set, buf, lenbuf, NULL, &r);
  return r.width;
  }
- return XTextWidth(dc.font.xfont, text, len);
+ return XTextWidth(dc.font.xfont, buf, lenbuf);
 }
 
 void
@@ -1776,7 +1816,7 @@
  if(!c)
  return;
  grabbuttons(c, False);
- XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]);
+ XSetWindowBorder(dpy, c->win, dc.colors[0][ColBorder]);
  if(setfocus)
  XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
 }
put it in a file called stauscolors.diff in ~/other
tried to patch
Code:
root@A880GZ:/home/jlloyd13/dwm-6.0# patch -p1 < /home/jlloyd13/other/statuscolors.diff
patching file dwm.c
Hunk #1 FAILED at 49.
Hunk #2 FAILED at 99.
Hunk #4 FAILED at 731.
Hunk #5 FAILED at 775.
Hunk #6 FAILED at 787.
Hunk #7 FAILED at 806.
Hunk #8 FAILED at 856.
Hunk #9 FAILED at 1145.
Hunk #10 FAILED at 1613.
Hunk #11 FAILED at 1693.
Hunk #12 FAILED at 1777.
11 out of 12 hunks FAILED -- saving rejects to file dwm.c.rej
root@A880GZ:/home/jlloyd13/dwm-6.0# 
first of all, what failed, second of all, why did #3 work?!? please help.

Basically, each patch is tested against a vanilla source ( or a previously patched source, if it's from a specific persons set of patches ), and after a few patches the lines are offset too differently and/or the code has changed from what it has been set to find and replace.

And it seems you've hit that wall now tongue.gif

Sooooo,

look at which file it tells you to patch ( usually always dwm.c and/or config.h for dwm stuff ).


@@ -774,10 +776,35 @@ this tells you the starting line at which to start looking. So in this case Line 774, before previous patches were applied. It could be offset as much as... 100+ lines sometimes though. Just make sure the code your changing is the right one though.

Minus is remove ( obviously )
Plus is add ( as above tongue.gif )

And copy/paste ( write by hand, your choice ) what you can. Which should work with /most/ patches. A few you may need some programming skills to take the new patch, mix and mash into the old patch so that both still work ( they way intended ).


I would reccomend applying the Pango or XFT patch first ( if you want to use pango/xft font ), then statuscolors second. The rest after that should require very little modifications.

P.S. This is the kind of stuff I have trouble explaining ( partly due to my English, partly due to my demons ). Much better at just doing than I am explaining/teaching, lol.
Edited by Shrak - 10/2/12 at 6:36pm
post #3789 of 7733
Quote:
Originally Posted by Shrak View Post

Quote:
Originally Posted by jrl1357 View Post

hey a shrak? I've run into a problem I can't figure out.
found a patch on the arch forum
downloaded the code Warning: Spoiler! (Click to show)
Code:
diff -u a/dwm.c b/dwm.c
--- a/dwm.c 2011-12-27 09:47:17.000000000 +1300
+++ b/dwm-6.0/dwm.c 2011-12-27 09:46:52.000000000 +1300
@@ -49,6 +49,7 @@
 #define LENGTH(X) (sizeof X / sizeof X[0])
 #define MAX(A, B) ((A) > (B) ? (A) : (B))
 #define MIN(A, B) ((A) < (B) ? (A) : (B))
+#define MAXCOLORS 9
 #define MOUSEMASK (BUTTONMASK|PointerMotionMask)
 #define WIDTH(X) ((X)->w + 2 * (X)->bw)
 #define HEIGHT(X) ((X)->h + 2 * (X)->bw)
@@ -99,8 +100,7 @@
 
 typedef struct {
  int x, y, w, h;
- unsigned long norm[ColLast];
- unsigned long sel[ColLast];
+ unsigned long colors[MAXCOLORS][ColLast];
  Drawable drawable;
  GC gc;
  struct {
@@ -178,8 +178,9 @@
 static Monitor *dirtomon(int dir);
 static void drawbar(Monitor *m);
 static void drawbars(void);
-static void drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]);
-static void drawtext(const char *text, unsigned long col[ColLast], Bool invert);
+static void drawcoloredtext(char *text);
+static void drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]);
+static void drawtext(const char *text, unsigned long col[ColLast], Bool pad);
 static void enternotify(XEvent *e);
 static void expose(XEvent *e);
 static void focus(Client *c);
@@ -730,36 +731,37 @@
  dc.x = 0;
  for(i = 0; i < LENGTH(tags); i++) {
  dc.w = TEXTW(tags[i]);
- col = m->tagset[m->seltags] & 1 << i ? dc.sel : dc.norm;
- drawtext(tags[i], col, urg & 1 << i);
+ col = dc.colors[ (m->tagset[m->seltags] & 1 << i) ?
+ 1 : (urg & 1 << i ? 2:0) ];
+ drawtext(tags[i], col, True);
  drawsquare(m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
- occ & 1 << i, urg & 1 << i, col);
+ occ & 1 << i, col);
  dc.x += dc.w;
  }
  dc.w = blw = TEXTW(m->ltsymbol);
- drawtext(m->ltsymbol, dc.norm, False);
+ drawtext(m->ltsymbol, dc.colors[0], False);
  dc.x += dc.w;
  x = dc.x;
  if(m == selmon) { /* status is only drawn on selected monitor */
- dc.w = TEXTW(stext);
+ dc.w = textnw(stext, strlen(stext)); // no padding
  dc.x = m->ww - dc.w;
  if(dc.x < x) {
  dc.x = x;
  dc.w = m->ww - x;
  }
- drawtext(stext, dc.norm, False);
+ drawcoloredtext(stext);
  }
  else
  dc.x = m->ww;
  if((dc.w = dc.x - x) > bh) {
  dc.x = x;
  if(m->sel) {
- col = m == selmon ? dc.sel : dc.norm;
- drawtext(m->sel->name, col, False);
- drawsquare(m->sel->isfixed, m->sel->isfloating, False, col);
+ col = dc.colors[ m == selmon ? 1 : 0 ];
+ drawtext(m->sel->name, col, True);
+ drawsquare(m->sel->isfixed, m->sel->isfloating, col);
  }
  else
- drawtext(NULL, dc.norm, False);
+ drawtext(NULL, dc.colors[0], False);
  }
  XCopyArea(dpy, dc.drawable, m->barwin, dc.gc, 0, 0, m->ww, bh, 0, 0);
  XSync(dpy, False);
@@ -774,10 +776,35 @@
 }
 
 void
-drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]) {
+drawcoloredtext(char *text) {
+ char *buf = text, *ptr = buf, c = 1;
+ unsigned long *col = dc.colors[0];
+ int i, ox = dc.x;
+
+ while( *ptr ) {
+ for( i = 0; *ptr < 0 || *ptr > NUMCOLORS; i++, ptr++);
+ if( !*ptr ) break;
+ c=*ptr;
+ *ptr=0;
+ if( i ) {
+ dc.w = selmon->ww - dc.x;
+ drawtext(buf, col, False);
+ dc.x += textnw(buf, i);
+ }
+ *ptr = c;
+ col = dc.colors[ c-1 ];
+ buf = ++ptr;
+ }
+ drawtext(buf, col, False);
+ dc.x = ox;
+}
+
+void
+drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]) {
+
  int x;
 
- XSetForeground(dpy, dc.gc, col[invert ? ColBG : ColFG]);
+ XSetForeground(dpy, dc.gc, col[ColFG]);
  x = (dc.font.ascent + dc.font.descent + 2) / 4;
  if(filled)
  XFillRectangle(dpy, dc.drawable, dc.gc, dc.x+1, dc.y+1, x+1, x+1);
@@ -786,17 +813,17 @@
 }
 
 void
-drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
+drawtext(const char *text, unsigned long col[ColLast], Bool pad) {
  char buf[256];
  int i, x, y, h, len, olen;
 
- XSetForeground(dpy, dc.gc, col[invert ? ColFG : ColBG]);
+ XSetForeground(dpy, dc.gc, col[ColBG]);
  XFillRectangle(dpy, dc.drawable, dc.gc, dc.x, dc.y, dc.w, dc.h);
  if(!text)
  return;
  olen = strlen(text);
- h = dc.font.ascent + dc.font.descent;
- y = dc.y + (dc.h / 2) - (h / 2) + dc.font.ascent;
+ h = pad ? (dc.font.ascent + dc.font.descent) : 0;
+ y = dc.y + ((dc.h + dc.font.ascent - dc.font.descent) / 2);
  x = dc.x + (h / 2);
  /* shorten text if necessary */
  for(len = MIN(olen, sizeof buf); len && textnw(text, len) > dc.w - h; len--);
@@ -805,7 +832,7 @@
  memcpy(buf, text, len);
  if(len < olen)
  for(i = len; i && i > len - 3; buf[--i] = '.');
- XSetForeground(dpy, dc.gc, col[invert ? ColBG : ColFG]);
+ XSetForeground(dpy, dc.gc, col[ColFG]);
  if(dc.font.set)
  XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len);
  else
@@ -855,7 +882,7 @@
  detachstack(c);
  attachstack(c);
  grabbuttons(c, True);
- XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
+ XSetWindowBorder(dpy, c->win, dc.colors[1][ColBorder]);
  setfocus(c);
  }
  else
@@ -1144,7 +1171,7 @@
 
  wc.border_width = c->bw;
  XConfigureWindow(dpy, w, CWBorderWidth, &wc);
- XSetWindowBorder(dpy, w, dc.norm[ColBorder]);
+ XSetWindowBorder(dpy, w, dc.colors[0][ColBorder]);
  configure(c); /* propagates border_width, if size doesn't change */
  updatewindowtype(c);
  updatesizehints(c);
@@ -1612,12 +1639,11 @@
  cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
  cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur);
  /* init appearance */
- dc.norm[ColBorder] = getcolor(normbordercolor);
- dc.norm[ColBG] = getcolor(normbgcolor);
- dc.norm[ColFG] = getcolor(normfgcolor);
- dc.sel[ColBorder] = getcolor(selbordercolor);
- dc.sel[ColBG] = getcolor(selbgcolor);
- dc.sel[ColFG] = getcolor(selfgcolor);
+ for(int i=0; i<NUMCOLORS; i++) {
+ dc.colors[i][ColBorder] = getcolor( colors[i][ColBorder] );
+ dc.colors[i][ColFG] = getcolor( colors[i][ColFG] );
+ dc.colors[i][ColBG] = getcolor( colors[i][ColBG] );
+ }
  dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen));
  dc.gc = XCreateGC(dpy, root, 0, NULL);
  XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
@@ -1692,13 +1718,27 @@
 
 int
 textnw(const char *text, unsigned int len) {
+ // remove non-printing color codes before calculating width
+ char *ptr = (char *) text;
+ unsigned int i, ibuf, lenbuf=len;
+ char buf[len+1];
  XRectangle r;
 
+ for(i=0, ibuf=0; *ptr && i<len; i++, ptr++) {
+ if(*ptr <= NUMCOLORS && *ptr > 0) {
+ if (i < len) { lenbuf--; }
+ } else {
+ buf[ibuf]=*ptr;
+ ibuf++;
+ }
+ }
+ buf[ibuf]=0;
+
  if(dc.font.set) {
- XmbTextExtents(dc.font.set, text, len, NULL, &r);
+ XmbTextExtents(dc.font.set, buf, lenbuf, NULL, &r);
  return r.width;
  }
- return XTextWidth(dc.font.xfont, text, len);
+ return XTextWidth(dc.font.xfont, buf, lenbuf);
 }
 
 void
@@ -1776,7 +1816,7 @@
  if(!c)
  return;
  grabbuttons(c, False);
- XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]);
+ XSetWindowBorder(dpy, c->win, dc.colors[0][ColBorder]);
  if(setfocus)
  XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
 }
put it in a file called stauscolors.diff in ~/other
tried to patch
Code:
root@A880GZ:/home/jlloyd13/dwm-6.0# patch -p1 < /home/jlloyd13/other/statuscolors.diff
patching file dwm.c
Hunk #1 FAILED at 49.
Hunk #2 FAILED at 99.
Hunk #4 FAILED at 731.
Hunk #5 FAILED at 775.
Hunk #6 FAILED at 787.
Hunk #7 FAILED at 806.
Hunk #8 FAILED at 856.
Hunk #9 FAILED at 1145.
Hunk #10 FAILED at 1613.
Hunk #11 FAILED at 1693.
Hunk #12 FAILED at 1777.
11 out of 12 hunks FAILED -- saving rejects to file dwm.c.rej
root@A880GZ:/home/jlloyd13/dwm-6.0# 
first of all, what failed, second of all, why did #3 work?!? please help.

Basically, each patch is tested against a vanilla source ( or a previously patched source, if it's from a specific persons set of patches ), and after a few patches the lines are offset too differently and/or the code has changed from what it has been set to find and replace.

And it seems you've hit that wall now tongue.gif

Sooooo,

look at which file it tells you to patch ( usually always dwm.c and/or config.h for dwm stuff ).


@@ -774,10 +776,35 @@ this tells you the starting line at which to start looking. So in this case Line 774, before previous patches were applied. It could be offset as much as... 100+ lines sometimes though. Just make sure the code your changing is the right one though.

Minus is remove ( obviously )
Plus is add ( as above tongue.gif )

And copy/paste ( write by hand, your choice ) what you can. Which should work with /most/ patches. A few you may need some programming skills to take the new patch, mix and mash into the old patch so that both still work ( they way intended ).


I would reccomend applying the Pango or XFT patch first ( if you want to use pango/xft font ), then statuscolors second. The rest after that should require very little modifications.

P.S. This is the kind of stuff I have trouble explaining ( partly due to my English, partly due to my demons ). Much better at just doing than I am explaining/teaching, lol.

so english is a second language for you? whats first?

i'll go though dwm.c, remove what was patched, install xft, patch by hand statuscolors, then I can use your border bar for a 1px white line. wackosmiley.gif I'm sure I'm crazy but I feel I have too...... biggrin.gif
post #3790 of 7733
Quote:
Originally Posted by jrl1357 View Post

so english is a second language for you? whats first?
i'll go though dwm.c, remove what was patched, install xft, patch by hand statuscolors, then I can use your border bar for a 1px white line. wackosmiley.gif I'm sure I'm crazy but I feel I have too...... biggrin.gif

Yup tongue.gif

A varient of Spanish/Maya ( easiest way to describe it ) is what I speak most of with my grandparents and gf. Grew up with them speaking it to me so it's naturally what I took to the most, so much so I failed every English class during school. smile.gif Also a bit of German, albeit a bit rusty now as none of the family speaks it anymore ( most of the older generations absolutely refuse to as their hate for Germany is that bad ).

Which is why every once in a while you'll notice a ton of typos, lol. My English is good but I have times when it's just seems to go poof and all of a sudden I'm like o.O;; "wait a min"

And you could just install mine and be good to go for the most part, has all of those already patched into it tongue.gif And it may be time to start looking into learning some C so you can really get a grasp and start going at it smile.gif Pretty fun figuring out things you can do.
Edited by Shrak - 10/2/12 at 6:59pm
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
This thread is locked