2

I am trying to come up with a command that will launch cmus in a terminal and projectM-pulseaudio right next to it (I am using i3 window manager).

When I try

projectM-pulseaudio && cmus

cmus does not start until I close ProjectM. And when I try

cmus && projectM-pulseaudio

Then ProjectM does not start until I quit cmus.

I understand that cmus is a command-line based tool while ProjectM isn't. I wanter if that's why it is not working or if there is anothe reason. Any thoughts?

  • @EightBitTony yes, run both applications at once. In i3, since it is a tiling window manager, two programs will share the screen exactly in the midline so I want cmus on the left side and ProjectM on the right side. Your command produces syntax error bash: syntax error near unexpected token ;'` – Oposum Jun 28 '17 at 20:49
3

When you type

utility1 && utility2

this means that utility2 won't start until utility1 have terminated with a zero exit status (but not otherwise).

Likewise,

utility1 || utility2

means that utility2 will run if utility1 terminates with a non-zero exit status (but not otherwise).

With

utility1 & utility2 &

which is the same as

utility1 &
utility2 &

you start both utilities as background processes (both will start independently of each other), and with

utility1 & utility2

which is the same as

utility1 &
utility2

you start utility1 as a background process and then utility2 as a foreground process.

This means, coincidentally, that the title of your question got it right:

cmus & projectM-pulseaudio

or possibly

projectM-pulseaudio & cmus

(but I don't know what these programs do, so I'm not not sure if it makes sense to run one or the other, or both, as a background process).

  • I see what you mean. Still, when I launch cmus & projectM-pulseaudio cmus doesn't start. Maybe the problem is that is a command-line based program, not a GUI. For example, firefox & projectM-pulseaudio works just fine and opens both. If you don't have cmus, you can try any other command-line program. – Oposum Jun 28 '17 at 20:52
  • @Oposum If cmus needs the input from the terminal, it can't run as a background job. Use projectM-pulseaudio & cmus instead. – Kusalananda Jun 28 '17 at 20:54
  • tried it, cmus still doesn't start. I understand you may be infamiliar with these programs but you can try any other two programs, one command-line and another one with GUI. – Oposum Jun 28 '17 at 20:56
  • You'll need to tell us what 'doesn't start' means and if there's any error message. – EightBitTony Jun 28 '17 at 21:02
  • @Oposum With xterm (terminal emulator that opens its own window) and mutt (terminal-based email client), xterm & mutt "works", i.e. xterm opens its window and mutt starts in the terminal where I typed the command. – Kusalananda Jun 29 '17 at 6:30
0

I am trying to come up with a command that will launch cmus in a terminal and projectM-pulseaudio right next to it (I am using i3 window manager).

That's not the i3 way. I think what you want is something like this,

bindsym $mod+v exec projectM-pulseaudio, exec kitty cmus

Note, you'll have to know how your terminal works. Though I suggest you use kitty, because it's easily the most feature bad ass terminal with ligature and graphic support -- it'll render pictures with Ranger on a framebuffer.

If you want a shell in addition to cmus (so when you're done it doesn't exit)

bindsym $mod+v exec projectM-pulseaudio, exec kitty bash -c'cmus'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.