You are not logged in.

#1 2014-11-14 00:38:47

Gwynplaine
Member
From: England.
Registered: 2014-11-11
Posts: 32

Autostarting multiple terminal programs?

Hi there,

Is there any way I can start multiple terminal programs using Awesome WM?

I'd like to start htop, alsamixer, cmatrix, irssi, moc and xfce-4 terminal. So essentially I'd like to start six alternate versions of xfce4-terminal on startup.

Offline

#2 2014-11-14 00:55:18

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

Re: Autostarting multiple terminal programs?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2014-11-14 01:12:36

Gwynplaine
Member
From: England.
Registered: 2014-11-11
Posts: 32

Re: Autostarting multiple terminal programs?

Thank you very much. I'll give it a go and let you know how I get on.

Offline

#4 2014-11-14 02:19:29

Gwynplaine
Member
From: England.
Registered: 2014-11-11
Posts: 32

Re: Autostarting multiple terminal programs?

I installed it from the official repositories but could not find the configuration files in ~/.tmux.conf,a /etc/tmux.conf or /usr/share/tmux/. I re-installed through yaourt (installing the git version) and have the same issue.

Edit:

Sorry for the double post.

Last edited by Gwynplaine (2014-11-14 02:19:43)

Offline

#5 2014-11-14 02:29:33

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Autostarting multiple terminal programs?

You create ~/.tmux.conf yourself.

Offline

#6 2014-11-14 02:29:46

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Autostarting multiple terminal programs?

Wait, what? Do you WANT to use tmux? You didn't say anything about tmux in your original post... Everything you want to do in your original post can be done without tmux.

Terminal emulators come with a standard command line option: "-e" It will execute a command. When the command ends, it will close the window.

xfce4-terminal -e alsamixer

Does that do what you need?

As for your other question, you have to create the tmux configuration files yourself.

Offline

#7 2014-11-14 02:36:29

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

Re: Autostarting multiple terminal programs?

drcouzelis wrote:

Wait, what? Do you WANT to use tmux?

That is a rhetorical question, right, Dr C? Of course OP wants tmux. It's like asking someone if they want Vim...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2014-11-14 03:05:48

Gwynplaine
Member
From: England.
Registered: 2014-11-11
Posts: 32

Re: Autostarting multiple terminal programs?

drcouzelis wrote:

Wait, what? Do you WANT to use tmux? You didn't say anything about tmux in your original post...

I didn't know it existed until Jasonwryan's post.

drcouzelis wrote:

Terminal emulators come with a standard command line option: "-e" It will execute a command. When the command ends, it will close the window.

xfce4-terminal -e alsamixer

Does that do what you need?

This does do what I wanted, but the issue is that I need to call it in rc.lua for Awesome WM. What I have is this:

-- {{{
--Autostart Programs

awful.util.spawn_with_shell("xfce4-terminal -e htop")
awful.util.spawn_with_shell("xfce4-terminal -e cmatrix")
...
-- }}}

