[solved] [dwm] wrong encoding

Hi,
I have a few questions related to dwm:
1.
The titlebar of dwm gives me problems with umlauts (öäü). Its a fresh 2009.08-installation with dwm (5.6.1) as windowmanager.  Instead of umlauts funny symbols and letters are shown. I have the same problem with elinks, but I dont know if that is related.
2.
Is there a possibility to add the pertag-patch in 5.6.1? As far as I understand the patches are versionspecific and therefore I would have to wait for a 5.6.1 pertag-patch?
3.
Where do I have to put the programnames for autostarting programms in dwm? I want firefox, thunderbird, pcmanfm, geany a.s.o. to autostart everytime I invoke X and appear within their special tagspace, so I changed config.h accordingly.
It would be cool, if anybody could help me
Last edited by inknoir (2009-11-23 12:13:26)

1. You either have a font that doesn't have such characters, or you have the wrong encoding. I'm using the standard "fixed" font in its "7x14" variant with a UTF-8 encoding, and umlauts look fine.
2. Someone posted a current version of the pertag patch on the "dev" mailing list at suckless. I applied it. I'll post it as it applied for me, but I have other patches, so it might not apply cleanly for you, in which case, go search the mailing list archives.
--- a/dwm.c Sat Aug 01 20:15:03 2009 -0400
+++ b/dwm.c Sun Aug 02 17:26:12 2009 -0400
@@ -120,25 +120,6 @@
void (*arrange)(Monitor *);
} Layout;
-struct Monitor {
- float mfact;
- int num;
- int by; /* bar geometry */
- int mx, my, mw, mh; /* screen size */
- int wx, wy, ww, wh; /* window area */
- unsigned int seltags;
- unsigned int sellt;
- unsigned int tagset[2];
- Bool showbar;
- Bool topbar;
- Client *clients;
- Client *sel;
- Client *stack;
- Monitor *next;
- Window barwin;
- const Layout *lt[2];
typedef struct {
const char *class;
const char *instance;
@@ -270,6 +252,30 @@
/* configuration, allows nested code to access above variables */
#include "config.h"
+struct Monitor {
+ float mfact;
+ int num;
+ int by; /* bar geometry */
+ int mx, my, mw, mh; /* screen size */
+ int wx, wy, ww, wh; /* window area */
+ unsigned int seltags;
+ unsigned int sellt;
+ unsigned int tagset[2];
+ Bool showbar;
+ Bool topbar;
+ Client *clients;
+ Client *sel;
+ Client *stack;
+ Monitor *next;
+ Window barwin;
+ const Layout *lt[2];
+ int curtag;
+ int prevtag;
+ const Layout *lts[LENGTH(tags) + 1];
+ double mfacts[LENGTH(tags) + 1];
+ Bool showbars[LENGTH(tags) + 1];
+};
+
/* compile-time check if all tags fit into an unsigned int bit array. */
struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
@@ -1401,7 +1446,7 @@
if(!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
selmon->sellt ^= 1;
if(arg && arg->v)
- selmon->lt[selmon->sellt] = (Layout *)arg->v;
+ selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag] = (Layout *)arg->v;
if(selmon->sel)
arrange();
else
@@ -1418,7 +1463,7 @@
f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
if(f < 0.1 || f > 0.9)
return;
- selmon->mfact = f;
+ selmon->mfact = selmon->mfacts[selmon->curtag] = f;
arrange();
@@ -1427,6 +1472,7 @@
unsigned int i;
int w;
XSetWindowAttributes wa;
+ Monitor *m;
/* init screen */
screen = DefaultScreen(dpy);
@@ -1458,11 +1504,31 @@
XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
if(!dc.font.set)
XSetFont(dpy, dc.gc, dc.font.xfont->fid);
+ /* init tags */
+ for(m = mons; m; m = m->next)
+ m->curtag = m->prevtag = 1;
+ /* init mfacts */
+ for(m = mons; m; m = m->next) {
+ for(i=0; i < LENGTH(tags) + 1 ; i++) {
+ m->mfacts[i] = m->mfact;
+ }
+ }
+ /* init layouts */
+ for(m = mons; m; m = m->next) {
+ for(i=0; i < LENGTH(tags) + 1; i++) {
+ m->lts[i] = &layouts[0];
+ }
+ }
/* init bars */
for(blw = i = 0; LENGTH(layouts) > 1 && i < LENGTH(layouts); i++) {
w = TEXTW(layouts[i].symbol);
blw = MAX(blw, w);
+ for(m = mons; m; m = m->next) {
+ for(i=0; i < LENGTH(tags) + 1; i++) {
+ m->showbars[i] = m->showbar;
+ }
+ }
updatebars();
updatestatus();
/* EWMH support per view */
@@ -1572,7 +1638,7 @@
void
togglebar(const Arg *arg) {
- selmon->showbar = !selmon->showbar;
+ selmon->showbar = selmon->showbars[selmon->curtag] = !selmon->showbar;
updatebarpos(selmon);
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
arrange();
@@ -1592,12 +1658,26 @@
void
toggletag(const Arg *arg) {
unsigned int mask;
+ unsigned int i;
if(!selmon->sel)
return;
mask = selmon->sel->tags ^ (arg->ui & TAGMASK);
if(mask) {
- selmon->sel->tags = mask;
+ if(mask == ~0) {
+ selmon->prevtag = selmon->curtag;
+ selmon->curtag = 0;
+ }
+ if(!(mask & 1 << (selmon->curtag - 1))) {
+ selmon->prevtag = selmon->curtag;
+ for (i=0; !(mask & 1 << i); i++);
+ selmon->curtag = i + 1;
+ }
+ selmon->sel->tags = mask;
+ selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag];
+ selmon->mfact = selmon->mfacts[selmon->curtag];
+ if (selmon->showbar != selmon->showbars[selmon->curtag])
+ togglebar(NULL);
arrange();
@@ -1854,11 +1934,28 @@
void
view(const Arg *arg) {
+ unsigned int i;
if((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
return;
selmon->seltags ^= 1; /* toggle sel tagset */
- if(arg->ui & TAGMASK)
- selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
+ if(arg->ui & TAGMASK) {
+ selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
+ selmon->prevtag = selmon->curtag;
+ if(arg->ui == ~0)
+ selmon->curtag = 0;
+ else {
+ for (i=0; !(arg->ui & 1 << i); i++);
+ selmon->curtag = i + 1;
+ }
+ } else {
+ selmon->prevtag= selmon->curtag ^ selmon->prevtag;
+ selmon->curtag^= selmon->prevtag;
+ selmon->prevtag= selmon->curtag ^ selmon->prevtag;
+ }
+ selmon->lt[selmon->sellt]= selmon->lts[selmon->curtag];
+ selmon->mfact = selmon->mfacts[selmon->curtag];
+ if(selmon->showbar != selmon->showbars[selmon->curtag])
+ togglebar(NULL);
arrange();

Similar Messages

  • Wrong encoding using "Mail" on iPad

    Sorry for bringing up an old issue - -
    the official Mail App seemed to be unable to handle the utf-8 correctlly.
    I encountered with the same problem like this thread:
    https://discussions.apple.com/thread/2811597?start=0&tstart=0
    I have sent a mail , using my Google Mail account , with Official Mail App.
    (I've forced my Google Account to use UTF-8 while sending mail.)
    The subject of mail is "メルタスチン" (which pronounced in Japanese sounds like "mail testing")
    And the content is "アスタイト" (which sounds similar to "as title")
    However I get the mail with wrong encoding type in MIME header:
    http://pastie.org/6081304
    (The pastie link is clean.)
    The subject and content is messed up for sure ,too.
    I don't think it's an exeption specified to GMAIL ;I've tested Yahoo!, Hotmail, GMAIL, and it's still not working properly.
    However, the mail route acted pretty wiered.
    Background:
    I'm in Taiwan , people here use Traditional Chinese(local common encoding:Big5), but I need to send a Japanese mail(common encoding Shift_JS).
    P.S.
    There was an thread on google forum about this issue ; yet there's no pratical soltution.
    http://productforums.google.com/forum/#!category-topic/gmail/reading-and-receivi ng-messages/60vin5HXlgs

    OxISBEh wrote:
    However I get the mail with wrong encoding type in MIME header:
    Try adding a special character to your message to force UTF8 in iPad Mail.  Try an emoji character from the emoji keyboard, or a dingbat via copy/paste from an app like Unicode Map (range 2700).

  • Wrong encoding on disk: characters not correctly encoded [SOLVED]

    I don't even know how to start investigating what's wrong. Clearly, some part of the encoding is wrong. For instance, (when I do "ls"):
    Every character with some accent on it ü, ä etc are displayed in the same incorrect way. I have a fairly fresh install of Archlinux and run systemd (using the september install media). Any ideas of what I did wrong?
    (It's fairly important as i have quite a few folders with these characters in it (which I copied from another computer, also running Arch) and I cannot access those folders anymore!)
    Last edited by btorb (2012-10-17 09:48:08)

    Solved: the /etc/locale.gen and /etc/locale.conf were incorrect.
    See https://wiki.archlinux.org/index.php/Be … ide#Locale for the guideline.
    (Thanks Arch for such a good documentation! I leave this post as I can imagine toher people making the same mistake as I did)

  • [solved]DWM apply systray patch

    [solved]I am trying to appply the systray6.1 patch to dwm. The "patch" goes fine but when I make I get the below errors:
        dwm build options:
        CFLAGS   = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=2     -DVERSION="6.1" -DXINERAMA
        LDFLAGS  = -s -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft
        CC       = cc
        CC drw.c
        CC dwm.c
        dwm.c: In function ‘clientmessage’:
        dwm.c:589:26: error: incompatible types when assigning to type ‘long unsigned int’ from type ‘XftColor’
        swa.background_pixel  = scheme[SchemeNorm].bg->rgb;
                              ^
        dwm.c: In function ‘updatesystray’:
        dwm.c:2221:18: error: incompatible type for argument 9 of ‘XCreateSimpleWindow’
       systray->win = XCreateSimpleWindow(dpy, root, x, m->by, w, bh, 0, 0, scheme[SchemeSel].bg->rgb);
                      ^
        In file included from dwm.c:36:0:
        /usr/include/X11/Xlib.h:1621:15: note: expected ‘long unsigned int’ but argument is of type ‘XftColor’
        extern Window XCreateSimpleWindow(
                   ^
        dwm.c:2224:24: error: incompatible types when assigning to type ‘long unsigned int’ from type ‘XftColor’
        wa.background_pixel  = scheme[SchemeNorm].bg->rgb;
                            ^
        dwm.c:2244:24: error: incompatible types when assigning to type ‘long unsigned int’ from type ‘XftColor’
        wa.background_pixel  = scheme[SchemeNorm].bg->rgb;
                            ^
        dwm.c:2263:2: error: incompatible type for argument 3 of ‘XSetForeground’
        XSetForeground(dpy, drw->gc, scheme[SchemeNorm].bg->rgb);
        ^
        In file included from dwm.c:36:0:
        /usr/include/X11/Xlib.h:3227:12: note: expected ‘long unsigned int’ but argument is of type ‘XftColor’
         extern int XSetForeground(
                ^
        Makefile:18: recipe for target 'dwm.o' failed
        make: *** [dwm.o] Error 1
    I haven't applied any other patches. Any idea what I am doing wrong? I can go into dwm.c and see the lines the error is refering to but I am not sure what the problem is.
    Thanks
    Last edited by derrickcope (2015-05-01 02:30:45)

    I just got the latest one off of the repo at git.suckless.org/dwm. the page says 6.0 but my config.mk says version 6.1. I did try the 6.0 version but the patch had errors. I am a little confused. The other patches come back with errors too. I am using an unpatched version at the moment so I would think most patches should work.
    What should I do?

  • [SOLVED] [dwm] Can't start dwm

    Hi!
    I've recently entered the world of tiling WM and started with dwm.
    Since I'm kinda insecure, and wanted to keep gnome as well, I've followed every single step in the wiki article and used the ~/.Xclients way, so I could start dwm from gdm (I've followed also the steps in the discussion page as well).
    Then, when I tried to startup dwm from gdm, it doesn't start, and goes back again to gdm.
    My ~/.Xclients file is the following:
    setxkbmap -layout pt
    #relogio
    while true; do
    xsetroot -name "$( date +"%F %R" )"
    sleep 1m # Update time every minute
    done &
    # #estado da bateria
    # while true; do
    # batt=$(LC_ALL=C acpi -b)
    # case $batt in
    # *Discharging*)
    # batt="${batt#* * * }"
    # batt="${batt%%, *} "
    # batt=""
    # esac
    # xsetroot -name "$batt$(date +%R)"
    # sleep 60
    # done &
    #conky bar
    conky | while read -r; do xsetroot -name "$REPLY"; done &
    #executar o dwm
    exec dwm
    It's all things copied from the wiki page, just for testing if everything was fine...
    My /usr/share/xsessions/dwm.desktop file is:
    [Desktop Entry]
    Encoding=UTF-8
    Name=Dwm
    Comment=Dynamic window manager
    Exec=/usr/local/bin/dwm
    Icon=dwm
    Type=XSession
    And I've created a /usr/share/xsessions/user.desktop file that looks like this:
    [Desktop Entry]
    Encoding=UTF-8
    Name=User XSession script
    Comment=Runs your ~./Xsession script
    Exec=/etc/X11/Xsession
    Type=Application
    Thanks in advance for any help, I've searched the forums and used google and couldn't find any answer to this problem :S
    Last edited by Aeriel (2011-09-01 17:19:02)

    haxit, thanks I've managed to solve the problem!
    I've installed SLiM and set up everything in .xinitrc.
    The dwm.desktop doesn't match with yours because I've changed somethings and because I didn't backup the file (I know, it's super dumb and stupid) I had to paste the defaults I found in the web.
    Thanks.
    Fellow gdm and dwm users, an advice, put everything in .xinitrc. It's easier.
    Last edited by Aeriel (2011-09-01 17:19:30)

  • Japanese characters display with wrong encoding all of a sudden...

    I had no issues before when it came to typing in Japanese in DW using the windows language bar , I would just change the keyboard to JP(japanese) and then start typing within DW code view, but then one day after doing updating my main template and using the find and replace feature in DW all the Japanese characters turned into question marks, diamonds with question marks and ASCII alphanumeric codes..
    also the spaces in my documents  turned into blocks. It was a mess,
    *I don't know if it was something I triggered accidentaly or if it was some type of bug....I also remember copying and pasting text and Japanese characters from another website that I created(but I had done that a dozen times before and it was never a problem).
    Long story short, after not being able to find a solution I decided to manually delete the weird symbols and start over, I typed in Japanese using the windows language bar as always and began typing away inside the same pages that displayed those weird characters (sorry I don't know what the proper name for them is)and it accepted the Japanese characters with no issues, it was working just like it did before.
    but my question is "What happened?" was that a bug in DW or was it something on my end?
    I would like to know so I can fix the problem incase this happens again.
    I've always had utf-8 as the charset and it's never been an issue. (and I all my pages are saved as utf-8 as well)
    --Which is why I am confused why all the Japanese got messed up.
    Here is the head code of one of the pages that had the problem:
    Thank you.

    Without seeing an actual page, it's impossible to say what happened, but the most likely explanation is that you did something wrong. Asian characters, such as Japanese, require correct encoding. If the encoding is incorrect, you end up with mojibake.
    I suspect that what happened is that you copied and pasted from Shift-JIS or EUC-JP encoding into a different encoding. It's quite possible that your page was set to iso-8859-1 (Western European) without realizing.
    By the way, your head code didn't show up in your post.

  • How to solve error essbase encoding ?

    Dear All,
    Today, I just wanted to load data into a demo database, however, I found that the load information of data load results is error encoding as below:
    ÕýÔÚ¶ÁÈ¡Êý¾Ý¿â [Demo] µÄ¹æÔò SQL ÐÅÏ¢
    ÕýÔÚ¶ÁÈ¡À´×ÔÊý¾Ý¿â [PLP] ¹æÔò¶ÔÏóµÄ¹æÔò
    ÆôÓÃÁ˲¢ÐÐÊý¾Ý¼ÓÔØ: [1] ¿é×¼±¸Ị̈߳¬¶ø [1] ¿éдÏ̡߳£
    ¼ÓÔØ´ËÊý¾ÝÎļþδÐÞ¸ÄÈκÎÊý¾ÝÖµ
    [LoadData.rul] µÄÊý¾Ý¼ÓÔؾ¹ýµÄʱ¼ä: [9.516] Ãë
    Êý¾Ý¿âµ¼ÈëÒÑÍê³É ['ZZTest'.'Demo']
    ÒÑ×¼±¸ºÃÊä³öÁÐ: [0]
    Of course, I modified the env variable ESSLANG from English_UnitedStates.Latin1@Binary to SimplifiedChinese_China.MS936@Binary. What a pity, it doesn't work.
    As you know, the Essbase Language was set to SimplifiedChinese_China.MS936@Binary when configuring.
    So, who knows how to solve it ?

    Open log with utf8 text editor
    u can remove chines localization if copy to bin files from C:\Hyperion\products\Essbase\EssbaseServer\localized\en\bin

  • [SOLVED] dwm + dzen2 + conky-cli misconfigured

    I have been trying to pipe conky status to dzen2 and it is doing my head in.
    My .xinitrc
    #!/bin/sh
    # ~/.xinitrc
    setxkbmap -option terminate:ctrl_alt_bksp &
    eval `cat ~/.fehbg` &
    numlockx &
    xscreensaver -no-splash &
    # Dzen & conky
    conky | dzen2 -fg '#dcdcdc' -bg '#3f3f3f' -ta r -fn '-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*' &
    # Start dwm
    exec ck-launch-session ~/Scripts/dwm-start
    .conkyrc
    background no
    out_to_console yes
    update_interval 2
    total_run_times 0
    use_spacer none
    double_buffer yes
    TEXT
    ${if_existing /sys/class/power_supply/BAT0/present}^fg(#999999)BAT^fg()${battery_percent}%${else}AC${endif} * CPU ${cpu cpu1}% RAM ${memperc}% * / ${fs_used_perc /}% /home ${fs_used_perc /home}% * PKG ${execpi 900 ~/Scripts/pacman-up.pl} * ${if_existing /proc/net/route ra0}Down ${downspeedf ra0}K/s Up ${upspeedf ra0}K/s ${else} ${if_existing /proc/net/route eth0} Down ${downspeedf ra0}K/s Up ${upspeedf ra0}K/s${endif} ${endif}* ${time %I:%M%P}
    Start dwm script
    conky | while read line; do
    xsetroot -name "$line";
    done | while true; do
    dwm > /dev/null; done;
    Could anyone point me at what I am doing wrong? I have tried following examples in the forums, including this one and this one -- but I either end up with dwm 5.7.2 in the corner, or conky prints out the ^fg etc...
    Any help would be appreciated at this point...
    Last edited by jasonwryan (2009-11-20 06:11:51)

    Thanks for the suggestions Skanky. The broken line in conky was a copy/paste error into the browser - it is a single line conky (I've edited the OP to reflect that).
    I think it is a problem with the way conky-cli and dzen work together. If I run:
    echo "testing" | dzen2 -fg '#dcdcdc' -bg '#3f3f3f' -ta r -fn '-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*' -p
    it prints as expected.
    Similarly, if I comment the conky | dzen2 line in .xinintrc and just run conky-cli from the start script it works...
    Trying to get then to work together, however, is another matter.
    /edit
    Some progress: it seems that it is being drawn - if I Mod-Shift-q the dwm status bar briefly disappears and I can see conky momentarily. I tried starting conky | dzen2 after dwm but that didn't work.
    I have also added some options, which seem to have helped, my .xinintrc entry now looks like:
    conky | dzen2 -x '500' -e '' -fg '#dcdcdc' -bg '#3f3f3f' -ta r -fn '-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*' -p &
    Last edited by jasonwryan (2009-11-19 16:57:13)

  • URLencoded UTF string returns in wrong encoding from JSP

    I have hit behavior that makes me rather unhappy and nothing in docs...
    1/ I fetch string in UTF-8, OK
    2/ I URLencode it, OK
    3/ I click on the link with data from steps 1/,2/, OK
    4/ I get the data and siplay it, encoding is wrong
    I'm running Tomcat4 and this ehaviour is a bit annoying.
    Please, if you know, what I can do with it, tell me, I read the
    some docs but found nothing.
    Thanks

    Encoding is wrong? Use the servlet's getEncoding() method to find out what encoding it used. There is no setEncoding() method until level 2.3 of the servlet specification, and your system is likely not using that. But there may be somewhere in the Tomcat configuration where you can specify the default encoding it should use.

  • DTR tool replicates with wrong encoding

    Hi all!
    I am trying to migrate an old NWDI (based on 7.00) to a new one (7.40). To get the existing tracks to the new NWDI I create the tracks at the new NWDI and copy the sources with the version history according to this link
    http://help.sap.com/saphelp_nw70/helpdata/en/46/5d032c1e661cbee10000000a11466f/frameset.htm
    I have migrated a lots of tracks successfully but now there is a track language specific signs (Umlaute) at the naming of the activities. Since I was not aware of that I just started the migration as always.
    But when I had a look at the sources I got some strange behaviours:
    - Of course the names of the activities were not correctly encoded
    - At the new repository all activities that delete folders are visible at the activities list but were not executed. The folders are still there but empty.
    - At the new repository there are some strange other activities, always named "equals_relation_creation_for_(...)"
    Now I have found out that file.encoding was configured wrongly at my Java VM. For a new try I need to remove the activities from the database.
    What I already tried:
    -  Delete the repositories and recreate these by removing the SC from the track, delete the repositories, re-adding the SC and restart the replication process.
    - Delete the repositories and tried to delete the activities from the database with the gc-command at the DTR tool. Unfortunately there are so many activities that have to be removed that the database says "too many cursors". I didnt find any way around this problem.
    - During the replication process there is this "-r" trigger at the replicate-command to resume a replication. I just removed the "-r" trigger but this did not work.
    Is there anyway to remove the activities one by one from the database (I would write script then)? The "bad" signs are not the worst problem but the existing empty folders. I hope that the other sources are correct.

    Hi Richard,
    I am not sure if you can remove the activities only but if you go into DTR as Web Folder you can delete objects. To delete any folder structure you have to take the inside out approach, i.e. delete all the contents of a folder in a certain level then only you can delete the folder.
    But first let a expert guide you with a better solution
    Thanks

  • [SOLVED] DWM+pertag+bstack error

    hi
    i'm trying to compile dwm with pertag diff patch and bstack.c
    i get an error while compiling it:
    CC dwm.c
    In file included from config.h:42,
    from dwm.c:254:
    bstack.c: En la función 'bstack':
    bstack.c:7: error: puntero deferenciado a tipo de dato incompletoº
    bstack.c:11:error:puntero..
    make: *** [dwm.o] Error 1
    ==> ERROR: Falló la compilación.ª
    Abortando...
    º means: dereference pointer to incomplete data type
    ª means: Compilation failed.
    it sucks 'cos i want to read pdf on top of my 10" screen and write documents at bottom, without the problem of change to another desktop and have to move to another layout, i.e., floating for gimp
    another thing: for write this post i must to write the code manually, 'cos a don't know how to copy from urxvt and paste it to firefox.. yep, that's a newbie question
    Edit: solved here
    Last edited by kismet010 (2010-02-08 05:51:09)

    Looks like this workaround isn't enough to get it to compile on the latest hg clone.
    dwm build options:
    CFLAGS = -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/include/X11 -DVERSION="5.8" -DXINERAMA
    LDFLAGS = -s -L/usr/lib -lc -L/usr/lib/X11 -lX11 -L/usr/lib/X11 -lXinerama
    CC = cc
    CC dwm.c
    dwm.c: In function 'gaplessgrid':
    dwm.c:262: error: dereferencing pointer to incomplete type
    dwm.c:276: error: dereferencing pointer to incomplete type
    dwm.c:276: error: dereferencing pointer to incomplete type
    dwm.c:279: error: dereferencing pointer to incomplete type
    dwm.c:282: error: dereferencing pointer to incomplete type
    dwm.c:282: error: dereferencing pointer to incomplete type
    dwm.c:283: error: dereferencing pointer to incomplete type
    dwm.c:284: error: dereferencing pointer to incomplete type
    make: *** [dwm.o] Error 1
    Line 262 for me is:
    for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next))
    I've tried many things and maybe i'm missing something very simple here.

  • [SOLVED] DWM - how do you apply patches with patch?

    I'm totally new to dwm (it's working great by the way) and patching. I'm having problems understanding how to use the patch program. The basic usage on dwm site says basically:
    patch -p1 < path/to/patch.diff
    Great, now I have the patch file ~/builds/dwn/patch/dwm-5.9-statuscolors.diff and my altered ~/builds/dwn/config.h. Here's what I did
    herman@sam ~/builds/dwm $ patch -p1 <patch/dwm-5.9-statuscolors.diff
    can't find file to patch at input line 4
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    |diff -up dwm-5.9/config.def.h dwm-5.9-colors/config.def.h
    |--- dwm-5.9/config.def.h 2011-07-10 16:24:25.000000000 -0400
    |+++ dwm-5.9-colors/config.def.h 2011-08-18 02:02:47.033830823 -0400
    File to patch: config.def.h
    config.def.h: No such file or directory
    Skip this patch? [y]
    Skipping patch.
    2 out of 2 hunks ignored
    can't find file to patch at input line 41
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    |Only in dwm-5.9: config.h
    |Only in dwm-5.9: dwm
    |diff -up dwm-5.9/dwm.c dwm-5.9-colors/dwm.c
    |--- dwm-5.9/dwm.c 2011-07-10 16:24:25.000000000 -0400
    |+++ dwm-5.9-colors/dwm.c 2011-08-18 02:07:20.788935100 -0400
    File to patch: dwm.c
    dwm.c: No such file or directory
    Skip this patch? [y]
    Skipping patch.
    12 out of 12 hunks ignored
    and it asks me for the filename it didn't find at line 4. Looking at the patch, I see it's a diff on config.def.h so I suppose this is the file to be patched and that I should supply this filename and the same with dwm.c? I'm not new to C coding but fresh out when it comes to diffing and patching, how do I actually go forward from here?
    Edit:
    More info  - I used the description using ABS to download the PKGBUILD for dwm and making dwm. My files
    herman@sam ~/builds/dwm $ ls -R
    PKGBUILD config.h dwm-5.9-2-x86_64.pkg.tar.xz dwm-5.9.tar.gz dwm.desktop dwm.install patch pkg src
    ./patch:
    dwm-5.9-statuscolors.diff
    ./pkg:
    usr
    ./pkg/usr:
    bin share
    ./pkg/usr/bin:
    dwm
    ./pkg/usr/share:
    doc licenses man xsessions
    ./pkg/usr/share/doc:
    dwm
    ./pkg/usr/share/doc/dwm:
    README
    ./pkg/usr/share/licenses:
    dwm
    ./pkg/usr/share/licenses/dwm:
    LICENSE
    ./pkg/usr/share/man:
    man1
    ./pkg/usr/share/man/man1:
    dwm.1.gz
    ./pkg/usr/share/xsessions:
    dwm.desktop
    ./src:
    config.h dwm-5.9 dwm-5.9.tar.gz dwm.desktop
    ./src/dwm-5.9:
    LICENSE Makefile README config.def.h config.def.h.orig config.def.h.rej config.h config.mk dwm dwm.1 dwm.c dwm.o
    Last edited by roygbiv (2011-12-06 20:37:40)

    Ok thanks but I'm confused again (I know..). I managed to patch the files config.def.h and dwm.c in the source dir and noticed there is yet another config.h file there as well. Now, the in the top level dir with the PKGBUILD I also have a config.h, which is the one I do my config changes. I'm confused because I now have these three header files (2x config.h + config.def.h) which are supposed to have the same source code? I've read around on the net, but haven't gotten any further answers yet. What are the purpose of each config and how should I use/update/manage them when recompiling? This is my situation:
    herman@sam ~/build/dwm $ tree .
    ├── PKGBUILD
    ├── config.h <----------------------------------------------------- this one
    ├── dwm-5.9-2-x86_64.pkg.tar.xz
    ├── dwm-5.9.tar.gz
    ├── dwm.desktop
    ├── dwm.install
    ├── pkg
    │   └── usr
    │   ├── bin
    │   │   └── dwm
    │   └── share
    │   ├── doc
    │   │   └── dwm
    │   │   └── README
    │   ├── licenses
    │   │   └── dwm
    │   │   └── LICENSE
    │   ├── man
    │   │   └── man1
    │   │   └── dwm.1.gz
    │   └── xsessions
    │   └── dwm.desktop
    └── src
    ├── config.h -> /home/herman/build/dwm/config.h
    ├── dwm-5.9
    │   ├── LICENSE
    │   ├── Makefile
    │   ├── README
    │   ├── config.def.h <-----------------------------------------------------this one
    │   ├── config.def.h.orig
    │   ├── config.h <----------------------------------------------------------this one
    │   ├── config.mk
    │   ├── dwm
    │   ├── dwm-5.9-statuscolors.diff
    │   ├── dwm.1
    │   ├── dwm.c
    │   ├── dwm.c.orig
    │   └── dwm.o
    ├── dwm-5.9.tar.gz -> /home/herman/build/dwm/dwm-5.9.tar.gz
    └── dwm.desktop -> /home/herman/build/dwm/dwm.desktop
    Thanks guys!
    Last edited by roygbiv (2011-12-06 20:06:10)

  • [SOLVED] dwm: cannot open mixer

    I've been setting up dwm through the last hours and I had an issue with sound playback. Firstly, I can play any sound from the console or any other wm. The problem appears when I start dwm by using xinit but loading it through gdm seems to solve the problem but still I'm not satisfied with that solution. I think that gdm do something in order to grant access to the sound card but on the other hand I still have another problem with multiple running applications that playback sound, only the first opened application can.
    After starting dwm with xinit I get "amixer: Mixer attach default error: No such file or directory" and by running alsamixer I get "cannot open mixer: No such file or directory".
    Thanks in advance
    Last edited by russo (2011-06-20 04:01:15)

    Well, I checked those posts.
    /dev/mixer exists
    I tried to load the snd-pcm-oss but nothing changed.
    However I noticed that I can run alsamixer as root. I'm not sure but maybe having to run gdm as root while running xinit as user made the difference but still it doesn't make sense since I can run openbox with xinit and everything works fine. I'll keep trying
    EDIT: Finally, I tried to load openbox through xinit and had the same problem. Next I tried to reboot removing gdm from the daemons and start dwm directly with the xinitrc options. Now it seems to work fine. Maybe gdm blocked the sound card once it opened.
    Last edited by russo (2011-06-20 04:00:56)

  • [SOLVED] dwm Compiling Error

    Hello,
    I am running dwm, and I love how simple and light it is. I edited my config.h few times and compiled it and it was fine. The last time I tried, it gave me an error. I could not figure that out. I tried to use a valid config.h from the internet in case I missed my config.h up, and I tried to re-install it. Nothing worked. This is the error that I get when I run the command makepkg -efi --noconfirm:
    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:288:0:
    config.h:18:19: error: ‘MAXTAGLEN’ undeclared here (not in a function)
    const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "w" };
    ^
    In file included from dwm.c:288:0:
    config.h: In function ‘focusstackf’:
    config.h:132:9: error: ‘sel’ undeclared (first use in this function)
    if(!sel)
    ^
    config.h:132:9: note: each undeclared identifier is reported only once for each function it appears in
    config.h:134:8: error: ‘lt’ undeclared (first use in this function)
    if(lt[sellt]->arrange) {
    ^
    config.h:134:11: error: ‘sellt’ undeclared (first use in this function)
    if(lt[sellt]->arrange) {
    ^
    config.h:138:25: error: ‘clients’ undeclared (first use in this function)
    for(c = clients; c && (!ISVISIBLE(c) || c->isfloating == sel->isfloating); c = c->next);
    ^
    config.h:152:9: error: too few arguments to function ‘restack’
    restack();
    ^
    dwm.c:213:13: note: declared here
    static void restack(Monitor *m);
    ^
    In file included from dwm.c:288:0:
    config.h: In function ‘setltor1’:
    config.h:162:16: error: ‘lt’ undeclared (first use in this function)
    setlayout((lt[sellt] == arg->v) ? &a : arg);
    ^
    config.h:162:19: error: ‘sellt’ undeclared (first use in this function)
    setlayout((lt[sellt] == arg->v) ? &a : arg);
    ^
    config.h: In function ‘toggletorall’:
    config.h:169:8: error: ‘sel’ undeclared (first use in this function)
    if(sel && ((arg->ui & TAGMASK) == sel->tags)) {
    ^
    config.h: In function ‘togglevorall’:
    config.h:181:8: error: ‘sel’ undeclared (first use in this function)
    if(sel && ((arg->ui & TAGMASK) == tagset[seltags])) {
    ^
    config.h:181:39: error: ‘tagset’ undeclared (first use in this function)
    if(sel && ((arg->ui & TAGMASK) == tagset[seltags])) {
    ^
    config.h:181:46: error: ‘seltags’ undeclared (first use in this function)
    if(sel && ((arg->ui & TAGMASK) == tagset[seltags])) {
    ^
    config.h: In function ‘vieworprev’:
    config.h:193:34: error: ‘tagset’ undeclared (first use in this function)
    view(((arg->ui & TAGMASK) == tagset[seltags]) ? &a : arg);
    ^
    config.h:193:41: error: ‘seltags’ undeclared (first use in this function)
    view(((arg->ui & TAGMASK) == tagset[seltags]) ? &a : arg);
    ^
    config.h: In function ‘warptosel’:
    config.h:200:8: error: ‘sel’ undeclared (first use in this function)
    if(sel)
    ^
    config.h: In function ‘zoomf’:
    config.h:208:8: error: ‘sel’ undeclared (first use in this function)
    if(sel && (lt[sellt]->arrange != tile || sel->isfloating))
    ^
    config.h:208:16: error: ‘lt’ undeclared (first use in this function)
    if(sel && (lt[sellt]->arrange != tile || sel->isfloating))
    ^
    config.h:208:19: error: ‘sellt’ undeclared (first use in this function)
    if(sel && (lt[sellt]->arrange != tile || sel->isfloating))
    ^
    config.h: At top level:
    config.h:213:2: error: expected identifier or ‘(’ before ‘{’ token
    { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
    ^
    config.h:213:78: error: expected identifier or ‘(’ before ‘,’ token
    { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
    ^
    config.h:214:78: error: expected identifier or ‘(’ before ‘,’ token
    { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
    ^
    config.h:215:78: error: expected identifier or ‘(’ before ‘,’ token
    { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
    ^
    config.h:216:78: error: expected identifier or ‘(’ before ‘,’ token
    { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
    ^
    config.h:222:145: warning: ISO C does not allow extra ‘;’ outside of a function [-Wpedantic]
    static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
    ^
    config.h:223:20: error: redefinition of ‘termcmd’
    static const char *termcmd[] = { "uxterm", NULL };
    ^
    config.h:63:20: note: previous definition of ‘termcmd’ was here
    static const char *termcmd[] = { "uxterm", NULL };
    ^
    config.h:225:12: error: redefinition of ‘keys’
    static Key keys[] = {
    ^
    config.h:65:12: note: previous definition of ‘keys’ was here
    static Key keys[] = {
    ^
    config.h:264:15: error: redefinition of ‘buttons’
    static Button buttons[] = {
    ^
    config.h:96:15: note: previous definition of ‘buttons’ was here
    static Button buttons[] = {
    ^
    dwm.c: In function ‘createmon’:
    dwm.c:654:15: error: ‘nmaster’ undeclared (first use in this function)
    m->nmaster = nmaster;
    ^
    dwm.c: In function ‘keypress’:
    dwm.c:1087:2: warning: ‘XKeycodeToKeysym’ is deprecated (declared at /usr/include/X11/Xlib.h:1695) [-Wdeprecated-declarations]
    keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
    ^
    In file included from dwm.c:288:0:
    dwm.c: At top level:
    config.h:15:13: warning: ‘readin’ defined but not used [-Wunused-variable]
    static Bool readin = True; /* False means do not read stdin */
    ^
    In file included from dwm.c:288:0:
    config.h:65:12: warning: ‘keys’ defined but not used [-Wunused-variable]
    static Key keys[] = {
    ^
    config.h:96:15: warning: ‘buttons’ defined but not used [-Wunused-variable]
    static Button buttons[] = {
    ^
    make: *** [dwm.o] Error 1
    ==> ERROR: A failure occurred in build().
    Aborting...
    And this is my config.h
    /* See LICENSE file for copyright and license details. */
    /* appearance */
    static const char font[] = "-*-terminus-bold-r-normal-*-14-*-*-*-*-*-*-*";
    static const char normbordercolor[] = "#cccccc";
    static const char normbgcolor[] = "#eeeeee";
    static const char normfgcolor[] = "#000000";
    static const char selbordercolor[] = "#0066ff";
    static const char selbgcolor[] = "#eeeeee";
    static const char selfgcolor[] = "#0066ff";
    static unsigned int borderpx = 3; /* border pixel of windows */
    static unsigned int snap = 32; /* snap pixel */
    static Bool showbar = True; /* False means no bar */
    static Bool topbar = True; /* False means bottom bar */
    static Bool readin = True; /* False means do not read stdin */
    /* tagging */
    const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "w" };
    static Rule rules[] = {
    /* class instance title tags mask isfloating monitor */
    { "acme", NULL, NULL, 1 << 2, False, -1 },
    { "Acroread", NULL, NULL, 0, True, -1 },
    { "Gimp", NULL, NULL, 0, True, -1 },
    { "GQview", NULL, NULL, 0, True, -1 },
    { "MPlayer", NULL, NULL, 0, True, -1 },
    { "Navigator", NULL, NULL, 1 << 5, False, -1 },
    /* layout(s) */
    static float mfact = 0.65;
    static Bool resizehints = False; /* False means respect size hints in tiled resizals */
    static Layout layouts[] = {
    /* symbol arrange function */
    { "[]=", tile }, /* first entry is default */
    { "< >", NULL }, /* no layout function means floating behavior */
    { "[ ]", monocle },
    /* custom functions declarations */
    static void focusstackf(const Arg *arg);
    static void setltor1(const Arg *arg);
    static void toggletorall(const Arg *arg);
    static void togglevorall(const Arg *arg);
    static void vieworprev(const Arg *arg);
    static void warptosel(const Arg *arg);
    static void zoomf(const Arg *arg);
    /* key definitions */
    #define MODKEY Mod1Mask
    #define TAGKEYS(KEY,TAG) \
    { MODKEY, KEY, vieworprev, {.ui = 1 << TAG} }, \
    { MODKEY|ControlMask, KEY, togglevorall, {.ui = 1 << TAG} }, \
    { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
    { MODKEY|ControlMask|ShiftMask, KEY, toggletorall, {.ui = 1 << TAG} },
    /* helper for spawning shell commands in the pre dwm-5.0 fashion */
    #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
    /* commands */
    static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
    static const char *termcmd[] = { "uxterm", NULL };
    static Key keys[] = {
    /* modifier key function argument */
    { MODKEY, XK_p, spawn, {.v = dmenucmd } },
    { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
    { MODKEY, XK_b, togglebar, {0} },
    { MODKEY, XK_j, focusstackf, {.i = +1 } },
    { MODKEY, XK_j, warptosel, {0} },
    { MODKEY, XK_k, focusstackf, {.i = -1 } },
    { MODKEY, XK_k, warptosel, {0} },
    { MODKEY, XK_h, setmfact, {.f = -0.05} },
    { MODKEY, XK_l, setmfact, {.f = +0.05} },
    { MODKEY, XK_Return, zoomf, {0} },
    { MODKEY, XK_Return, warptosel, {0} },
    { MODKEY, XK_Tab, view, {0} },
    { MODKEY|ShiftMask, XK_c, killclient, {0} },
    { MODKEY, XK_space, setltor1, {.v = &layouts[0]} },
    { MODKEY|ShiftMask, XK_space, setltor1, {.v = &layouts[2]} },
    { MODKEY, XK_0, vieworprev, {.ui = ~0 } },
    { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
    TAGKEYS( XK_1, 0)
    TAGKEYS( XK_2, 1)
    TAGKEYS( XK_3, 2)
    TAGKEYS( XK_4, 3)
    TAGKEYS( XK_5, 4)
    TAGKEYS( XK_w, 5)
    { MODKEY|ShiftMask, XK_q, quit, {0} },
    /* button definitions */
    /* click can ClkTagBar, ClkTagButton,
    * ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    static Button buttons[] = {
    /* click event mask button function argument */
    { ClkLtSymbol, 0, Button1, setltor1, {.v = &layouts[0]} },
    { ClkLtSymbol, 0, Button2, setmfact, {.f = 1.65} },
    { ClkLtSymbol, 0, Button3, setltor1, {.v = &layouts[2]} },
    { ClkLtSymbol, 0, Button4, setmfact, {.f = +0.05} },
    { ClkLtSymbol, 0, Button5, setmfact, {.f = -0.05} },
    { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
    { ClkStatusText, Button3Mask, Button1, killclient, {0} },
    { ClkWinTitle, 0, Button1, warptosel, {0} },
    { ClkWinTitle, 0, Button1, movemouse, {0} },
    { ClkWinTitle, 0, Button2, zoomf, {0} },
    { ClkWinTitle, 0, Button3, resizemouse, {0} },
    { ClkWinTitle, 0, Button4, focusstackf, {.i = -1 } },
    { ClkWinTitle, 0, Button5, focusstackf, {.i = +1 } },
    { ClkRootWin, 0, Button1, warptosel, {0} },
    { ClkRootWin, 0, Button1, movemouse, {0} },
    { ClkRootWin, 0, Button3, resizemouse, {0} },
    { ClkRootWin, 0, Button4, focusstackf, {.i = -1 } },
    { ClkRootWin, 0, Button5, focusstackf, {.i = +1 } },
    { ClkClientWin, MODKEY, Button1, movemouse, {0} },
    { ClkClientWin, MODKEY, Button2, zoomf, {0} },
    { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
    { ClkTagBar, 0, Button1, vieworprev, {0} },
    { ClkTagBar, 0, Button3, togglevorall, {0} },
    { ClkTagBar, 0, Button4, focusstackf, {.i = -1 } },
    { ClkTagBar, 0, Button5, focusstackf, {.i = +1 } },
    { ClkTagBar, Button2Mask, Button1, tag, {0} },
    { ClkTagBar, Button2Mask, Button3, toggletorall, {0} },
    /* custom functions */
    void
    focusstackf(const Arg *arg) {
    Client *c = NULL, *i;
    if(!sel)
    return;
    if(lt[sellt]->arrange) {
    if (arg->i > 0) {
    for(c = sel->next; c && (!ISVISIBLE(c) || c->isfloating != sel->isfloating); c = c->next);
    if(!c)
    for(c = clients; c && (!ISVISIBLE(c) || c->isfloating == sel->isfloating); c = c->next);
    else {
    for(i = clients; i != sel; i = i->next)
    if(ISVISIBLE(i) && i->isfloating == sel->isfloating)
    c = i;
    if(!c)
    for(i = sel; i; i = i->next)
    if(ISVISIBLE(i) && i->isfloating != sel->isfloating)
    c = i;
    if(c) {
    focus(c);
    restack();
    else
    focusstack(arg);
    void
    setltor1(const Arg *arg) {
    Arg a = {.v = &layouts[1]};
    setlayout((lt[sellt] == arg->v) ? &a : arg);
    void
    toggletorall(const Arg *arg) {
    Arg a;
    if(sel && ((arg->ui & TAGMASK) == sel->tags)) {
    a.ui = ~0;
    tag(&a);
    else
    toggletag(arg);
    void
    togglevorall(const Arg *arg) {
    Arg a;
    if(sel && ((arg->ui & TAGMASK) == tagset[seltags])) {
    a.ui = ~0;
    view(&a);
    else
    toggleview(arg);
    void
    vieworprev(const Arg *arg) {
    Arg a = {0};
    view(((arg->ui & TAGMASK) == tagset[seltags]) ? &a : arg);
    void
    warptosel(const Arg *arg) {
    XEvent ev;
    if(sel)
    XWarpPointer(dpy, None, sel->win, 0, 0, 0, 0, 0, 0);
    XSync(dpy, False);
    while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
    void
    zoomf(const Arg *arg) {
    if(sel && (lt[sellt]->arrange != tile || sel->isfloating))
    togglefloating(NULL);
    else
    zoom(NULL);
    { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
    { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
    { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
    { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
    /* helper for spawning shell commands in the pre dwm-5.0 fashion */
    #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
    /* commands */
    static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
    static const char *termcmd[] = { "uxterm", NULL };
    static Key keys[] = {
    /* modifier key function argument */
    { MODKEY, XK_p, spawn, {.v = dmenucmd } },
    { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
    { MODKEY, XK_b, togglebar, {0} },
    { MODKEY, XK_j, focusstack, {.i = +1 } },
    { MODKEY, XK_k, focusstack, {.i = -1 } },
    { MODKEY, XK_i, incnmaster, {.i = +1 } },
    { MODKEY, XK_d, incnmaster, {.i = -1 } },
    { MODKEY, XK_h, setmfact, {.f = -0.05} },
    { MODKEY, XK_l, setmfact, {.f = +0.05} },
    { MODKEY, XK_Return, zoom, {0} },
    { MODKEY, XK_Tab, view, {0} },
    { MODKEY|ShiftMask, XK_c, killclient, {0} },
    { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
    { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
    { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
    { MODKEY, XK_space, setlayout, {0} },
    { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
    { MODKEY, XK_0, view, {.ui = ~0 } },
    { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
    { MODKEY, XK_comma, focusmon, {.i = -1 } },
    { MODKEY, XK_period, focusmon, {.i = +1 } },
    { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
    { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
    TAGKEYS( XK_1, 0)
    TAGKEYS( XK_2, 1)
    TAGKEYS( XK_3, 2)
    TAGKEYS( XK_4, 3)
    TAGKEYS( XK_5, 4)
    TAGKEYS( XK_6, 5)
    TAGKEYS( XK_7, 6)
    TAGKEYS( XK_8, 7)
    TAGKEYS( XK_9, 8)
    { MODKEY|ShiftMask, XK_q, quit, {0} },
    /* button definitions */
    /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    static Button buttons[] = {
    /* click event mask button function argument */
    { ClkLtSymbol, 0, Button1, setlayout, {0} },
    { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
    { ClkWinTitle, 0, Button2, zoom, {0} },
    { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
    { ClkClientWin, MODKEY, Button1, movemouse, {0} },
    { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
    { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
    { ClkTagBar, 0, Button1, view, {0} },
    { ClkTagBar, 0, Button3, toggleview, {0} },
    { ClkTagBar, MODKEY, Button1, tag, {0} },
    { ClkTagBar, MODKEY, Button3, toggletag, {0} },
    Any suggestions?
    Last edited by husainaloos (2013-05-07 16:31:16)

    No, you were not missing "some graphical libraries that you didn't incluce in the config.h file". It looks like, as jasonwryan said, you copied functions into your config.h without checking how they work. Thus, you ended up having functions that use variables you never define in config.h (and there's alot of those!)
    Next time, either stick to already working patches found at suckless.org, or give some effort and at least try to figure out what is wrong with the code you randomly copied.

  • [SOLVED]dwm warning: 'XKeycodeToKeysym' is deprecated

    While compiling dwm using PKGBUILD i am getting this warning any work around please.
    ==> 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 -I/usr/include/freetype2
    LDFLAGS = -s -L/usr/lib -lc -L/usr/lib/X11 -lX11 -L/usr/lib/X11 -lXinerama -lXft -lfreetype
    CC = cc
    CC dwm.c
    dwm.c: In function 'keypress':
    dwm.c:1087:2: warning: 'XKeycodeToKeysym' is deprecated (declared at /usr/include/X11/Xlib.h:1699) [-Wdeprecated-declarations]
    keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
    ^
    CC -o dwm
    ==> Entering fakeroot environment...
    ==> Starting package()...
    dwm build options:
    CFLAGS = -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/X11R6/include -D_FORTIFY_SOURCE=2 -DVERSION="6.0" -DXINERAMA -I/usr/include/freetype2
    LDFLAGS = -s -L/usr/lib -lc -L/usr/X11R6/lib -lX11 -L/usr/X11R6/lib -lXinerama -lXft -lfreetype
    Last edited by arcon (2013-06-09 14:25:15)

    Vain wrote:
    It's harmless. In fact, upstream simply muted the warning:
    http://git.suckless.org/dwm/commit/?id= … 0b433ce552
    Thanks Vain
    Trilby wrote:If you want to be proactive, you can patch to replace it with XKbKeycodeToKeysym which is what is has been deprecated in favor of.  Be sure then that X11/XKBlib.h is included.
    Thanks a lot Trilby, patch did work.
    And it was awesome because it was my first patch, but the thing is i didn't quite understand what this is saying https://wiki.archlinux.org/index.php/Patching_in_ABSin creating patches section.
    i just placed
    patch -Np1 -i dwm.diff
    in PKGBUID and it did work  but what i didn't understand, is that
    i created two dir one with dwm.old and dwm.new and i through commandline patched
    patch -i dwm.diff
    dwm.c
    Now, when i did
    diff -aur dwm.old dwm.new
    it is giving me weird stuff like:
    WSì@h}¼ó«}¼ÇE¼ÇEäÇEìÛtn°kPWh
    +ÝØÝØëÝØÝØÒt +uÔ+,0ÀEÌð÷}Ì)Ö4ÀEÌÈ÷}Ì)ÑEÐuÔ9ÆLðD,9ÁLÈ8Àt9ÆOð<Àt9ÁOÈ;u-EØ;
    u";³u▒;uë)+uÔ1Ò+,é´þÿÿM
    MØúÄ(Ø[^_]éÈüÿÿÄ([^_]ÃU1ÒåWVSì
    CXÀt!tq@L±H#PlùÚÿëÛÒtPPRhjjjSèüÿÿÿÄ CXèêøÿÿÆöt3kHþWK4S0j{<ÇWC8Pðèæüÿÿlè¸øÿÿÄÆëÉeô[^_]ÃUåWVSì<GXèøÿÿÇEÌÃÀtlè}øÿÿÿEÌëìMÌÉ#G9Áv3ÀÇEÔt.ÛG8Ù]äÙEäØOÙ}âfEâÌ
    fEàÙmàß}ØÙmâEØëG8EÔÇEÄÇEÈÇEÐÛÆWG09UгHO4EÀsKkÆþuÈE¼ñPjG<)ðuÌ9ÖFÖÖ1Ò+uÐ÷öu¼UÀðuÔPØVèäûÿÿHÀEÈëLPEÀEÔjUÄköþEÀG<Ñ)ÐUÌ+UÐU¼1Ò÷u¼UÀðPØw8+uÔVèûÿÿHÀEÄlÄèT÷ÿÿÿEÐÃé2ÿÿÿeô[^_]ÃUåì$MðQMìQQRPEôPPÿ5`ÿ5°èüÿÿÿÉÃUåPPShèøÿÿEì]üÉÃU¹å1ÀWSì@h}¼ó«}¼ÇE¼ÇEäÇEìÛtn°kPWh
    ÿp(jÿp$jÿ5øÿs8ÿsÿs0ÿ5`RèüÿÿÿÄ,Chÿ5´Pÿ5°èüÿÿÿXZÿshÿ5°èüÿÿÿ[dÄëeø[_]ÃUùåVÆSÓRÀàüÿÿ5ÿ5°èüÿÿÿ¡¹ ÄÀ÷ùöt+@SPP¡p@P¡l@Pÿ5ÿ5ÿ5°èüÿÿÿë,Ût+QPP¡p@P¡l@Pÿ5ÿ5ÿ5°èüÿÿÿÄ eø[^]ÃUåVÆSSSÿ°xÿ5°èüÿÿÿÄÀÃtf¡d;p\u"öÄtäþQSÿ¶xÿ5°èüÿÿÿÄë
    Áà\öt1À{À`ë
    -Ç`ì
    I don't know what it is, Please if you tell me what i am doing wrong.

Maybe you are looking for