You are not logged in.

#1 2011-06-21 02:25:31

ictoancb
Member
Registered: 2011-06-01
Posts: 4

[SOLVED] Awesome WM rc.lua rules for CLI programs

Hi, I'm new to Arch and I'm using the awesome window manager, I have set up rules in the rc.lua that force programs to run in a certain tag. I have been trying to do this for command line programs like weechat, so that for example weechat only runs in tag 7. but I have not been able to do this. is it possible to setup rules for command line programs? if so how do I do it?

Last edited by ictoancb (2011-06-21 12:42:49)

Offline

#2 2011-06-21 02:31:23

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

Re: [SOLVED] Awesome WM rc.lua rules for CLI programs

You can use the window properties: https://awesome.naquadah.org/wiki/FAQ#H … tifiers.3F


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2011-06-21 02:37:21

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: [SOLVED] Awesome WM rc.lua rules for CLI programs

Also, all your command-line 'programs' actually appear to awesome to be instances of whatever terminal you're using. So you'd probably better define them based on terminal name.

Or you could just use tmux/screen and keep the whole terminal maximized.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#4 2011-06-21 02:54:24

ictoancb
Member
Registered: 2011-06-01
Posts: 4

Re: [SOLVED] Awesome WM rc.lua rules for CLI programs

So the only way to do it is to setup the rule for the terminal?

Offline

#5 2011-06-21 03:06:22

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

Re: [SOLVED] Awesome WM rc.lua rules for CLI programs

In a manner of speaking, yes. A rule for the specific instance of the terminal, eg., launching urxvt -title weechat etc...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2011-06-21 03:11:44

ictoancb
Member
Registered: 2011-06-01
Posts: 4

Re: [SOLVED] Awesome WM rc.lua rules for CLI programs

Thanks. What I wanted to do was to have different terminal based programs forced to different tags, but the only way to do that I think would be to use a different terminal for each program and then setup the rules for each individual terminal. Which doesn't quite work how I wanted. But thanks for the quick replies and the help.

Last edited by ictoancb (2011-06-21 03:12:14)

Offline

#7 2011-06-21 03:18:12

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

Re: [SOLVED] Awesome WM rc.lua rules for CLI programs

If I understand you correctly, you can have a rule for, eg,

urxvtc -title weechat --> tag 1
urxvtc -title mutt --> tag 2
urxvtc -title vifm --> tag 3

etc...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2011-06-21 11:55:17

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: [SOLVED] Awesome WM rc.lua rules for CLI programs

ictoancb wrote:

Thanks. What I wanted to do was to have different terminal based programs forced to different tags, but the only way to do that I think would be to use a different terminal for each program and then setup the rules for each individual terminal. Which doesn't quite work how I wanted. But thanks for the quick replies and the help.

Unless you're using a terminal emulator there's no other way than to have one or more different terminal for each application, is there?

Here's what I'd do:

.bashrc:

alias irssi="urxvt -name irssi -e irssi"

rc.lua

awful.key({modkey},  "a",  function () exec ("urxvt -name irssi -e irssi") end),
[...]
 { rule = { name = "irssi" },
      properties = { tag = tags[1][1], switchtotag = true }
 },

Now, whenever you press Mod4+A or type irssi in your terminal a urxvt instance with irssi will get spawned on tag 1 of screen 1.

Personally, I'd use run or raise instead of a normal keybind.

awful.key({modkey},  "a",     function () run_or_raise("urxvt -name irssi -e irssi", { instance = "irssi" }) end),

P.S.: Run-or-raise will look if there's already a window with the instance "irssi" and raise it, before spawning a new one, so you don't end up with multiple irssi instances.

Last edited by demian (2011-06-21 11:57:08)


no place like /home
github

Offline

#9 2011-06-21 12:37:16

ictoancb
Member
Registered: 2011-06-01
Posts: 4

Re: [SOLVED] Awesome WM rc.lua rules for CLI programs

Thanks demian that worked.

Offline

Board footer

Powered by FluxBB