You are not logged in.

#1 2014-11-19 13:49:44

parazyd
Member
From: Amsterdam
Registered: 2012-10-14
Posts: 259
Website

[SOLVED] Error compiling systray patch for dwm 6.0

Hello folks.

This is makepkg's output.

┌─[parazyd][archbox][~/dwm]
└──╼  makepkg -ef
==> Making package: dwm 6.0-1 (Wed Nov 19 17:33:05 CET 2014)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing src/ tree
==> Removing existing pkg/ directory...
==> Starting build()...
dwm build options:
CFLAGS   = -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/include/X11 -D_FORTIFY_SOURCE=2 -DVERSION="6.0" -DXINERAMA
LDFLAGS  = -s -L/usr/lib -lc -L/usr/lib/X11 -lX11 -L/usr/lib/X11 -lXinerama
CC       = cc
CC dwm.c
In file included from dwm.c:329:0:
config.h:67:1: warning: initialization from incompatible pointer type
 static const char *scratchpadcmd[]   = { termcmd, "-title", scratchpadname, "-geometry", "150x40", NULL };
 ^
config.h:67:1: warning: (near initialization for ‘scratchpadcmd[0]’)
dwm.c: In function ‘cleanup’:
dwm.c:551:5: error: ‘showsystray’ undeclared (first use in this function)
  if(showsystray) {
     ^
dwm.c:551:5: note: each undeclared identifier is reported only once for each function it appears in
dwm.c: In function ‘clientmessage’:
dwm.c:593:5: error: ‘showsystray’ undeclared (first use in this function)
  if(showsystray && cme->window == systray->win && cme->message_type == netatom[NetSystemTrayOP]) {
     ^
dwm.c: In function ‘drawbar’:
dwm.c:866:6: error: ‘showsystray’ undeclared (first use in this function)
   if(showsystray && m == selmon)
      ^
dwm.c: In function ‘getsystraywidth’:
dwm.c:1124:5: error: ‘showsystray’ undeclared (first use in this function)
  if(showsystray)
     ^
dwm.c:1125:42: error: ‘systrayspacing’ undeclared (first use in this function)
   for(i = systray->icons; i; w += i->w + systrayspacing, i = i->next);
                                          ^
dwm.c:1125:56: warning: left-hand operand of comma expression has no effect [-Wunused-value]
   for(i = systray->icons; i; w += i->w + systrayspacing, i = i->next);
                                                        ^
dwm.c: In function ‘keypress’:
dwm.c:1252:2: warning: ‘XKeycodeToKeysym’ is deprecated (declared at /usr/include/X11/Xlib.h:1699) [-Wdeprecated-declarations]
  keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
  ^
dwm.c: In function ‘removesystrayicon’:
dwm.c:1541:6: error: ‘showsystray’ undeclared (first use in this function)
  if(!showsystray || !i)
      ^
dwm.c: In function ‘resizebarwin’:
dwm.c:1560:5: error: ‘showsystray’ undeclared (first use in this function)
  if(showsystray && m == selmon)
     ^
dwm.c: In function ‘togglebar’:
dwm.c:1996:5: error: ‘showsystray’ undeclared (first use in this function)
  if(showsystray) {
     ^
dwm.c: In function ‘updatebars’:
dwm.c:2130:6: error: ‘showsystray’ undeclared (first use in this function)
   if(showsystray && m == selmon)
      ^
dwm.c: In function ‘updatesystrayiconstate’:
dwm.c:2343:6: error: ‘showsystray’ undeclared (first use in this function)
  if(!showsystray || !i || ev->atom != xatom[XembedInfo] ||
      ^
dwm.c: In function ‘updatesystray’:
dwm.c:2372:6: error: ‘showsystray’ undeclared (first use in this function)
  if(!showsystray)
      ^
dwm.c:2378:79: error: ‘DC’ has no member named ‘sel’
   systray->win = XCreateSimpleWindow(dpy, root, x, selmon->by, w, bh, 0, 0, dc.sel[ColBG]);
                                                                               ^
dwm.c:2382:28: error: ‘DC’ has no member named ‘norm’
   wa.background_pixel  = dc.norm[ColBG];
                            ^
dwm.c:2402:8: error: ‘systrayspacing’ undeclared (first use in this function)
   w += systrayspacing;
        ^
dwm.c: In function ‘wintosystrayicon’:
dwm.c:2509:6: error: ‘showsystray’ undeclared (first use in this function)
  if(!showsystray || !w)
      ^
Makefile:18: recipe for target 'dwm.o' failed
make: *** [dwm.o] Error 1
==> ERROR: A failure occurred in build().
    Aborting...

I'm trying to apply systray to my dwm-6.0, but I get errors when compiling and I'm not exactly sure what's the problem. Could anyone help?
Here's the dwm.c after applying the patch: http://pastebin.com/Aie3Uw0n
This is my dwm.c prior to patching (this one works): http://pastebin.com/ra0NhGnV

And here's Unia's patch I'm trying to use: https://github.com/Unia/dwm-patches/blo … stray.diff

Any help would be kindly appreciated.

-- mod note: split from https://bbs.archlinux.org/viewtopic.php?id=92895&p=28 - Trilby --

Last edited by parazyd (2014-11-19 17:03:03)

Offline

#2 2014-11-19 14:44:15

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] Error compiling systray patch for dwm 6.0

So .... are you going to say what errors you are getting??  If you don't no one can help.  If you do, that might be best in a separate thread.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

#3 2014-11-19 15:36:08

parazyd
Member
From: Amsterdam
Registered: 2012-10-14
Posts: 259
Website

Re: [SOLVED] Error compiling systray patch for dwm 6.0

Trilby wrote:

So .... are you going to say what errors you are getting??  If you don't no one can help.  If you do, that might be best in a separate thread.

Sorry, I forgot about it.
Here's a screenshot: https://i.imgur.com/E1NyWyt.png

Offline

#4 2014-11-19 15:44:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] Error compiling systray patch for dwm 6.0

Trilby wrote:

If you do, that might be best in a separate thread.

So I'll split it out for you.  But I'm not going to interpret a screenshot image of text-errors.  Post text as text.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

#5 2014-11-19 16:04:59

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: [SOLVED] Error compiling systray patch for dwm 6.0

You need to update your config.h.


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#6 2014-11-19 16:31:36

parazyd
Member
From: Amsterdam
Registered: 2012-10-14
Posts: 259
Website

Re: [SOLVED] Error compiling systray patch for dwm 6.0

Unia wrote:

You need to update your config.h.

With what exactly? Your patch doesn't have any config.h related code.

Offline

#7 2014-11-19 16:38:12

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: [SOLVED] Error compiling systray patch for dwm 6.0

If you read your output, it lists "undeclared variables". Declare those in your config.h:

+static const unsigned int systrayspacing = 2;   /* systray spacing */
+static const Bool showsystray       = True;     /* False means no systray */

My repository is merely a collection of patches I have once used; if you want complete sets (e.g. with changes to config.h) you should go to the suckless website.

Now there are other issues left, but I'll leave those for you to figure out. Also, as Trilby said, posting the error messages as text makes it easier for us to read.

Last edited by Unia (2014-11-19 16:40:52)


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#8 2014-11-19 16:42:54

parazyd
Member
From: Amsterdam
Registered: 2012-10-14
Posts: 259
Website

Re: [SOLVED] Error compiling systray patch for dwm 6.0

Thanks a lot for that. Now I seem to be stuck on another thing :-/
I have no idea what to do...

==> Making package: dwm 6.0-1 (Wed Nov 19 17:39:04 CET 2014)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing src/ tree
==> Removing existing pkg/ directory...
==> Starting build()...
dwm build options:
CFLAGS   = -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/include/X11 -D_FORTIFY_SOURCE=2 -DVERSION="6.0" -DXINERAMA
LDFLAGS  = -s -L/usr/lib -lc -L/usr/lib/X11 -lX11 -L/usr/lib/X11 -lXinerama
CC       = cc
CC dwm.c
In file included from dwm.c:329:0:
config.h:25:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘const’
 tatic const unsigned int systraypinning = 0;   /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
       ^
In file included from dwm.c:329:0:
config.h:71:1: warning: initialization from incompatible pointer type
 static const char *scratchpadcmd[]   = { termcmd, "-title", scratchpadname, "-geometry", "150x40", NULL };
 ^
config.h:71:1: warning: (near initialization for ‘scratchpadcmd[0]’)
dwm.c: In function ‘keypress’:
dwm.c:1252:2: warning: ‘XKeycodeToKeysym’ is deprecated (declared at /usr/include/X11/Xlib.h:1699) [-Wdeprecated-declarations]
  keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
  ^
dwm.c: In function ‘updatesystray’:
dwm.c:2378:79: error: ‘DC’ has no member named ‘sel’
   systray->win = XCreateSimpleWindow(dpy, root, x, selmon->by, w, bh, 0, 0, dc.sel[ColBG]);
                                                                               ^
dwm.c:2382:28: error: ‘DC’ has no member named ‘norm’
   wa.background_pixel  = dc.norm[ColBG];
                            ^
Makefile:18: recipe for target 'dwm.o' failed
make: *** [dwm.o] Error 1
==> ERROR: A failure occurred in build().
    Aborting...

Offline

#9 2014-11-19 16:47:04

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] Error compiling systray patch for dwm 6.0

The first is an obvious typo.  The second is because 'termcmd' isn't a string variable (not a const char *).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

#10 2014-11-19 16:51:46

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Error compiling systray patch for dwm 6.0

Not a Programming issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2014-11-19 17:01:36

parazyd
Member
From: Amsterdam
Registered: 2012-10-14
Posts: 259
Website

Re: [SOLVED] Error compiling systray patch for dwm 6.0

Okay. Turns out it's because of statuscolors. Changed both .sel and .norm to .colors
It compiles smile Now to test it out. Thanks guys!

/edit

Works like a charm! Thanks again smile

Last edited by parazyd (2014-11-19 17:03:47)

Offline

Board footer

Powered by FluxBB