You are not logged in.

#1 2007-02-21 23:07:12

SleepingGiant08
Member
From: Ellicott City, MD USA
Registered: 2007-01-10
Posts: 124

dwm config

I was inspired by these forums to try out dwm, and it's really sweet...much better than wmii IMO. Just wondering if you all could me some tips and/or share your configs or whatever.

My setup is pretty lame right now, pretty much the same as a fresh install with some key bindings for urxvt and swiftfox.

I really want to change the appearance: fonts, colors, and stuff; don't really know what the options are under the appearance setting, being the "noob" that I am.

Also, on a different note I was wondering where I can find out more about .Xdefaults. I really want to config them, but I don't know where to start. I see all the awesome looking fonts and colors and stuff, and I say to my self Wow          ...whatever.

Thanks a lot,

Julian


Registered Linux User #439761

Offline

#2 2007-02-22 00:36:03

Sigi
Member
From: Thurgau, Switzerland
Registered: 2005-09-22
Posts: 1,131

Re: dwm config

My dwm config.h, nothing fancy ;-)

/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
 * See LICENSE file for license details.
 */

#define TAGS \
const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };

#define BORDERPX        0
#define DEFMODE            dotile        /* dofloat */
#define TOPBAR            True        /* False */
#define FLOATSYMBOL        "><>"
#define TILESYMBOL        "[]="

#define FONT                    "-*-tahoma-*-*-*-*-13-*-*-*-*-*-*-*"
#define NORMBORDERCOLOR        "#000000"
#define NORMBGCOLOR        "#eeeeee"
#define NORMFGCOLOR        "#222222"
#define SELBORDERCOLOR        "#aaaaff"
#define SELBGCOLOR        "#aaaaff"
#define SELFGCOLOR        "#ffffff"

#define MASTER            600        /* per thousand */
#define MODKEY            Mod1Mask
#define NMASTER            1        /* clients in master area */
#define SNAP            20        /* pixel */

