You are not logged in.

#1 2010-10-31 04:13:03

Sara
Member
From: USA
Registered: 2009-07-09
Posts: 219
Website

Mathematica Doesn't Quite Obey Tag Rule in DWM

I used the xprop command given here to identify Mathematica, as follows:

xprop |awk '
/^WM_CLASS/{sub(/.* =/, "instance:"); sub(/,/, "\nclass:"); print}
/^WM_NAME/{sub(/.* =/, "title:"); print}'
title: "Untitled-1"
instance: "XMathematica"

I then assigned Mathematica to tag 3, with this line in my config.h:

{ NULL,                  "XMathematica",    NULL,       1 << 2,        False },

But Mathematica only opens in tag 3 if I restart dwm (it's in a while loop, so I restart it using the script given in the dwm article at the Archwiki). Otherwise, it opens in the current tag. No other program doesn't follow my tag rules. Does anyone else have similar issue, or have an idea what could be up?

I'm running dwm 5.5, with the bstack, pertag, bstack.horiz, fibonacci, cellwriter, pango, tilemovemouse, and monocole patches.

My full config.h:

/* See LICENSE file for copyright and license details. */

/* appearance */
static const char font[]            = "kroeger 05_55 caps 6";
static const char normbordercolor[] = "#ffffff";
static const char normbgcolor[]     = "#ffffff";
static const char normfgcolor[]     = "#222222";
static const char selbordercolor[]  = "#42b1e1";
static const char selbgcolor[]      = "#ffffff";
static const char selfgcolor[]      = "#42b1e1";
static unsigned int borderpx        = 0;        /* 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 */

/* tagging */
static const char tags[][MAXTAGLEN] = { "xoj", "pdf", "nb", "www", "cli"};
static unsigned int tagset[] = {1, 1}; /* after start, first tag is selected */

static Rule rules[] = {
    /* class                 instance           title       tags mask      isfloating */
    { "Cellwriter",          NULL,              NULL,       ~0,            True },
    { "Easystroke",          NULL,              NULL,       0,             False },
    { "Pychrom",             NULL,              NULL,       0,             True },
    { "Xournal",             NULL,              NULL,       1 << 0,        False },
    { "MuPDF",               NULL,              NULL,       1 << 1,        False },
    { NULL,                  "XMathematica",    NULL,       1 << 2,        False },
    { "Mplayer",             NULL,              NULL,       1 << 3,        True },
    { "surf",                NULL,              NULL,       1 << 3,        False },
    { "Chromium",            NULL,              NULL,       1 << 3,        False },
    { "Pidgin",              NULL,              NULL,       1 << 3,        True },
    { "URxvt",               NULL,              NULL,       1 << 4,        False },
};

/* layout(s) */
static float mfact      = 0.55; /* factor of master area size [0.05..0.95] */
static Bool resizehints = False; /* False means respect size hints in tiled resizals */

#include "bstack.c"
#include "bstackhoriz.c"
#include "fibonacci.c"
static Layout layouts[] = {
    /* symbol     arrange function */
    { "[]=",      tile },    /* first entry is default */
    { "><>",      NULL },    /* no layout function means floating behavior */
    { "[M]",      monocle },
    { "TTT",      bstack },
    { "===",      bstackhoriz },
    { "[@]",      spiral },
    { "[\\]",     dwindle },
};

/* key definitions */
#define MODKEY Mod1Mask
#define TAGKEYS(KEY,TAG) \
    { 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", NULL};
static const char *termcmd[]     = { "urxvt", NULL };
static const char *rotatecmd[]   = { "/home/sara/.scripts/rotate.sh", NULL };
static const char *scrollupcmd[] = { "xte", "mouseclick 4", NULL };
static const char *scrolldncmd[] = { "xte", "mouseclick 5", NULL };
static const char *printcmd[]    = { "scrot", NULL };
static const char *mathcmd[]     = { "mathematica", NULL };
static const char *notecmd[]     = { "xournal", NULL };
static const char *webcmd[]      = { "sr", "-g", "google", NULL };
static const char *raisevolcmd[] = { "/home/sara/.scripts/raisevol.sh", NULL };
static const char *lowvolcmd[]   = { "/home/sara/.scripts/lowvol.sh", NULL };
static const char *mutvolcmd[]   = { "/home/sara/.scripts/mutevol.sh", NULL };

#include <X11/XF86keysym.h>
static Key keys[] = {
    /* modifier                     key                         function        argument */
    { MODKEY,                       XK_p,                       spawn,          {.v = dmenucmd } },
    { MODKEY|ShiftMask,             XK_Return,                  spawn,          {.v = termcmd } },
    { MODKEY,                       XF86XK_Launch3,             spawn,          {.v = webcmd } },
    { 0,                            XF86XK_Launch3,             spawn,          {.v = rotatecmd } },
    { 0,                            XF86XK_ScrollUp,            spawn,          {.v = scrollupcmd } },
    { MODKEY,                       XF86XK_ScrollUp,            spawn,          {.v = mathcmd } },
    { 0,                            XF86XK_ScrollDown,          spawn,          {.v = scrolldncmd } },
    { MODKEY,                       XF86XK_ScrollDown,          spawn,          {.v = notecmd } },
    { 0,                            XK_Print,                   spawn,          {.v = printcmd } },
    { 0,                            XF86XK_AudioRaiseVolume,    spawn,          {.v = raisevolcmd } },
    { 0,                            XF86XK_AudioLowerVolume,    spawn,          {.v = lowvolcmd } },
    { 0,                            XF86XK_AudioMute,           spawn,          {.v = mutvolcmd } },
    { MODKEY,                       XK_b,                       togglebar,      {0} },
    { MODKEY,                       XK_j,                       focusstack,     {.i = +1 } },
    { MODKEY,                       XK_k,                       focusstack,     {.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_r,                       setlayout,      {.v = &layouts[3]} },
    { MODKEY,                       XK_o,                       setlayout,      {.v = &layouts[4]} },
    { MODKEY,                       XK_s,                       setlayout,      {.v = &layouts[5]} },
    { MODKEY,                       XK_d,                       setlayout,      {.v = &layouts[6]} },
    { MODKEY,                       XK_space,                   setlayout,      {0} },
    { MODKEY|ShiftMask,             XK_space,                   togglefloating, {0} },
    { MODKEY,                       XK_0,                       view,           {.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)
    { MODKEY|ShiftMask,             XK_q,                       quit,           {0} },
};

#include "tilemovemouse.c"
/* button definitions */
/* click can be a tag number (starting at 0),
 * 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,        tilemovemouse,  {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} },
};

Appreciate the help smile.

[Edit] Adding to the strangeness, Mathematica's documentation always starts up as a floating window, until I restart dwm with Mod-Shift-Q. This is wierd. Mathematica notebooks I create are properly tiled. [/Edit]

Last edited by Sara (2010-11-01 10:11:16)


Registed Linux User 483618

Offline

Board footer

Powered by FluxBB