-- {{{ Rules
 awful.rules.rules = {
     -- All clients will match this rule.
     { rule = { },
       properties = { border_width = beautiful.border_width,
                      border_color = beautiful.border_normal,
                      focus = true,
                      keys = clientkeys,
                      buttons = clientbuttons } },
 { rule = { class = "xfce4-terminal" },
         properties = { tag = tags[1][5] } },
...
--}}}

This works fine, but I want three programs to open in one tag, and the other three in another tag.

Is there a way I can change the WM_CLASS(STRING) for each version of xfce4-terminal?  Or would it be better to use Tmux?

Offline

#9 2014-11-14 03:11:13

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,776
Website

Re: Autostarting multiple terminal programs?

Gwynplaine wrote:

Is there a way I can change the WM_CLASS(STRING) for each version of xfce4-terminal?  Or would it be better to use Tmux?

While I am a fan of tmux, I'd suggest not bothering with it (yet).  Tmux will not help you with your current goals.

With most terminal emulators you can set the resource class name, but I just checked the xfce4-terminal man page and I didn't see such an option.  Are you sold on using xfce4-terminal, or would urxvt suffice?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2014-11-14 03:14:22

Gwynplaine
Member
From: England.
Registered: 2014-11-11
Posts: 32

Re: Autostarting multiple terminal programs?

I'm willing to use other terminals. I've just been using xfce4-terminal for a number of years.

I'll check out the one you just mentioned.

Edit:

It'll probably take me a long time to customise this and get this up and running.

Looking through the arch wiki though, I can't see anything regarding setting the window class?

Last edited by Gwynplaine (2014-11-14 03:29:54)

Offline

#11 2014-11-14 12:28:12

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Autostarting multiple terminal programs?

jasonwryan wrote:

That is a rhetorical question, right, Dr C? Of course OP wants tmux. It's like asking someone if they want Vim...

You know, I really can't argue with either of those points.

...Although maybe not Arch Linux and Vim and tmux all at once. I mean, sure, I want a cake, a pie, brownies, and chocolate chip cookies, but not all in one evening. Just one at a time, little by little. smile

Offline

#12 2014-11-14 15:37:52

Gwynplaine
Member
From: England.
Registered: 2014-11-11
Posts: 32

Re: Autostarting multiple terminal programs?

So I'm trying to work this out. I've read this page https://wiki.archlinux.org/index.php/X_resources and understand how to change the resource class of the terminal, but how do I give different terminals different resource classes?

Offline

#13 2014-11-14 15:44:55

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Autostarting multiple terminal programs?

https://bbs.archlinux.org/viewtopic.php?id=83663

Does this answer your question?

Offline

#14 2014-11-14 16:31:39

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,776
Website

Re: Autostarting multiple terminal programs?

You wouldn't want to set it in the Xresources file, you'd want to set it on the command line.  This is what I was the ability I was referring to that I think xfce4-terminal lacks.  Several other terminals (including urxvt) can have these options selected on the command line, so you could do something like the following (note I don't use awesome, I'm just revising your previously posted excerpt - particulalry I don't know why "tags" is a 2-d array, and I don't know which index should change):

-- {{{
--Autostart Programs

awful.util.spawn_with_shell("urxvt -name awesomeTag1 -e htop")
awful.util.spawn_with_shell("urxvt -name awesomeTag2 -e cmatrix")
...
-- }}}

-- {{{ Rules
 awful.rules.rules = {
     -- All clients will match this rule.
     { rule = { },
       properties = { border_width = beautiful.border_width,
                      border_color = beautiful.border_normal,
                      focus = true,
                      keys = clientkeys,
                      buttons = clientbuttons } },
 { rule = { class = "awesomeTag1" },
         properties = { tag = tags[1][5] } },
 { rule = { class = "awesomeTag2" },
         properties = { tag = tags[2][5] } },
...
--}}}

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#15 2014-11-14 19:30:55

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

Re: Autostarting multiple terminal programs?

tmux would kill here: autostart all your programs in two named tmux sessions, and send the respective tmux sessions to the awesome tags you want...

It also means you only have to edit your tmux.conf to add new programs to either session.


Don't listen to the others, they are lying: YOU WANT TMUX!!*




*Use my referral code, jwr, when installing for a 10% discount. ACT NAOW!


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#16 2014-11-14 20:14:14

Gwynplaine
Member
From: England.
Registered: 2014-11-11
Posts: 32

Re: Autostarting multiple terminal programs?

Hi everyone.

I now have multiple terminal programs running using urxvt -name, which works great. However, I can't get them to shift to different tags. I've tried quite a few different methods, but I can't seem to get it working.

Using xprop I can determine that the window class is (using ranger as an example) is:

 WM_COMMAND(STRING) = { "urxvt", "-name", "RANGER", "-e", "ranger" }

but in the rules section, I've tried multiple variations and nothing seems to work.

-- {{{
--Autostart Programs

awful.util.spawn_with_shell("urxvt -name HTOP -e htop")
awful.util.spawn_with_shell("urxvt -name RANGER -e ranger")
awful.util.spawn_with_shell("urxvt -name CMATRIX -e cmatrix")
--awful.util.spawn_with_shell("urxvt")
--awful.util.spawn_with_shell("")
-- }}} 


-- {{{ Rules
 awful.rules.rules = {
     -- All clients will match this rule.
     { rule = { },
       properties = { border_width = beautiful.border_width,
                      border_color = beautiful.border_normal,
                      focus = true,
                      keys = clientkeys,
                      buttons = clientbuttons } },
     
       { rule = { class = "HTOP" },
         properties = { tag = tags[1][4] } },
       { rule = { class = "urxvt -name RANGER -e ranger" },
        properties = { tag = tags[1][4] } },
       { rule = { class = "urxvt", "-name", "CMATRIX", "-e", "cmatrix" },
         properties = { tag = tags[1][4] } },
...
-- }}}

Also, Trilby with Awesome WM tag essentially refers to a virtual desktop. With regards to the 2-D array, I believe the first digit refers to the monitor but the second refers to the tag you want to place it in.

Edit:

I think I will give Tmux a go. It does seem incredibly useful.

Last edited by Gwynplaine (2014-11-14 20:15:51)

Offline

#17 2014-11-14 20:40:48

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

Re: Autostarting multiple terminal programs?

In dwm (Awesome's superior precursor smile ), I use titles:

{ "urxvtc", "-title", "mutt", "-e", "mutt", NULL };

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB