You are not logged in.
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
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
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
Hello Tillotson!
Can you start some applications from .xinitrc ?
Offline
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
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 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
Not at all. Appreciate the help
Offline