You are not logged in.

#1 2015-05-02 01:45:49

derrickcope
Member
Registered: 2015-04-30
Posts: 15

[solved]DWM rules for opening terminal based apps

These are the rules that I have in my dwm config.h
The ncurses apps that open in the terminal do not follow the rules. How can accomplish this?

 

static const Rule rules[] = {
	  /* class      instance    title       tags mask     isfloating   monitor */
	  { "Gimp",     NULL,       NULL,       0,            True,        -1 },
	  { "Firefox",  NULL,       NULL,       1 << 3,       False,       -1 },
	  { "Pcmanfm",  NULL,       NULL,       1 << 1,       False,       -1 },
	  { "ranger",   NULL,       NULL,       1 << 6,       False,       -1 },
	  { "mutt",     NULL,       NULL,       1 << 7,       False,       -1 },
	  { "ncmpc",    NULL,       NULL,       1 << 8,       False,       -1 },

Last edited by derrickcope (2015-05-02 05:26:14)

Offline

#2 2015-05-02 02:01:01

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [solved]DWM rules for opening terminal based apps

I have asked you before to please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Fo … s_and_code


For a rule, you use xprop to determine the window's name or title (or, alternatively, set one when you launch the term with the -title switch).


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2015-05-02 02:57:31

derrickcope
Member
Registered: 2015-04-30
Posts: 15

Re: [solved]DWM rules for opening terminal based apps

thanks for the suggestion. xprop just sees them as "terminator". When I start them with -T "title" then xprop sees them with "title".
When I used the -T switch in .xinitrc and then changed my rules to

static const Rule rules[] = {
	/* class      instance    title       tags mask     isfloating   monitor */
	{ "Gimp",     NULL,       NULL,       0,            True,        -1 },
	{ "Firefox",  NULL,       NULL,       1 << 3,       False,       -1 },
	{ "Pcmanfm",  NULL,       NULL,       1 << 1,       False,       -1 },
	{ "ranger",   NULL,       "ranger",   1 << 6,       False,       -1 },
	{ "mutt",     NULL,       "mutt",     1 << 7,       False,        2 },
	{ "ncmpc",    NULL,       "ncmpc",    1 << 8,       False,        2 },

They are still opening on the first monitor and not on the tag I set. I am not sure I am doing it correctly. Should I write terminator as the class?

Offline

#4 2015-05-02 03:01:56

derrickcope
Member
Registered: 2015-04-30
Posts: 15

Re: [solved]DWM rules for opening terminal based apps

This is what I see with xprop:

WM_CLASS(STRING) = "terminator", "Terminator"
WM_ICON_NAME(STRING) = "ncmpc"
_NET_WM_ICON_NAME(UTF8_STRING) = "ncmpc"
WM_NAME(STRING) = "ncmpc"
_NET_WM_NAME(UTF8_STRING) = "ncmpc"

seems like it should work, right?

Offline

#5 2015-05-02 03:39:54

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [solved]DWM rules for opening terminal based apps

To make this rule work, so ranger opens in tag 7:

{ "ranger",   NULL,       "ranger",   1 << 6,       False,       -1 },

You would start ranger with a command/keybind combo:

static const char   *fmcmd[] = { "urxvtc", "-title", "ranger", "-e", "ranger", NULL };
...
{ ControlMask|Mod1Mask,         XK_r,      spawn,          {.v = fmcmd } },

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2015-05-02 04:09:43

derrickcope
Member
Registered: 2015-04-30
Posts: 15

Re: [solved]DWM rules for opening terminal based apps

I am autostarting ranger from the .xinitrc and with xbindkeys.

This is what I have in .xinitrc

terminator -T "ranger" -e terminator &

I havent edited xbindkey yet. man terminator says it uses -T for "title" or -c for "class".

Offline

#7 2015-05-02 04:36:12

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [solved]DWM rules for opening terminal based apps

For mutt, set the title and

{ NULL,     NULL,       "mutt",     1 << 7,       False,        1 },

mutt will open on tag 8 on your primary monitor, irrespective of where the focus is. -1 will open it on the currently focussed monitor.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2015-05-02 05:25:30

derrickcope
Member
Registered: 2015-04-30
Posts: 15

Re: [solved]DWM rules for opening terminal based apps

Yes, thank you! changing class to NULL fixed it. Thank you!

Offline

#9 2015-05-02 08:32:40

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [solved]DWM rules for opening terminal based apps

derrickcope wrote:

Yes, thank you! changing class to NULL fixed it. Thank you!

Or you could look at the class names in the xprop output you posted (without code tags tongue) in #4.

Offline

#10 2015-05-02 10:05:25

derrickcope
Member
Registered: 2015-04-30
Posts: 15

Re: [solved]DWM rules for opening terminal based apps

Raynman wrote:
derrickcope wrote:

Yes, thank you! changing class to NULL fixed it. Thank you!

Or you could look at the class names in the xprop output you posted (without code tags tongue) in #4.

tried that, didn't work smile

Offline

Board footer

Powered by FluxBB