Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Howto: dwm configuration and installation

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Message
Author
User avatar
m4rtin
Posts: 28
Joined: 2009-01-15 07:12

Re: Howto: dwm configuration and installation

#16 Post by m4rtin »

In configuration section below, windows of "Gimp" and "Firefox" applications have some pre-configured behavior:

Code: Select all

/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };

static const Rule rules[] = {
        /* class      instance    title       tags mask     isfloating   monitor */
        { "Gimp",     NULL,       NULL,       0,            True,        -1 },
        { "Firefox",  NULL,       NULL,       1 << 8,       False,       -1 },
};
Where are the classes "Gimp" and "Firefox" defined? Or does this work in a way that each executable named Gimp or Firefox will match?
In addition, what are the characteristics of programs which do not work (well) with tiling window managers? Are there many of such programs and is it a frequent problem when using tiling window manager on a daily basis?

Loomx
Posts: 55
Joined: 2010-09-28 01:11

Re: Howto: dwm configuration and installation

#17 Post by Loomx »

Where are the classes "Gimp" and "Firefox" defined?
From http://dwm.suckless.org/faq
Q: How do I find out the values of the rules[] array in config.h?

A: The class, instance and title properties of an X11 window can be
found out by issuing xprop(1). The corresponding values are:

WM_CLASS(STRING) = instance, class
WM_NAME(STRING) = title
Some programs allow you to set the title when you launch them, e.g. "xterm -title Mail -e Mutt" so you could specify special treatment for windows based on that.
In addition, what are the characteristics of programs which do not work (well) with tiling window managers?
Well, Gimp used to be a common example (hence the rule in config.h), but it now has a "single-window" mode which works fine in a tiling window manager.
Most programs work well - I haven't come across any other problem ones that I can think of anyway.
The only rule I use is:

Code: Select all

 static const Rule rules[] = {
    /* class      instance    title       tags mask     isfloating   monitor */
    {  NULL,      "xv",       NULL,       0,            True,        -1 },
};
as otherwise xv distorts the image to fit its window, which is not usually the effect I want... :shock:

princenguyen
Posts: 7
Joined: 2014-06-14 04:23

Re: Howto: dwm configuration and installation

#18 Post by princenguyen »

I maked 4 tags: Main, Internet, Multimedia, Document. I want xterm to show only in the first tag. So xterm's tagmask is "1 << 0". But xterm windows would show up in every tags i'm working on, like dmenu.
Is there any ways to force xterm just show in a specific tag? And how to config dwm automatically focusing on a new opening window in an other tag?

Loomx
Posts: 55
Joined: 2010-09-28 01:11

Re: Howto: dwm configuration and installation

#19 Post by Loomx »