#define KEYS \
static Key key[] = { \
    /* modifier            key        function    argument */ \
        { ControlMask,                  XK_1,           spawn,          { .cmd = "exec gmrun" } }, \
        { ControlMask,                  XK_2,           spawn,          { .cmd = "exec urxvt --scrollBar_right +sb -tr -tint white -sh 25 -fade 15" } }, \
        { ControlMask,                  XK_3,           spawn,          { .cmd = "exec rox" } }, \
        { ControlMask,                  XK_4,           spawn,          { .cmd = "exec firefox" } }, \
        { ControlMask,                  XK_5,           spawn,          { .cmd = "exec thunderbird" } }, \
        { ControlMask,                  XK_6,           spawn,          { .cmd = "exec urxvt --scrollBar_right +sb -tr -tint white -sh 30 -e ncmpc" } }, \
        { ControlMask,                  XK_7,           spawn,          { .cmd = "exec gtk-gnutella" } }, \
        { ControlMask,                  XK_8,           spawn,          { .cmd = "exec transmission-gtk" } }, \
        { ControlMask,                  XK_9,           spawn,          { .cmd = "exec alsactl restore ~/.asound.micoff" } }, \
        { ControlMask,                  XK_0,           spawn,          { .cmd = "exec alsactl restore ~/.asound.micon" } }, \
        { MODKEY|ControlMask,           XK_c,           spawn,          { .cmd = "bash /home/sigi/sonstiges/scripte/mpctoggle.sh" } }, \
        { MODKEY|ControlMask,           XK_x,           spawn,          { .cmd = "mpc next" } }, \
        { MODKEY|ControlMask,           XK_y,           spawn,          { .cmd = "mpc prev" } }, \
        { MODKEY|ControlMask,           XK_q,           spawn,          { .cmd = "mpc volume +1" } }, \
        { MODKEY|ControlMask,           XK_a,           spawn,          { .cmd = "mpc volume -1" } }, \
        { MODKEY|ControlMask,           XK_w,           spawn,          { .cmd = "bash /home/sigi/sonstiges/scripte/mpcupdate.sh" } }, \
        { MODKEY,                       XK_Print,       spawn,          { .cmd = "bash /home/sigi/sonstiges/scripte/screenshot.sh" } }, \
    { MODKEY|ShiftMask,        XK_Return,    spawn,        { .cmd = "exec urxvt --scrollBar_right +sb -tr -tint white -sh 25 -fade 15" } }, \
    { MODKEY,            XK_Tab,        focusnext,    { 0 } }, \
    { MODKEY|ShiftMask,        XK_Tab,        focusprev,    { 0 } }, \
    { MODKEY,            XK_Return,    zoom,        { 0 } }, \
    { MODKEY,            XK_g,        resizemaster,    { .i = 10 } }, \
    { MODKEY,            XK_s,        resizemaster,    { .i = -10 } }, \
    { MODKEY,            XK_i,        incnmaster,    { .i = 1 } }, \
    { MODKEY,            XK_d,        incnmaster,    { .i = -1 } }, \
    { MODKEY|ShiftMask,        XK_0,        tag,        { .i = -1 } }, \
    { MODKEY|ShiftMask,        XK_1,        tag,        { .i = 0 } }, \
    { MODKEY|ShiftMask,        XK_2,        tag,        { .i = 1 } }, \
    { MODKEY|ShiftMask,        XK_3,        tag,        { .i = 2 } }, \
    { MODKEY|ShiftMask,        XK_4,        tag,        { .i = 3 } }, \
    { MODKEY|ShiftMask,        XK_5,        tag,        { .i = 4 } }, \
    { MODKEY|ShiftMask,        XK_6,        tag,        { .i = 5 } }, \
    { MODKEY|ShiftMask,        XK_7,        tag,        { .i = 6 } }, \
    { MODKEY|ShiftMask,        XK_8,        tag,        { .i = 7 } }, \
    { MODKEY|ShiftMask,        XK_9,        tag,        { .i = 8 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_1,        toggletag,    { .i = 0 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_2,        toggletag,    { .i = 1 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_3,        toggletag,    { .i = 2 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_4,        toggletag,    { .i = 3 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_5,        toggletag,    { .i = 4 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_6,        toggletag,    { .i = 5 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_7,        toggletag,    { .i = 6 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_8,        toggletag,    { .i = 7 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_9,        toggletag,    { .i = 8 } }, \
        { MODKEY,                       XK_F4,          killclient,     { 0 } }, \
    { MODKEY|ShiftMask,        XK_c,        killclient,    { 0 } }, \
    { MODKEY,            XK_space,    togglemode,    { 0 } }, \
    { MODKEY|ShiftMask,        XK_space,    togglefloat,    { 0 } }, \
    { MODKEY,            XK_0,        view,        { .i = -1 } }, \
    { MODKEY,            XK_1,        view,        { .i = 0 } }, \
    { MODKEY,            XK_2,        view,        { .i = 1 } }, \
    { MODKEY,            XK_3,        view,        { .i = 2 } }, \
    { MODKEY,            XK_4,        view,        { .i = 3 } }, \
    { MODKEY,            XK_5,        view,        { .i = 4 } }, \
    { MODKEY,            XK_6,        view,        { .i = 5 } }, \
    { MODKEY,            XK_7,        view,        { .i = 6 } }, \
    { MODKEY,            XK_8,        view,        { .i = 7 } }, \
    { MODKEY,            XK_9,        view,        { .i = 8 } }, \
    { MODKEY|ControlMask,        XK_1,        toggleview,    { .i = 0 } }, \
    { MODKEY|ControlMask,        XK_2,        toggleview,    { .i = 1 } }, \
    { MODKEY|ControlMask,        XK_3,        toggleview,    { .i = 2 } }, \
    { MODKEY|ControlMask,        XK_4,        toggleview,    { .i = 3 } }, \
    { MODKEY|ControlMask,        XK_5,        toggleview,    { .i = 4 } }, \
    { MODKEY|ControlMask,        XK_6,        toggleview,    { .i = 5 } }, \
    { MODKEY|ControlMask,        XK_7,        toggleview,    { .i = 6 } }, \
    { MODKEY|ControlMask,        XK_8,        toggleview,    { .i = 7 } }, \
    { MODKEY|ControlMask,        XK_9,        toggleview,    { .i = 8 } }, \
    { MODKEY|ShiftMask,        XK_q,        quit,        { 0 } }, \
};

/* Query class:instance:title for regex matching info with following command:
 * xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */
#define RULES \
static Rule rule[] = { \
    /* class:instance:title regex    tags regex    isfloat */ \
    { "Gimp.*",            NULL,        True }, \
        { "Firefox.*",                  NULL,           False }, \
        { "Rox.*",                      NULL,           True }, \
        { "Verschieben",                NULL,           True }, \
        { "Löschen",                    NULL,           True }, \
        { "Kopieren",                   NULL,           True }, \
        { "Erzeugen",                   NULL,           True }, \
        { "Umbenennen",                 NULL,           True }, \
        { "xine.*",                     NULL,           True }, \
};

Cheers Sigi


Haven't been here in a while. Still rocking Arch. smile

Offline

#3 2007-02-22 05:47:06

tizoc
Member
Registered: 2006-07-28
Posts: 57

Re: dwm config

I'm started using dwm recently. I compiled it with the bottom stack patch
My config.h (mod key changed to the "win key"):

 /* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
 * See LICENSE file for license details.
 */

#define TAGS \
const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };

#define TITLES            /* comment out to remove titles */
#define BORDERPX        2
#define DEFMODE            dotile        /* dofloat */
#define FLOATSYMBOL        "OO"
/*#define TILESYMBOL        "[]="*/
#define DFLTSTACKPOS        StackRight /* StackLeft StackBotPortrait StackBotLandscape */
#define _TILESYMBOL_ const char *TILESYMBOL[] = { "]=", "=[", "TT", "==", NULL };

#define FONT            "-*-terminus-medium-r-normal-*-12-*-*-*-*-*-*-*"

#define NORMBORDERCOLOR        "#333"
#define NORMBGCOLOR        "#222"
#define NORMFGCOLOR        "#ccc"
#define SELBORDERCOLOR        "#9cf"
#define SELBGCOLOR        "#555"
#define SELFGCOLOR        "#fff"

#define MASTER            600        /* per thousand */
#define MODKEY            Mod4Mask
#define NMASTER            1        /* clients in master area */
#define SNAP            20        /* pixel */
#define TOPBAR            True        /* False */

#define KEYS \
static Key key[] = { \
    /* modifier            key        function    argument */ \
    { MODKEY|ShiftMask,        XK_Return,    spawn,        { .cmd = "exec mrxvt" } }, \
    { MODKEY,            XK_p,        spawn,         { .cmd = "exec ~/.dmenu/runapp.sh" } }, \
    { MODKEY,            XK_KP_Begin,    spawn,         { .cmd = "exec cmus-remote -u" } }, \
    { MODKEY,            XK_KP_Left,    spawn,         { .cmd = "exec cmus-remote -r" } }, \
    { MODKEY,            XK_KP_Right,    spawn,         { .cmd = "exec cmus-remote -n" } }, \
    { MODKEY,            XK_Tab,        focusnext,    { 0 } }, \
    { MODKEY|ShiftMask,        XK_Tab,        focusprev,    { 0 } }, \
    { MODKEY,            XK_Return,    zoom,        { 0 } }, \
    { MODKEY,            XK_g,        resizemaster,    { .i = 15 } }, \
    { MODKEY,            XK_s,        resizemaster,    { .i = -15 } }, \
    { MODKEY,            XK_i,        incnmaster,    { .i = 1 } }, \
    { MODKEY,            XK_d,        incnmaster,    { .i = -1 } }, \
    { MODKEY|ShiftMask,        XK_0,        tag,        { .i = -1 } }, \
    { MODKEY|ShiftMask,        XK_1,        tag,        { .i = 0 } }, \
    { MODKEY|ShiftMask,        XK_2,        tag,        { .i = 1 } }, \
    { MODKEY|ShiftMask,        XK_3,        tag,        { .i = 2 } }, \
    { MODKEY|ShiftMask,        XK_4,        tag,        { .i = 3 } }, \
    { MODKEY|ShiftMask,        XK_5,        tag,        { .i = 4 } }, \
    { MODKEY|ShiftMask,        XK_6,        tag,        { .i = 5 } }, \
    { MODKEY|ShiftMask,        XK_7,        tag,        { .i = 6 } }, \
    { MODKEY|ShiftMask,        XK_8,        tag,        { .i = 7 } }, \
    { MODKEY|ShiftMask,        XK_9,        tag,        { .i = 8 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_1,        toggletag,    { .i = 0 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_2,        toggletag,    { .i = 1 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_3,        toggletag,    { .i = 2 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_4,        toggletag,    { .i = 3 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_5,        toggletag,    { .i = 4 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_6,        toggletag,    { .i = 5 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_7,        toggletag,    { .i = 6 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_8,        toggletag,    { .i = 7 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_9,        toggletag,    { .i = 8 } }, \
    { MODKEY|ShiftMask,        XK_c,        killclient,    { 0 } }, \
    { MODKEY,            XK_w,        togglestackpos,    { 0 } }, \
    { MODKEY|ShiftMask,        XK_w,        togglestacklayout,    { 0 } }, \
    { MODKEY,            XK_space,    togglemode,    { 0 } }, \
    { MODKEY|ShiftMask,        XK_space,    togglefloat,    { 0 } }, \
    { MODKEY,            XK_0,        view,        { .i = -1 } }, \
    { MODKEY,            XK_1,        view,        { .i = 0 } }, \
    { MODKEY,            XK_2,        view,        { .i = 1 } }, \
    { MODKEY,            XK_3,        view,        { .i = 2 } }, \
    { MODKEY,            XK_4,        view,        { .i = 3 } }, \
    { MODKEY,            XK_5,        view,        { .i = 4 } }, \
    { MODKEY,            XK_6,        view,        { .i = 5 } }, \
    { MODKEY,            XK_7,        view,        { .i = 6 } }, \
    { MODKEY,            XK_8,        view,        { .i = 7 } }, \
    { MODKEY,            XK_9,        view,        { .i = 8 } }, \
    { MODKEY|ControlMask,        XK_1,        toggleview,    { .i = 0 } }, \
    { MODKEY|ControlMask,        XK_2,        toggleview,    { .i = 1 } }, \
    { MODKEY|ControlMask,        XK_3,        toggleview,    { .i = 2 } }, \
    { MODKEY|ControlMask,        XK_4,        toggleview,    { .i = 3 } }, \
    { MODKEY|ControlMask,        XK_5,        toggleview,    { .i = 4 } }, \
    { MODKEY|ControlMask,        XK_6,        toggleview,    { .i = 5 } }, \
    { MODKEY|ControlMask,        XK_7,        toggleview,    { .i = 6 } }, \
    { MODKEY|ControlMask,        XK_8,        toggleview,    { .i = 7 } }, \
    { MODKEY|ControlMask,        XK_9,        toggleview,    { .i = 8 } }, \
    { MODKEY|ShiftMask,        XK_q,        quit,        { 0 } }, \
};

/* Query class:instance:title for regex matching info with following command:
 * xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */
#define RULES \
static Rule rule[] = { \
    /* class:instance:title regex    tags regex    isfloat */ \
    { "Gimp",            NULL,        True }, \
    { "Firefox",            NULL,        False}, \
    { "Firefox-bin:.*(Bookmarks|Downloads)", NULL,    True }, \
    { "MPlayer",            NULL,        True }, \
    { "Acroread",            NULL,        True }, \
};

my runapp.sh

#!/bin/sh

. ~/.dmenu/config

exe="$(lsx `echo $PATH | sed 's/:/ /g'` | sort -u | $DMENU)"

exec $exe

My .dmenu/config

FONT="-*-terminus-medium-r-normal-*-12-*-*-*-*-*-*-*"
NORMBGCOLOR="#222"
NORMFGCOLOR="#ccc"
SELBGCOLOR="#555"
SELFGCOLOR="#fff"

DMENU="dmenu -b -fn $FONT -nb $NORMBGCOLOR -nf $NORMFGCOLOR -sb $SELBGCOLOR -sf $SELFGCOLOR"

And the script I use to run dwm, so I can replace the binary and rerun without quiting X and closing the programs I'm running (I made it 15 minutes ago, and haven't tested it yet). I'm going to rebuild dwm and bind a key (WIN+Ctrl+q I guess), so it does a "touch ~/dwm/keeprunning" and then quits dwm, my scripts checks for the existence of that file, and if it exists, it reruns dwm using the newer executable.

!/bin/sh

DWM="${HOME}/dwm/dwm"
RUNNINGDWM="${HOME}/dwm/dwm.run"
KEEPRUNING="${HOME}/dwm/keeprunning"

function rundwm
{
    rm -f "$KEEPRUNING"
    /bin/cp -f "$DWM" "$RUNNINGDWM"
    exec "$RUNNINGDWM"
}

rundwm

while [ -e "$KREEPRUNING" ]; do
    rundwm
done

Edit: well... this last script doesn't work, I'm not a bash expert, and I don't really know how X manages its sessions, if anyone knows how to archieve what I want, tell me how please tongue

Last edited by tizoc (2007-02-22 07:19:58)

Offline

#4 2007-02-22 14:30:00

Stalwart
Member
From: Latvia, Riga
Registered: 2005-10-18
Posts: 445
Website

Re: dwm config

#include <X11/XF86keysym.h> /* makes XF86* keys work */

#define TAGS \
const char *tags[] = { "chat", "www", "3", "4", "5", "6", "7", "8", "trans", NULL };

#define TOPBAR                  True            /* False */
#define BORDERPX        1
#define DEFMODE            dotile        /* dofloat */
#define FLOATSYMBOL        "~"
#define TILESYMBOL        " "

#define FONT            "-*-terminus-medium-*-*-*-12-*-*-*-*-*-iso10646-*"
#define NORMBORDERCOLOR        "#2e3436"
#define NORMBGCOLOR        "#2e3436"
#define NORMFGCOLOR        "#d3d7cf"
#define SELBORDERCOLOR        "#d3d7cf"
#define SELBGCOLOR        "#555753"
#define SELFGCOLOR        "#d3d7cf"

#define MASTER            800        /* per thousand */
#define MODKEY            Mod4Mask
#define NMASTER            2        /* clients in master area */
#define SNAP            20        /* pixel */

#define KEYS \
static Key key[] = { \
    /* modifier            key        function    argument */ \
    { MODKEY,            XK_Return,    spawn,        { .cmd = "exec urxvtc" } }, \
    { MODKEY,            XK_f,        spawn,        { .cmd = "exec opera" } }, \
    { MODKEY|ShiftMask,        XK_f,        spawn,        { .cmd = "exec firefox" } }, \
    { MODKEY,            XK_o,        spawn,        { .cmd = "exec soffice" } }, \
    { MODKEY,            XK_g,        spawn,        { .cmd = "exec gimp" } }, \
    { MODKEY,            XK_t,        spawn,        { .cmd = "exec transmission-gtk" } }, \
    { MODKEY,            XK_c,        spawn,        { .cmd = "exec linuxdcpp" } }, \
    { MODKEY,            XK_m,        spawn,        { .cmd = "exec ~/games/warsow/warsow" } }, \
    { 0,                XK_Print,    spawn,        { .cmd = "cd ~/sshots && exec scrot" } }, \
    { 0, /* HP QuickPlay */    XF86XK_Pictures,    spawn,        { .cmd = "exec urxvtc -e ncmpc" } }, \
    { MODKEY,         XF86XK_Pictures,    spawn,        { .cmd = "exec ~/codeworks/dwm/mpclip" } }, \
    { 0, /*     DVD      */    XF86XK_Video,        spawn,        { .cmd = "exec urxvtc -e ncmpc" } }, \
    { 0, /*        |<<         */    XF86XK_AudioPrev,    spawn,        { .cmd = "exec mpc prev" } }, \
    { 0, /*         |>         */    XF86XK_AudioPlay,    spawn,        { .cmd = "exec mpc toggle" } }, \
    { 0, /*         >>|     */    XF86XK_AudioNext,    spawn,        { .cmd = "exec mpc next" } }, \
    { 0, /*      []      */    XF86XK_AudioStop,    spawn,        { .cmd = "exec mpc stop" } }, \
    { 0, /*     Mute     */    XF86XK_AudioMute,    spawn,        { .cmd = "exec amixer set Headphone toggle" } }, \
    { 0, /*   Volume -   */    XF86XK_AudioLowerVolume,spawn,        { .cmd = "exec amixer set Headphone 4-%" } }, \
    { 0, /*   Volume +   */    XF86XK_AudioRaiseVolume,spawn,        { .cmd = "exec amixer set Headphone 4+%" } }, \
    { MODKEY,            XK_BackSpace,    spawn,        { .cmd = "exec eject /dev/cdrom" } }, \
    { Mod1Mask,            XK_Tab,        focusnext,    { 0 } }, \
    { MODKEY,            XK_Tab,        focusprev,    { 0 } }, \
    { MODKEY,            XK_e,        zoom,        { 0 } }, \
    { MODKEY,            XK_d,        resizemaster,    { .i = 40 } }, \
    { MODKEY,            XK_a,        resizemaster,    { .i = -40 } }, \
    { MODKEY,            XK_w,        incnmaster,    { .i = 1 } }, \
    { MODKEY,            XK_s,        incnmaster,    { .i = -1 } }, \
    { MODKEY|ShiftMask,        XK_0,        tag,        { .i = -1 } }, \
    { MODKEY|ShiftMask,        XK_1,        tag,        { .i = 0 } }, \
    { MODKEY|ShiftMask,        XK_2,        tag,        { .i = 1 } }, \
    { MODKEY|ShiftMask,        XK_3,        tag,        { .i = 2 } }, \
    { MODKEY|ShiftMask,        XK_4,        tag,        { .i = 3 } }, \
    { MODKEY|ShiftMask,        XK_5,        tag,        { .i = 4 } }, \
    { MODKEY|ShiftMask,        XK_6,        tag,        { .i = 5 } }, \
    { MODKEY|ShiftMask,        XK_7,        tag,        { .i = 6 } }, \
    { MODKEY|ShiftMask,        XK_8,        tag,        { .i = 7 } }, \
    { MODKEY|ShiftMask,        XK_9,        tag,        { .i = 8 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_1,        toggletag,    { .i = 0 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_2,        toggletag,    { .i = 1 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_3,        toggletag,    { .i = 2 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_4,        toggletag,    { .i = 3 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_5,        toggletag,    { .i = 4 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_6,        toggletag,    { .i = 5 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_7,        toggletag,    { .i = 6 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_8,        toggletag,    { .i = 7 } }, \
    { MODKEY|ControlMask|ShiftMask,    XK_9,        toggletag,    { .i = 8 } }, \
    { MODKEY,            XK_q,        killclient,    { 0 } }, \
    { MODKEY,            XK_space,    togglemode,    { 0 } }, \
    { MODKEY|ShiftMask,        XK_space,    togglefloat,    { 0 } }, \
    { MODKEY,            XK_0,        view,        { .i = -1 } }, \
    { MODKEY,            XK_1,        view,        { .i = 0 } }, \
    { MODKEY,            XK_2,        view,        { .i = 1 } }, \
    { MODKEY,            XK_3,        view,        { .i = 2 } }, \
    { MODKEY,            XK_4,        view,        { .i = 3 } }, \
    { MODKEY,            XK_5,        view,        { .i = 4 } }, \
    { MODKEY,            XK_6,        view,        { .i = 5 } }, \
    { MODKEY,            XK_7,        view,        { .i = 6 } }, \
    { MODKEY,            XK_8,        view,        { .i = 7 } }, \
    { MODKEY,            XK_9,        view,        { .i = 8 } }, \
    { MODKEY|ControlMask,        XK_1,        toggleview,    { .i = 0 } }, \
    { MODKEY|ControlMask,        XK_2,        toggleview,    { .i = 1 } }, \
    { MODKEY|ControlMask,        XK_3,        toggleview,    { .i = 2 } }, \
    { MODKEY|ControlMask,        XK_4,        toggleview,    { .i = 3 } }, \
    { MODKEY|ControlMask,        XK_5,        toggleview,    { .i = 4 } }, \
    { MODKEY|ControlMask,        XK_6,        toggleview,    { .i = 5 } }, \
    { MODKEY|ControlMask,        XK_7,        toggleview,    { .i = 6 } }, \
    { MODKEY|ControlMask,        XK_8,        toggleview,    { .i = 7 } }, \
    { MODKEY|ControlMask,        XK_9,        toggleview,    { .i = 8 } }, \
};

/* Query class:instance:title for regex matching info with following command:
 * xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */
#define RULES \
static Rule rule[] = { \
    /* class:instance:title regex    tags regex    isfloat */ \
    { "Gimp.*",            NULL,        True }, \
    { "MPlayer",            NULL,        True }, \
    { "Firefox-bin.*",        "www",        False }, \
    { ".*Opera",            "www",        False }, \
    { "Transmission-gtk.*",        "trans",    False }, \
    { "Linuxdcpp.*",        "trans",    False }, \
    { "ManiaDrive.*",        NULL,        True }, \
    { "vdrift.*",            NULL,        True }, \
};

IRC: Stalwart @ FreeNode
Skype ID: thestalwart
WeeChat-devel nightly packages for i686

Offline

#5 2007-02-22 16:14:12

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: dwm config

If you like to make changes to dwm, I really suggest learning about the quilt interface that is built into mercurial

http://www.selenic.com/mercurial/wiki/i … qExtension

Offline

#6 2007-02-22 21:37:55

SleepingGiant08
Member
From: Ellicott City, MD USA
Registered: 2007-01-10
Posts: 124

Re: dwm config

Thanks for the responses so far....it helps to see how everyone else sets everything up.

I got another question on how to modify the dwm bar at the top (or bottom in codemac's case). I want something like the wmii status thingy......

Also how do i set-up dmenu, would help me out a lot?


Registered Linux User #439761

Offline

#7 2007-02-22 21:57:41

skymt
Member
Registered: 2006-11-27
Posts: 443

Re: dwm config

SleepingGiant08 wrote:

I got another question on how to modify the dwm bar at the top (or bottom in codemac's case). I want something like the wmii status thingy......

Also how do i set-up dmenu, would help me out a lot?

dwm reads text from stdin and puts it in the status bar. I use a wrapper script written in Ruby, but you can use whatever language you want:

#!/usr/bin/env ruby
def mpdstat
    status = `mpc`
    if status.count($/) == 1
    return "mpd stopped"
    else
    return status.split($/)[0]
    end
end

def time
    Time.now.strftime("%I:%M")
end

dwm = IO.popen(ENV["HOME"] + "/.dwm/dwm", "a")
sleep 2
while dwm
    dwm.puts mpdstat + " - " + time
    sleep 3
end

That version relies on dwm being at ~/.dwm/dwm.

For dmenu (I assume you want a program menu), just install it along with lsx and copy the dmenu snippet from config.arg.h to your own config.h.

Offline

#8 2007-02-22 22:32:20

SleepingGiant08
Member
From: Ellicott City, MD USA
Registered: 2007-01-10
Posts: 124

Re: dwm config

sweet...thanks I got dmenu to work perfectly....

What are some good fonts I should get to spruce up my config.h and .Xdefaults? I got bitstream and terminus.....


Registered Linux User #439761

Offline

#9 2007-04-02 21:49:22

dolby
Member
From: 1992
Registered: 2006-08-08
Posts: 1,581

Re: dwm config

does any of u have UTF-8 locale?
dwm seems to spit out an error about missing fontsets

missing fontset: JISX0201.1976-0
missing fontset: GB2312.1980-0
missing fontset: KSC5601.1987-0
missing fontset: JISX0208.1983-0

the only related post i could find online was http://linuxforum.ru/index.php?s=&showt … t&p=370383 but as far as i can translate it with babelfish , it doesnt seem to include a fix

Last edited by dolby (2007-04-02 21:49:56)


There shouldn't be any reason to learn more editor types than emacs or vi -- mg (1)
[You learn that sarcasm does not often work well in international forums.  That is why we avoid it. -- ewaller (arch linux forum moderator)

Offline

#10 2007-04-02 22:17:13

meqif
Member
From: Portugal
Registered: 2006-12-16
Posts: 60
Website

Re: dwm config

skymt wrote:

dwm reads text from stdin and puts it in the status bar. I use a wrapper script written in Ruby, but you can use whatever language you want:

#!/usr/bin/env ruby
def mpdstat
    status = `mpc`
    if status.count($/) == 1
    return "mpd stopped"
    else
    return status.split($/)[0]
    end
end

def time
    Time.now.strftime("%I:%M")
end

dwm = IO.popen(ENV["HOME"] + "/.dwm/dwm", "a")
sleep 2
while dwm
    dwm.puts mpdstat + " - " + time
    sleep 3
end

That version relies on dwm being at ~/.dwm/dwm.

Offtopic: I advise you to avoid calling mpc like that, it's slow. Use something like librmpd


Ricardo Martins ><>< ricardomartins.cc ><>< GPG key: 0x1308F1B4

Offline

#11 2007-04-02 23:59:36

skymt
Member
Registered: 2006-11-27
Posts: 443

Re: dwm config

meqif wrote:

Offtopic: I advise you to avoid calling mpc like that, it's slow. Use something like librmpd

It's fast enough, since it's only called every 3 seconds. I've watched it in top, there's very little CPU usage.

I've actually ported the script to Python now, and am working on generalizing it. I might post it once it's done.


EDIT: Also, the script as it's posted has an annoying delay when you start dwm. I've fixed it in the Python version by using an infinite loop and just catching the exception when dwm quits.

Last edited by skymt (2007-04-03 00:02:25)

Offline

#12 2007-04-06 15:51:59

meqif
Member
From: Portugal
Registered: 2006-12-16
Posts: 60
Website

Re: dwm config

mrhacim wrote:

Has anyone else been able to edit and recompile dwm without killing X?

What about "killall dwm && dwm"? Works here, for some reason X doesn't die after I kill dwm if Firefox (or any other Gecko-based browser) is running

Last edited by meqif (2007-04-06 15:54:05)


Ricardo Martins ><>< ricardomartins.cc ><>< GPG key: 0x1308F1B4

Offline

#13 2007-04-07 10:22:32

hrist
Member
From: Germany
Registered: 2007-01-07
Posts: 61
Website

Re: dwm config

maybe you don't have
exec /path/to/dwm
in your last line in your .xinitrc
or you have some lines before which puts some status in your titlebar like
while true
do
   echo `date`
done | dwm
then i can stop dwm but the other programs still run, and therefore X will also stay "alive" wink

greetings
hrist

Last edited by hrist (2007-04-07 10:22:50)


two - Arch64 | dwm | nvidia
three - Arch64 | dwm | nvidia

Offline

#14 2007-04-08 06:12:30

tbroderick
Member
Registered: 2005-05-06
Posts: 45

Re: dwm config

My config.h is pretty basic. here are the few changes;

#define NORMBORDERCOLOR         "#dddddd"
#define NORMBGCOLOR             "#92aeb7"
#define NORMFGCOLOR             "#222222"
#define SELBORDERCOLOR          "#92aeb7"
#define SELBGCOLOR              "#3e3c3a"
#define SELFGCOLOR              "#ffffff"

const char *tags[] = { "default", "firefox", "float", "misc", NULL };

Other then that, I added a couple keys for firefox and mpc control. Also swapped the keys for terminal and zoom. Will most likely change the font once I decide which one to pick.

My .xinitrc.

feh --bg-scale $HOME/gsm.dust.png
while true
do
echo "[MPD: `mpc | sed -n '1p'`] [Mail: `ls $HOME/mail/inbox/new/|wc -l`] [`date '+%a %b %d %r'`"]
sleep 2
done | dwm

Last edited by tbroderick (2007-04-09 21:08:25)

Offline

#15 2007-04-08 11:57:21

meqif
Member
From: Portugal
Registered: 2006-12-16
Posts: 60
Website

Re: dwm config

hrist wrote:

maybe you don't have
exec /path/to/dwm
in your last line in your .xinitrc
or you have some lines before which puts some status in your titlebar like
while true
do
   echo `date`
done | dwm
then i can stop dwm but the other programs still run, and therefore X will also stay "alive" wink

greetings
hrist

Yeah, that must be it. I have "exec ruby ~/.dwm/dwm.rb | dwm" in my ~/.xinitrc. However, X doesn't stay alive if I only have terms (urxvt) open.

Last edited by meqif (2007-04-08 11:57:40)


Ricardo Martins ><>< ricardomartins.cc ><>< GPG key: 0x1308F1B4

Offline

#16 2007-04-12 22:06:02

TomE
Member
Registered: 2005-08-06
Posts: 164

Re: dwm config

mrhacim wrote:
tizoc wrote:

Edit: well... this last script doesn't work, I'm not a bash expert, and I don't really know how X manages its sessions, if anyone knows how to archieve what I want, tell me how please tongue

Has anyone else been able to edit and recompile dwm without killing X?

while true; do dwm;  done

Works for me:D

Offline

#17 2007-04-12 23:26:35

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Offline

#18 2007-04-15 01:20:21

harlekin
Member
From: Germany
Registered: 2006-07-13
Posts: 408

Re: dwm config

meqif wrote:

For some reason X doesn't die after I kill dwm if Firefox (or any other Gecko-based browser) is running

Same here. I remember noticing it with other apps too but I'm not quite sure. \:


Hail to the thief!

Offline

#19 2007-04-15 06:23:59

Xilon
Member
Registered: 2007-01-01
Posts: 243

Re: dwm config

Heh you guys seem to have the opposite problem to me. If I pipe something to dwm then when I kill dwm, X stays alive, which I don't won't. I'm guessing it's because X waits for the loop to end and not for dwm. The loop won't end because it's an infinite loop, but I also don't wont to check if DWM is running everytime tongue Currently I just kill X instead of DWM.

Anyway here's my setup:
.xinitrc

urxvtd &

eval `cat ~/.fehbg` &

# Autostart
xmodmap ~/.xmodmap &
#xbindkeys &
ob3_term & 

# Start WM
while [ 1 ]; do
    ~/Devil/bin/dwm-status &
    [[ "`cat /proc/acpi/ac_adapter/ADP1/state`" =~ "on-line" ]] \
    && sleep 5\
    || sleep 1m
done | exec dwm

dwm-status

#!/bin/bash
bin="$HOME/Devil/bin"
pkgs="`$bin/pacman.sh`"
battery="`$bin/battery.sh`"
memory="`$bin/memory.sh`"
time=`date +%H:%M`
#volume=`$bin/volume.sh`
#sda3=`df -h | grep sda3 | awk -F " " '{print $5}'`
echo "M: $memory | P:$pkgs | B:$battery | $time"

config.h

/* appearance */
#define BORDERPX        0
#define FONT            "-*-clean-medium-r-normal-*-12-*-*-*-*-*-*-*"
#define NORMBORDERCOLOR        "#2e3436"
#define NORMBGCOLOR        "#222222"
#define NORMFGCOLOR        "#555753"
#define SELBORDERCOLOR        "#f5a400"
#define SELBGCOLOR        "#2e3436"
#define SELFGCOLOR        "#f5a400"
#define TOPBAR            True        /* False */

#define DMENUARGS               "-fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '" \
    NORMFGCOLOR"' -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"'"

/* tagging */
#define TAGS \
const char *tags[] = { "General", "Internet", "Chat", "Development", \
    "Graphics", "Monitoring", "Void", NULL };

/* Query class:instance:title for regex matching info with following command:
 * xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */
#define RULES \
static Rule rule[] = { \
    /* class:instance:title regex    tags regex    isfloating */ \
    { "Gimp",            "Graphics",    True }, \
    { "MPlayer",            NULL,        True }, \
    { "Acroread",            NULL,        True }, \
    { "Xarchiver.*",        NULL,        True }, \
    { "Gaim:gaim:Buddy List",    "Void",        True }, \
    { "Firefox-bin",            "Internet",    False }, \
        { "Linuxdcpp:linuxdcpp:Connect to a hub", NULL, True }, \
};

/* layout(s) */
#define LAYOUTS \
static Layout layout[] = { \
    /* symbol        function */ \
    { "[]=",        tile }, /* first entry is default */ \
    { "><>",        floating }, \
};
#define MASTERWIDTH        650        /* master width per thousand */
#define NMASTER            1        /* clients in master area */
#define SNAP            10        /* snap pixel */

/* key definitions */
#define MODKEY            Mod4Mask
#define KEYS \
static Key key[] = { \
    /* modifier            key        function    argument */ \
    { MODKEY,            XK_space,    spawn,         "exec `dmenu_path | dmenu "DMENUARGS"`" }, \
    { MODKEY,            XK_l,        setlayout,    NULL }, \
    { MODKEY,            XK_d,        incmasterw,    "-32" }, \
    { MODKEY,            XK_i,        incmasterw,    "32" }, \
    { MODKEY|ShiftMask,        XK_i,        incnmaster,    "1" }, \
    { MODKEY|ShiftMask,        XK_d,        incnmaster,    "-1" }, \
    { MODKEY,            XK_Tab,        focusclient,    "1" }, \
    { MODKEY|ShiftMask,            XK_Tab,        focusclient,    "-1" }, \
    { MODKEY,            XK_m,        togglemax,    NULL }, \
    { MODKEY,            XK_Return,    zoom,        NULL }, \
    { MODKEY|ShiftMask,        XK_space,    togglefloating,    NULL }, \
    { MODKEY|ShiftMask,        XK_c,        killclient,    NULL }, \
    { MODKEY,            XK_0,        view,        NULL }, \
    { MODKEY,            XK_1,        view,        "0" }, \
    { MODKEY,            XK_2,        view,        "1" }, \
    { MODKEY,            XK_3,        view,        "2" }, \
    { MODKEY,            XK_4,        view,        "3" }, \
    { MODKEY,            XK_5,        view,        "4" }, \
    { MODKEY,            XK_6,        view,        "5" }, \
    { MODKEY,            XK_7,        view,        "6" }, \
    { MODKEY,            XK_8,        view,        "7" }, \
    { MODKEY,            XK_9,        view,        "8" }, \
    { MODKEY|ControlMask,        XK_1,        toggleview,    "0" }, \
    { MODKEY|ControlMask,        XK_2,        toggleview,    "1" }, \
    { MODKEY|ControlMask,        XK_3,        toggleview,    "2" }, \
    { MODKEY|ControlMask,        XK_4,        toggleview,    "3" }, \
    { MODKEY|ControlMask,        XK_5,        toggleview,    "4" }, \
    { MODKEY|ControlMask,        XK_6,        toggleview,    "5" }, \
    { MODKEY|ControlMask,        XK_7,        toggleview,    "6" }, \
    { MODKEY|ControlMask,        XK_8,        toggleview,    "7" }, \
    { MODKEY|ControlMask,        XK_9,        toggleview,    "8" }, \
    { MODKEY|ShiftMask,        XK_0,        tag,        NULL }, \
    { MODKEY|ShiftMask,        XK_1,        tag,        "0" }, \
    { MODKEY|ShiftMask,        XK_2,        tag,        "1" }, \
    { MODKEY|ShiftMask,        XK_3,        tag,        "2" }, \
    { MODKEY|ShiftMask,        XK_4,        tag,        "3" }, \
    { MODKEY|ShiftMask,        XK_5,        tag,        "4" }, \
    { MODKEY|ShiftMask,        XK_6,        tag,        "5" }, \
    { MODKEY|ShiftMask,        XK_7,        tag,        "6" }, \
    { MODKEY|ShiftMask,        XK_8,        tag,        "7" }, \
    { MODKEY|ShiftMask,        XK_9,        tag,        "8" }, \
    { MODKEY|ControlMask|ShiftMask,    XK_1,        toggletag,    "0" }, \
    { MODKEY|ControlMask|ShiftMask,    XK_2,        toggletag,    "1" }, \
    { MODKEY|ControlMask|ShiftMask,    XK_3,        toggletag,    "2" }, \
    { MODKEY|ControlMask|ShiftMask,    XK_4,        toggletag,    "3" }, \
    { MODKEY|ControlMask|ShiftMask,    XK_5,        toggletag,    "4" }, \
    { MODKEY|ControlMask|ShiftMask,    XK_6,        toggletag,    "5" }, \
    { MODKEY|ControlMask|ShiftMask,    XK_7,        toggletag,    "6" }, \
    { MODKEY|ControlMask|ShiftMask,    XK_8,        toggletag,    "7" }, \
    { MODKEY|ControlMask|ShiftMask,    XK_9,        toggletag,    "8" }, \
    { MODKEY|ShiftMask,        XK_q,        quit,        NULL }, \
    { MODKEY,            XK_q,        spawn,        "exec urxvtc" }, \
    { MODKEY,            XK_j,        spawn,        "exec thunar" }, \
    { MODKEY,            XK_k,        spawn,        "exec firefox" }, \
    { MODKEY,            XK_a,        spawn,        "exec mpc prev" }, \
    { MODKEY,            XK_o,        spawn,        "exec mpc toggle" }, \
    { MODKEY,            XK_e,        spawn,        "exec mpc next" }, \
};

And here's a screenie
200704102304501280x800szu5.th.png

Offline

#20 2007-04-24 21:34:46

delirio
Member
Registered: 2007-04-24
Posts: 6

Re: dwm config

~/.xinitrc

#!/bin/sh
FIFO=$HOME/.dwm/fifo &
$HOME/.dwm/in.sh > $FIFO &
dwm < $FIFO > $FIFO

~/.dwm/in.sh

#!/bin/bash
dn=0
dp=0
un=0
up=0
while true
do
    un=$(ifconfig wlan0 | grep 'RX bytes' | cut -d : -f3 | cut -d ' ' -f1)
    speed_u=$(echo "($un - $up) / 5120" | bc)
    up=$un

    dn=$(ifconfig wlan0 | grep 'RX bytes' | cut -d : -f2 | cut -d ' ' -f1)
    speed_d=$(echo "($dn - $dp) / 5120" | bc)
    dp=$dn
    echo "DL/UL: $speed_d/$speed_u Kb/Sec | UM: $(gajim-remote get_unread_msgs_number) | $(date +'[%H:%M] %a %b %d')"
    sleep 5
done

config.h

/* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
 * © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
 * See LICENSE file for license details. */

/* appearance */
#define BORDERPX        1
#define FONT            "-xos4-terminus-medium-r-normal-*-12-*-*-*-*-*-*-*"
#define NORMBORDERCOLOR        "#2e3436"
#define NORMBGCOLOR        "#222222"
#define NORMFGCOLOR        "#555753"
#define SELBORDERCOLOR        "#f5a400"
#define SELBGCOLOR        "#2e3436"
#define SELFGCOLOR        "#f5a400"
#define TOPBAR            True        /* False */

/* tagging */
#define TAGS \
const char *tags[] = { "Main", "Net", "Im", "Media", "Devel", "Graph", "Misc", "Sys", "Irc", NULL };
/* Query class:instance:title for regex matching info with following command:
 * xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */
#define RULES \
static Rule rule[] = { \
    /* class:instance:title regex    tags regex    isfloating */ \
    { "Gimp",            "Graph",    True }, \
    { "MPlayer",            "Media",    True }, \
    { "Acroread",            "Misc",        True }, \
    { "Firefox",            "Net",        False}, \
    { "Firefox-bin:.*(Bookmarks|Downloads)","Net",        True }, \
    { ".*Opera",            "Net",        False }, \
    { "Linuxdcpp.*",        "Misc",        False }, \
    { "Gaim",            "Im",        True }, \
    { "xchat",            "Irc",        False }, \
    { "Gajim",            "Im",        True }, \
    { "Tkabber",            "Im",        False }, \
    { "gvim",            "Devel",    False }, \
    { "Audacious",            "Media",    True }, \
    { "OpenOffice",            "Sys",        False }, \
};

/* layout(s) */
#define LAYOUTS \
static Layout layout[] = { \
    /* symbol        function */ \
    { "[]=",        tile }, /* first entry is default */ \
    { "><>",        floating }, \
};
#define MASTERWIDTH        600        /* master width per thousand */
#define NMASTER            2        /* clients in master area */
#define SNAP            32        /* snap pixel */

/* key definitions */
#define MODKEY            Mod4Mask
#define KEYS \
static Key key[] = { \
    /* modifier            key        function    argument */ \
    { MODKEY|ShiftMask,        XK_Return,    spawn,        "exec urxvt" }, \
    { MODKEY|ShiftMask,        XK_m,        spawn,        "exec urxvt -e 'mc'" }, \
    { MODKEY,            XK_r,        spawn,        "exec rox" }, \
    { MODKEY,            XK_f,        spawn,        "exec firefox" }, \
    { MODKEY,            XK_a,        spawn,        "exec audacious" }, \
    { MODKEY,            XK_e,        spawn,        "exec gvim" }, \
    { MODKEY,            XK_g,        spawn,        "exec gajim" }, \
    { MODKEY,            XK_o,        spawn,        "exec opera" }, \
    { MODKEY,            XK_c,        spawn,        "exec linuxdcpp" }, \
    { MODKEY,            XK_p,        spawn, \
        "exe=`dmenu_path | dmenu -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"'" \
        " -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"'` && exec $exe" }, \
    { MODKEY,            XK_space,    setlayout,    NULL }, \
    { MODKEY,            XK_h,        incmasterw,    "-32" }, \
    { MODKEY,            XK_l,        incmasterw,    "32" }, \
    { MODKEY|ShiftMask,        XK_j,        incnmaster,    "1" }, \
    { MODKEY|ShiftMask,        XK_k,        incnmaster,    "-1" }, \
    { MODKEY,            XK_j,        focusclient,    "1" }, \
    { MODKEY,            XK_k,        focusclient,    "-1" }, \
    { MODKEY,            XK_m,        togglemax,    NULL }, \
    { MODKEY,            XK_Return,    zoom,        NULL }, \
    { MODKEY|ShiftMask,        XK_space,    togglefloating,    NULL }, \
    { MODKEY|ShiftMask,        XK_c,        killclient,    NULL }, \
    { MODKEY,            XK_0,        view,        NULL }, \
    { MODKEY,            XK_1,        view,        "0" }, \
    { MODKEY,            XK_2,        view,        "1" }, \
    { MODKEY,            XK_3,        view,        "2" }, \
    { MODKEY,            XK_4,        view,        "3" }, \
    { MODKEY,            XK_5,        view,        "4" }, \
    { MODKEY,            XK_6,        view,        "5" }, \
    { MODKEY,            XK_7,        view,        "6" }, \
    { MODKEY,            XK_8,        view,        "7" }, \
    { MODKEY,            XK_9,        view,        "8" }, \
    { MODKEY|ControlMask,        XK_1,        toggleview,    "0" }, \
    { MODKEY|ControlMask,        XK_2,        toggleview,    "1" }, \
    { MODKEY|ControlMask,        XK_3,        toggleview,    "2" }, \
    { MODKEY|ControlMask,        XK_4,        toggleview,    "3" }, \
    { MODKEY|ControlMask,        XK_5,        toggleview,    "4" }, \
    { MODKEY|ControlMask,        XK_6,        toggleview,    "5" }, \
    { MODKEY|ControlMask,        XK_7,        toggleview,    "6" }, \
    { MODKEY|ControlMask,        XK_8,        toggleview,    "7" }, \
    { MODKEY|ControlMask,        XK_9,        toggleview,    "8" }, \
    { MODKEY|ShiftMask,        XK_0,        tag,        NULL }, \
    { MODKEY|ShiftMask,        XK_1,        tag,        "0" }, \
    { MODKEY|ShiftMask,        XK_2,        tag,        "1" }, \
    { MODKEY|ShiftMask,        XK_3,        tag,        "2" }, \
    { MODKEY|ShiftMask,        XK_4,        tag,        "3" }, \
    { MODKEY|ShiftMask,        XK_5,        tag,        "4" }, \
    { MODKEY|ShiftMask,        XK_6,        tag,        "5" }, \
    { MODKEY|ShiftMask,        XK_7,        tag,        "6" }, \
    { MODKEY|ShiftMask,        XK_8,        tag,        "7" }, \
    { MODKEY|ShiftMask,        XK_9,        tag,        "8" }, \
    { MODKEY|Mod1Mask,        XK_1,        toggletag,    "0" }, \
    { MODKEY|Mod1Mask,        XK_2,        toggletag,    "1" }, \
    { MODKEY|Mod1Mask,        XK_3,        toggletag,    "2" }, \
    { MODKEY|Mod1Mask,        XK_4,        toggletag,    "3" }, \
    { MODKEY|Mod1Mask,        XK_5,        toggletag,    "4" }, \
    { MODKEY|Mod1Mask,        XK_6,        toggletag,    "5" }, \
    { MODKEY|Mod1Mask,        XK_7,        toggletag,    "6" }, \
    { MODKEY|Mod1Mask,        XK_8,        toggletag,    "7" }, \
    { MODKEY|Mod1Mask,        XK_9,        toggletag,    "8" }, \
    { MODKEY|ShiftMask,        XK_q,        quit,        NULL }, \
};

ScreenShot:

10891085108010841086108no6.th.png

Offline

#21 2007-04-24 22:01:48

dolby
Member
From: 1992
Registered: 2006-08-08
Posts: 1,581

Re: dwm config

it would be great if we could gather many pages containing dwm patches

ps. hey delirio this is the dwm not the linux dc++ thread tongue


There shouldn't be any reason to learn more editor types than emacs or vi -- mg (1)
[You learn that sarcasm does not often work well in international forums.  That is why we avoid it. -- ewaller (arch linux forum moderator)

Offline

#23 2007-04-28 06:22:39

sivad
Member
Registered: 2006-10-31
Posts: 27

Re: dwm config

Here is my DWM setup

.xinitrc

#connect to screens
# connect to screens on server
# FIXME: sometimes fails
(for what in contor rtorrent chat
do
where="screen -x -p $what"
who="ssh orange -t '$where'"
urxvt -title "screen: $what" -e bash -c "$who" &
sleep 1 
done
)&

# set backgrounds
(while true
do
BG=`ls $HOME/bgs/* | randomline`
feh --bg-scale $BG
sleep 520
done
)&

#dwm stuff, inspired by nooms, smoon or whatever his name is
D=$HOME/.dwm
mkdir -p $D
rm -f $D/status
mkfifo $D/status
exec $D/status.rb  &
exec ~/dwm <> $D/status

.dwm/status.rb

#!/usr/bin/ruby
require 'rubygems'
require 'librmpd'
require "xmlrpc/server"

class Status
  def initialize(radio,file)
    @song = 'off'
    @time = getTime
    @radio = radio
    @file = file
    @nicks = {}
    @msgCount = 0
  end

  def my_song_callback( newsong )
    if newsong
      if @radio[newsong['file']]
        @song = @radio[newsong['file']]
      else
        @song = newsong['title']
      end
    else
      @song = 'off'
    end
    printStatus
  end

  def getTime()
    return Time.now.strftime("%I:%M%p")
  end

  def printStatus ()
    time = Time.now.strftime("%I:%M%p")
    @file.puts "[#{@msgCount}] | [#{@song}] | #{time}"
    @file.flush
  end

  def receive (count)
    @msgCount = count
    printStatus
    return 1
  end
end

radio = {"http://trance.ii.net:8001" => "Digitly Imported",
   "http://trance.ii.net:8002" => "Bassdrive",
   "http://trance.ii.net:8003" => "SKY.FM - JAZZ",
   "http://trance.ii.net:8004" => "SKY.FM - CLASSICAL",
   "http://trance.ii.net:8005" => "Philosomatika",
   "http://trance.ii.net:8006" => "Wazee",
   "http://trance.ii.net:8007" => "",
   "http://trance.ii.net:8008" => "Virgin Radio",
   "http://trance.ii.net:8009" => "DIGITALLY-IMPORTED-Trance",
   "http://trance.ii.net:8010" => "Pulse Radio",
   "http://trance.ii.net:8011" => "Club977",
   "http://trance.ii.net:8012" => "HitzRadio",
   "http://trance.ii.net:8013" => "The Hitz Channe",
   "http://trance.ii.net:8014" => "DIGITALLY-IMPORTED-House",
   "http://trance.ii.net:8015" => "Tripple J"
}

mpd = MPD.new 'localhost', 6600
file = File.open("/home/josh/.dwm/status",'w')
status = Status.new(radio,file)
song_cb = status.method 'my_song_callback'
mpd.register_callback song_cb, MPD::CURRENT_SONG_CALLBACK
mpd.connect true

s = XMLRPC::Server.new(8080,'192.168.1.10')
s.add_handler('status',status)
s.serve

while 1:
  status.printStatus()
  sleep 30
end

Yes I know its alittle dirty...will clean later when I dont have to study for maths. arghh sad

.irssi/scripts/notify.pl

##  cp notify.pl .irssi/scripts
##  /script load notify.pl
##

use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
use Frontier::Client;

$VERSION = "0.01";
%IRSSI = (
    authors     => 'Josh Davis',
    contact     => 'joshdr77@hotmail.com',
    name        => 'notify.pl',
    description => 'XML RPC message of unread message count',
    license     => '',
    url         => '',
);


my $msgCount;
my $s = Frontier::Client->new(url => 'http://192.168.1.10:8080/RPC2');

sub send_count {

  return unless defined $msgCount;

  my $count = 0;
  for my $i (values %$msgCount) {
    $count += $i;
  }
  try {
    eval {$s->call('status.receive',$count);}
  }
  catch {
    return;
  };
}

sub message_receive {
  my ($server, $msg, $nick, $address) = @_;
  return if (!$server);
  $msgCount->{$nick}++;
  send_count;
}

sub message_send {
  my ($server, $msg, $nick, $address) = @_;
  return if (!$server);
  delete $msgCount->{$nick};
  send_count;
}

sub command2 {
  my ($window) = @_;
  my $nick = $window->{'active'}->{'name'};
  delete $msgCount->{$nick};
  send_count;

}
sub command3 {
  my ($window) = @_;
  my $nick = $window->{'active'}->{'name'};
  delete $msgCount->{$nick};
  send_count;
}

sub update {
  send_count;
}

Irssi::timeout_add(30000, 'update', "");
Irssi::signal_add('message private', 'message_receive');
Irssi::signal_add('message own_private','message_send');
Irssi::signal_add('window changed','command2');
Irssi::signal_add('window item remove','command3');

This was also done in a rush and could be improved..

All the above have had minimal testing but appear to work ok.

Offline

#24 2008-04-09 16:49:37

strankan
Member
From: Sundsvall - Sweden
Registered: 2006-11-08
Posts: 97

Re: dwm config

dolby wrote:

does any of u have UTF-8 locale?
dwm seems to spit out an error about missing fontsets

missing fontset: JISX0201.1976-0
missing fontset: GB2312.1980-0
missing fontset: KSC5601.1987-0
missing fontset: JISX0208.1983-0

the only related post i could find online was http://linuxforum.ru/index.php?s=&showt … t&p=370383 but as far as i can translate it with babelfish , it doesnt seem to include a fix

Think I need to revive this old thread. I'm trying to get dwm to work with my custom (stolen) config, but I'm getting the same error as above. Can't seem to find a solution to it anywhere. Any ideas anyone?

Offline

#25 2008-04-09 21:48:16

jeebusroxors
Member
Registered: 2005-10-26
Posts: 58
Website

Re: dwm config

Are you getting a segfault after the fontsets when you try to execute?


There's no place like 127.0.0.1

Offline

Board footer

Powered by FluxBB