El rincón de Zerial

Informática, GNU/Linux, Seguridad, Hacking, Programación, Ocio

Dymamic Window Manager (DWM): Mi nuevo gestor de ventanas

Agosto 29th, 2009 · 9 Comentarios

El otro día leí en irc que hablaban sobre ScrotWM y lo probé. En un principio me gustó mucho, demasiado sencillo y ligero, luego de usarlo un par de minutos ya me estába dando problemas con algunas ventanas flotantes y para no quedarme con las ganas entonces lo cambié por Dynamic Window Manager (DWM).

dwm

La gracia de este gestor de ventanas es que es demasiado simple, tiene no mas de 2 mil líneas de código, no usa archivos de configuración y claro, para configurarlo hay que editar directamente el código fuente y volver a compilarlo y re-ejecutarlo para que tome los cambios.

[zerial@daila dwm-5.6.1]$ wc -l dwm.c
1959 dwm.c
[zerial@daila dwm-5.6.1]

Esto último, a muchos les puede provocar un trauma pero no es tan dificil como parece, aunque yo vengo de un entorno fluxbox por lo que cambiarme a dwm no me costó tanto.

Algunos screenshots:

dwm
dwm2

Todavía no lo modifico mucho, sólo configuré los workspaces, algunas aplicaciones y los atajos de teclado, pero acá les dejo mi configuración (fichero config.h).

  1. /* See LICENSE file for copyright and license details. */
  2.  
  3. /* appearance */
  4. static const char font[]            = "-*-terminus-medium-*-*-*-14-*-*-*-*-*-*-*";
  5. static const char normbordercolor[] = "#cccccc";
  6. static const char normbgcolor[]     = "#cccccc";
  7. static const char normfgcolor[]     = "#000000";
  8. static const char selbordercolor[]  = "green";
  9. static const char selbgcolor[]      = "black";
  10. static const char selfgcolor[]      = "green";
  11. static const unsigned int borderpx  = 1;        /* border pixel of windows */
  12. static const unsigned int snap      = 32;       /* snap pixel */
  13. static const Bool showbar           = True;     /* False means no bar */
  14. static const Bool topbar            = True;     /* False means bottom bar */
  15.  
  16. /* tagging */
  17. static const char *tags[] = { "www", "mail", "media", "terms1", "terms2", "terms3", "terms4", "terms5", "apps" };
  18.  
  19. static const Rule rules[] = {
  20.         /* class      instance    title       tags mask     isfloating   monitor */
  21.         { "Gimp",     NULL,       NULL,       1 < < 8,            True,        -1 },
  22.         { "Pidgin",     NULL,       NULL,       1 << 8,            True,        -1 },
  23.         { "psi",     NULL,       NULL,       1 << 8,            True,        -1 },
  24.         { "X-Chat",     NULL,       NULL,       1 << 8,            True,        -1 },
  25.         { "Zenity",     NULL,       NULL,       0,            True,        -1 },
  26. };
  27.  
  28. /* layout(s) */
  29. static const float mfact      = 0.55; /* factor of master area size [0.05..0.95] */
  30. static const Bool resizehints = True; /* False means respect size hints in tiled resizals */
  31.  
  32. static const Layout layouts[] = {
  33.         /* symbol     arrange function */
  34.         { "[]=",      tile },    /* first entry is default */
  35.         { "><>",      NULL },    /* no layout function means floating behavior */
  36.         { "[M]",      monocle },
  37. };
  38.  
  39. /* key definitions */
  40. #define MODKEY Mod1Mask
  41. #define TAGKEYS(KEY,TAG) \
  42.         { MODKEY,                       KEY,      view,           {.ui = 1 < < TAG} }, \
  43.         { MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
  44.         { MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
  45.         { MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
  46.  
  47. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  48. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  49.  
  50. /* commands */
  51. static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
  52. static const char *termcmd[]  = { "urxvt", NULL };
  53. static const char *webcmd[] = { "firefox", NULL };
  54. static const char *mailcmd[] = { "thunderbird", NULL };
  55. static const char *gimpcmd[] = { "gimp", NULL };
  56. static const char *twitcmd[] = { "twitsh", NULL };
  57.  
  58. static Key keys[] = {
  59.         /* modifier                     key        function        argument */
  60.         { MODKEY|ShiftMask,                     XK_f,   spawn,  {.v = webcmd } },
  61.         { MODKEY|ShiftMask,                     XK_m,   spawn,  {.v = mailcmd } },
  62.         { MODKEY|ShiftMask,                     XK_g,   spawn,  {.v = gimpcmd } },
  63.         { MODKEY|ShiftMask,                     XK_s,   spawn,  {.v = twitcmd } },
  64.         { MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
  65.         { MODKEY,             XK_x, spawn,          {.v = termcmd } },
  66.         { MODKEY,                       XK_b,      togglebar,      {0} },
  67.         { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
  68.         { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
  69.         { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
  70.         { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
  71.         { MODKEY,                       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_F1,                      0)
  86.         TAGKEYS(                        XK_F2,                      1)
  87.         TAGKEYS(                        XK_F3,                      2)
  88.         TAGKEYS(                        XK_F4,                      3)
  89.         TAGKEYS(                        XK_F5,                      4)
  90.         TAGKEYS(                        XK_F6,                      5)
  91.         TAGKEYS(                        XK_F7,                      6)
  92.         TAGKEYS(                        XK_F8,                      7)
  93.         TAGKEYS(                        XK_F9,                      8)
  94.         { MODKEY|ShiftMask,             XK_q,      quit,           {0} },
  95. };
  96.  
  97. /* button definitions */
  98. /* click can be a tag number (starting at 0),
  99.  * ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  100. static Button buttons[] = {
  101.         /* click                event mask      button          function        argument */
  102.         { ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
  103.         { ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
  104.         { ClkWinTitle,          0,              Button2,        zoom,           {0} },
  105.         { ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
  106.         { ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
  107.         { ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
  108.         { ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
  109.         { ClkTagBar,            0,              Button1,        view,           {0} },
  110.         { ClkTagBar,            0,              Button3,        toggleview,     {0} },
  111.         { ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
  112.         { ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
  113. };

Posts relacionados

Etiquetas: GNU/Linux · Mis cosas

9 respuestas hasta ahora ↓

  • 1
    Nano CHILE Linux Mozilla Firefox 3.5.1 // Ago 29, 2009 a las 2:02 pm

    Le andas copiando a osu. :)

    Yo no cambio mi wmii.

  • 2
    Chuby CHILE Windows XP Google Chrome 2.0.172.43 // Ago 29, 2009 a las 2:25 pm

    Usa enlightenment… :)

  • 3
    Zerial CHILE Linux Mozilla 1.9.1.2 // Ago 29, 2009 a las 4:33 pm

    @Nano el marica del osu usa gnome

    @Chuby naaaa, galletin nomas

  • 4
    Panic CHILE Debian GNU/Linux Mozilla Firefox 3.0.6 // Ago 30, 2009 a las 4:46 am

    leet jax0r

  • 5
    crosvera CHILE Linux Mozilla 1.9.1.2 // Ago 30, 2009 a las 3:12 pm

    Muy bueno DWM, lo ocupo hace un tiempo ya y es genial,

    saludos.

  • 6
    osu CHILE Linux Mozilla Firefox 3.1b3 // Sep 1, 2009 a las 12:53 am

    Mish, que es re maricon este: me vilipendia y yo que le recomende la mierda de wm. No te voy a dar los patches pa mover apps entre workspaces xD

  • 7
    Zerial CHILE Linux Mozilla 1.9.1.2 // Sep 1, 2009 a las 1:25 am

    @osu no importa, te los quito!!!!

    $ telnet osu.emma 31337
    Welcome to osu’s box!
    > dir
    xxx pr0n g4y sw1ng3r dwm-patches
    > get dwm-patches
    Downloading …. done
    > quit
    $

  • 8
    eLKcro Team » Blog Archive » Lo malo de los sistemas GNU/Linux es una de sus ventajas UNITED STATES WordPress 2.8.4 // Sep 26, 2009 a las 2:12 am

    [...] pero no para los que quieren empezar) para el desarrollo dentro de cualquier gestor de ventanas (claro los que usa Zerial no cuentan en este post) y es esa capacidad lo que lo convierte en la mejor ventaja, la DIVERSIDAD. [...]

  • 9
    Nuevo portatil: Lenoxo Thinkpad X200 | El rincón de Zerial UNITED STATES WordPress 2.8.6 // Nov 16, 2009 a las 11:03 pm

    [...] Obviamente le instalé Archlinux y continuo usando DWM. [...]

Deja un Comentario