(I see that your question has been answered in the other thread, but I'll add it here for reference: )

See my post above regarding `xprop' to get the properties of an X11 window.
Double check that the string you get from running `xprop' is correct.

e.g. Running `xprop' then clicking an xterm gives:

Code: Select all

...
WM_CLASS(STRING) = "xterm", "XTerm"
...
so the instance is `xterm' and the class is `XTerm' (note the capitalisation)

princenguyen
Posts: 7
Joined: 2014-06-14 04:23

Re: Howto: dwm configuration and installation

#20 Post by princenguyen »

Thanks :D, it works. One more question, I want to change font to Arial. I tried to edit "terminus" from "arial" in config.h but not working:
static const char font[] = "-*-arial-medium-r-*-*-16-*-*-*-*-*-*-*";
When I was patching xft, there is errors:

Code: Select all

hoang@BLACK110:~/build/dwm-6.0$ sudo make clean install
cleaning
dwm build options:
CFLAGS   = -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/X11R6/include -DVERSION="6.0" -DXINERAMA
LDFLAGS  = -s -L/usr/lib -lc -L/usr/X11R6/lib -lX11 -L/usr/X11R6/lib -lXinerama
CC       = cc
creating config.h from config.def.h
CC dwm.c
dwm.c:42:25: fatal error: X11/Xft/Xft.h: No such file or directory
compilation terminated.
make: *** [dwm.o] Error 1

Loomx
Posts: 55
Joined: 2010-09-28 01:11

Re: Howto: dwm configuration and installation

#21 Post by Loomx »

Try installing the package `libxft-dev'

See this thread for more details: http://crunchbang.org/forums/viewtopic.php?id=22523, particularly the posts by Unia.

OR - perhaps try using the pango patch which has a few more features instead of the xft patch
(from what I've read - I've never used either of them)
http://dwm.suckless.org/patches/pango

princenguyen
Posts: 7
Joined: 2014-06-14 04:23

Re: Howto: dwm configuration and installation

#22 Post by princenguyen »

Thanks, I have installed pango (need some libpango dependencies) and I can apply ttf for the topbar. But the tabbar i had patched before is blank without title name. Pango and tab seem to be conflict patches.

Loomx
Posts: 55
Joined: 2010-09-28 01:11

Re: Howto: dwm configuration and installation

#23 Post by Loomx »

You could always try `tabbed'
http://tools.suckless.org/tabbed/
rather than patching dwm if the patches are giving you problems

DebbyIan
Posts: 158
Joined: 2013-05-09 12:12

Re: Howto: dwm configuration and installation

#24 Post by DebbyIan »

Can we post any other issues/problems/requests here? Or is this thread just for initial dwm configuration?

There is no Minimize feature because the concept of Workspaces is altered. So "tabs" are used instead. I was wondering if there was a way to hide windows instead? The reason is to expose the background.



Is it just me or does Debian rock??

Image

Loomx
Posts: 55
Joined: 2010-09-28 01:11

Re: Howto: dwm configuration and installation

#25 Post by Loomx »

DebbyIan wrote:Can we post any other issues/problems/requests here? Or is this thread just for initial dwm configuration?
Why not... :D
There is no Minimize feature because the concept of Workspaces is altered. So "tabs" are used instead. I was wondering if there was a way to hide windows instead? The reason is to expose the background.
Well, that kind of defeats the purpose of a tiling wm, doesn't it?
You can just view a tag that has no windows attached to it; then all you will see is the root window (i.e. the background)

DebbyIan
Posts: 158
Joined: 2013-05-09 12:12

Re: Howto: dwm configuration and installation

#26 Post by DebbyIan »

Just a blank tag. I suppose it can be done but it's not very elegant.
I was hoping to expose the root window on any given tag and not have to specifically go to a specific tag.

Loomx
Posts: 55
Joined: 2010-09-28 01:11

Re: Howto: dwm configuration and installation

#27 Post by Loomx »

Whatever tag{s} you choose to view, if there are no windows attached to that tag{s} then you see the root window.
You don't have to go to a specific tag.

Remember: tags != workspaces - they are a bit more, well, 'dynamic' than that.

DebbyIan
Posts: 158
Joined: 2013-05-09 12:12

Re: Howto: dwm configuration and installation

#28 Post by DebbyIan »

Hope I'm not trolling. What the heck..
All my tags have windows attached. Dynamism could be bit more dynamic.
Well I suppose I should set up tag N + 1 and then use that.

Loomx
Posts: 55
Joined: 2010-09-28 01:11

Re: Howto: dwm configuration and installation

#29 Post by Loomx »

DebbyIan wrote:All my tags have windows attached. Dynamism could be bit more dynamic.
:lol:

What is it exactly you want to do, anyway? Do you just want to be able to temporarily hide all your windows away?

DebbyIan
Posts: 158
Joined: 2013-05-09 12:12

Re: Howto: dwm configuration and installation

#30 Post by DebbyIan »

I've simply run out of tags.
I suppose I could have a tag called "0" but oh no, Modkey + 0 is assigned to composite of all tags.
I've simply run out of the 9 tags. If you think about it, if you have one or two distinct apps per tag then 9 tags isn't nearly enough.
:)

Loomx
Posts: 55
Joined: 2010-09-28 01:11

Re: Howto: dwm configuration and installation

#31 Post by Loomx »

