You are not logged in.

#1 2009-08-29 22:28:21

Tillotson
Member
Registered: 2009-05-09
Posts: 23

[SOLVED] Tag terminal apps

What I really want is a big startup script which will start dwm and all the programs I use in their proper tags.

Problem is rules are defined as per WM_CLASS.

I suppose I'd like to add rules to commands so that they will open in specific tags.

Is this possible in dwm (or any other WM for that matter)?

Last edited by Tillotson (2009-08-30 07:32:25)

Offline

#2 2009-08-29 23:02:25

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [SOLVED] Tag terminal apps

Sure -- in dwm's config.h

static const char *tags[] = { "t", "n", "c", "m", "g", "v", "o" };

defines the tag names and

static const Rule rules[] = {
        /* class      instance    title       tags mask     isfloating   monitor */
        { "Gimp",     NULL,       NULL,        1 << 4,            True,        -1 },
        { "Inkscape",     NULL,       NULL,        1 << 4,            False,        -1 },
        { "Gnome-mplayer",     NULL,       NULL,        1 << 3,            True,        -1 },
        { "Mplayer",     NULL,       NULL,        1 << 3,            True,        -1 },
        { "Shiretoko",  NULL,       NULL,       1 << 1,       False,       -1 },
        { "Evince",  NULL,       NULL,       1 << 6,       False,       -1 },
        { "OpenOffice",  NULL,       NULL,       1 << 6,       False,       -1 },
        { NULL,  NULL,       "Terminal",       1 << 0,       False,       -1 },
        { NULL,  NULL,       "mutt",       1 << 2,       False,       -1 },
        { NULL,  NULL,       "ncmpcpp",       1 << 3,       False,       -1 },
        { NULL,  NULL,       "irssi",       1 << 2,       False,       -1 },
        { "Wfica_Seamless",  NULL,       NULL,       1 << 2,       True,       -1 },
        { "VirtualBox",  NULL,       NULL,       1 << 5,       False,       -1 },
};

defines the tags for applications.  You can use xprop to get the attributes for various windows.
To start them on login, you just add them to your .xinitrc -before the 'exec startdwm' or whatever you use to start your WM. Remember to add an & after each program.

Scott

Offline

#3 2009-08-29 23:57:07

Tillotson
Member
Registered: 2009-05-09
Posts: 23

Re: [SOLVED] Tag terminal apps

Excellent. Thanks very much.

I didn't get that you could use NULL for class in the rules array.

Starting apps and sending them to a specific tag was getting tedious:)

Offline

#4 2009-08-30 01:21:22

djszapi
Member
From: Cambridge, United Kingdom
Registered: 2009-06-14
Posts: 1,439
Website

Re: [SOLVED] Tag terminal apps

Hello Tillotson!

Can you start some applications from .xinitrc ?

Offline

#5 2009-08-30 02:36:12

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [SOLVED] Tag terminal apps

Glad it worked for you smile Just make sure to add [SOLVED] to the title of your first post if it's all working for you.

Scott

Offline

#6 2009-08-30 07:31:33

Tillotson
Member
Registered: 2009-05-09
Posts: 23

Re: [SOLVED] Tag terminal apps

Autostarting programs within .xinitrc doesn't guarantee that they are started in their proper tags (because dwm needs to be started first(?)).

Anyway a way around this is to have a seperate autostart script with a "sleep 1" at the top.

Is there a better way? Is this what other people do?

Offline

#7 2009-08-30 08:44:19

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [SOLVED] Tag terminal apps

I only tested that with firefox -- it seemed to start in the right tag, but maybe only because it takes a moment to start. What you suggested sounds reasonable smile I don't start any gui or terminal programs from .xinitrc, just things like ssh tunnels, wallpaper switcher script, conky, X keymapping stuff, and urxvtd. Hope I didn't lead you astray!

Scott

Offline

#8 2009-08-30 09:30:03

Tillotson
Member
Registered: 2009-05-09
Posts: 23

Re: [SOLVED] Tag terminal apps

Not at all. Appreciate the help

Offline

Board footer

Powered by FluxBB