Crikey...
I use two tags: basically "those on screen" and "those off screen", then shuffle my windows around as needed (I obviously don't use as many different programs as you though)

If you want more tags, just add them and attach them to other keys, e.g. Modkey + !, Modkey + ;, Modkey + .

User avatar
freek
Posts: 74
Joined: 2007-04-03 01:36
Location: Netherlands

Re: Howto: dwm configuration and installation

#32 Post by freek »

dwm-6.1
Modkey + enter does not open xterm .. damned ! where do I f*ck up ?

In config.h:

Code: Select all

/* key definitions */
#define MODKEY Mod4Mask

Code: Select all

/* commands */
static const char *termcmd[]  = { "xterm", NULL };

Code: Select all

static Key keys[] = {
     { MODKEY,     XK_Return,     spawn,     { .v = termcmd } },
please ..  :?
there's no business like .. your own business ..

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Howto: dwm configuration and installation

#33 Post by Head_on_a_Stick »

Probably best to post the entire config.h

What is the output of `make`?
deadbang

User avatar
freek
Posts: 74
Joined: 2007-04-03 01:36
Location: Netherlands

Re: Howto: dwm configuration and installation

#34 Post by freek »

config.h

Code: Select all

1 /* See LICENSE file for copyright and license details. */
  2 
  3 /* appearance */
  4 static const char *fonts[] = {
  5         "terminus:size=10"
  6 };
  7 static const char dmenufont[]       = "terminus:size=10";
  8 static const char normbordercolor[] = "#444444";
  9 static const char normbgcolor[]     = "#000000";
 10 static const char normfgcolor[]     = "#bbbbbb";
 11 static const char selbordercolor[]  = "#005577";
 12 static const char selbgcolor[]      = "#000000";
 13 static const char selfgcolor[]      = "#eeeeee";
 14 static const unsigned int borderpx  = 2;        /* border pixel of windows */
 15 static const unsigned int snap      = 32;       /* snap pixel */
 16 static const int showbar            = 0;        /* 0 means no bar */
 17 static const int topbar             = 1;        /* 0 means bottom bar */
 18 
 19 /* tagging */
 20 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
 21 
 22 static const Rule rules[] = {
 23         /* xprop(1):
 24          *      WM_CLASS(STRING) = instance, class
 25          *      WM_NAME(STRING) = title
 26          */
 27         /* class      instance    title       tags mask     isfloating   monitor */
 28         { "Gimp",     NULL,       NULL,       0,            1,           -1 },
 29         { "Firefox",  NULL,       NULL,       1 << 8,       0,           -1 },
 30 };
 31 
 32 /* layout(s) */
 33 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
 34 static const int nmaster     = 1;    /* number of clients in master area */
 35 static const int resizehints = 0;    /* 1 means respect size hints in tiled resizals */
 36 
 37 static const Layout layouts[] = {
 38         /* symbol     arrange function */
 39         { "[]=",      tile },    /* first entry is default */
 40         { "><>",      NULL },    /* no layout function means floating behavior */
 41         { "[M]",      monocle },
 42 };
 43 
 44 /* key definitions */
 45 #define MODKEY Mod4Mask
 46 #define TAGKEYS(KEY,TAG) \
 47         { MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
 48         { MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
 49         { MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
 50         { MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
 51 
 52 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
 53 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
 54 
 55 /* commands */
 56 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
 57 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-    nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
 58 static const char *termcmd[]  = { "xterm", NULL };
 59 
 60 static Key keys[] = {
 61         /* modifier                     key        function        argument */
 62         { MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
 63         { MODKEY,                       XK_Return, spawn,          {.v = termcmd } },
 64         { MODKEY,                       XK_b,      togglebar,      {0} },
 65         { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
 66         { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
 67         { MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
 68         { MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
 69         { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
 70         { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
 71         { MODKEY|ShiftMask,             XK_Return, zoom,           {0} },
 72         { MODKEY,                       XK_Tab,    view,           {0} },
 73         { MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
 74         { MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
 75         { MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
 76         { MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
 77         { MODKEY,                       XK_space,  setlayout,      {0} },
 78         { MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
 79         { MODKEY,                       XK_0,      view,           {.ui = ~0 } },
 80         { MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
 81         { MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
 82         { MODKEY,                       XK_period, focusmon,       {.i = +1 } },
 83         { MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
 84         { MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
 85         TAGKEYS(                        XK_1,                      0)
 86         TAGKEYS(                        XK_2,                      1)
 87         TAGKEYS(                        XK_3,                      2)
 88         TAGKEYS(                        XK_4,                      3)
 89         TAGKEYS(                        XK_5,                      4)
 90         TAGKEYS(                        XK_6,                      5)
 91         TAGKEYS(                        XK_7,                      6)
 92         TAGKEYS(                        XK_8,                      7)
 93         TAGKEYS(                        XK_9,                      8)
 94         { MODKEY|ShiftMask,             XK_q,      quit,           {0} },
 95 };
 96 
 97 /* button definitions */
 98 /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
 99 static Button buttons[] = {
100         /* click                event mask      button          function        argument */
101         { ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
102         { ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
103         { ClkWinTitle,          0,              Button2,        zoom,           {0} },
104         { ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
105         { ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
106         { ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
107         { ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
108         { ClkTagBar,            0,              Button1,        view,           {0} },
109         { ClkTagBar,            0,              Button3,        toggleview,     {0} },
110         { ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
111         { ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
112 };
113 
there's no business like .. your own business ..

User avatar
freek
Posts: 74
Joined: 2007-04-03 01:36
Location: Netherlands

Re: Howto: dwm configuration and installation

#35 Post by freek »

make clean install

Code: Select all

[root@debian: dwm ] make clean install
cleaning
dwm build options:
CFLAGS   = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_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
CC util.c
CC -o dwm
installing executable file to /usr/local/bin
installing manual page to /usr/local/share/man/man1
[root@debian: dwm ] 
there's no business like .. your own business ..

Post Reply