You are not logged in.

#1 2013-08-29 10:46:48

xtremyst
Member
Registered: 2011-11-21
Posts: 331

autostarting ncmpcpp [solved]

I tried to create a specific workstation for my music player but I'm having some
difficulties on autostarting  ncmpcpp...
First i tried

assign [class="Lxterminal"] 2: music
exec_always --no-startup-id lxterminal -e ncmpcpp

When i restart i3 it works fine, however when i reboot and (auto)login the "2:music" workspace
seems to appear and instantly disappear...
I also tried

assign [instance="ncmpcpp"] 2: music
exec_always --no-startup-id urxvt -name ncmpcpp -e ncmpcpp

with the same result.
Is it possible that ncmpcpp starts too early (and thats why i'm having this issue
after boot and not when i simply restart i3) ? any ideas?

PS yes, mpd.service is enabled...

Last edited by xtremyst (2013-09-02 07:16:49)

Offline

#2 2013-08-29 10:56:55

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: autostarting ncmpcpp [solved]

You could try i3-msg

$execi i3-msg 'workspace 3:Web; exec /usr/bin/firefox; layout tabbed'

$execi is exec --no-startup-id

Or try wrapping command in single quotes


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#3 2013-08-29 12:18:48

oliver
Administrator
Registered: 2010-11-04
Posts: 2,209

Re: autostarting ncmpcpp [solved]

when you start i3 you can redirect the output to a file... that should show you why it's error-ing out

exec /usr/bin/i3 > ~/.i3_startup.log 2>&1

Offline

#4 2013-08-30 06:14:27

xtremyst
Member
Registered: 2011-11-21
Posts: 331

Re: autostarting ncmpcpp [solved]

thanks for the tips, unfortunately i'll be away for a few days, i'll try them as soon as i get back and report back.

Offline

#5 2013-09-02 03:58:28

xtremyst
Member
Registered: 2011-11-21
Posts: 331

Re: autostarting ncmpcpp [solved]

no luck so far.
I tried olivers suggestion but it didnt give anything related to ncmpcpp (or urxvt).
I also tried

execi i3-msg 'workspace 2: music, exec urxvt -name ncmpcpp -e ncmpcpp'

but didnt have any luck with that either. In fact with this last command i had to press Mod4+x (bindsym for ncmpcpp)
two or three times in order to launch ncmpcpp, even when i was already logged in...
I've been closer to what i'm trying to achieve with this config

#Assign client to specific workspaces
assign [class="Spacefm"] 3: files
assign [instance="ncmpcpp"] 2: music

#Autostart applications
exec_always --no-startup-id spacefm
exec_always --no-startup-id urxvt -name ncmpcpp -e ncmpcpp

and it works fine when i'm loged in and launch ncmpcpp manually or when i restart i3...
For some reason it refuses to work (autostart) when i reboot and autologin... workspace 2 appears and disappears immediately... it seems that ncmpcpp tries to start and for some reason it fails and i have to launch it manually in order to work as it's supposed to...
PS autostarting spacefm and assigning it to workspace 3 works in every case...

Last edited by xtremyst (2013-09-02 04:03:40)

Offline

#6 2013-09-02 06:07:02

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: autostarting ncmpcpp [solved]

execi i3-msg 'workspace 2: music, exec urxvt -name ncmpcpp -e ncmpcpp'

execi is wrong I use $execi change it too exec and try again, the comma after music might need to be a ;


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#7 2013-09-02 06:39:31

xtremyst
Member
Registered: 2011-11-21
Posts: 331

Re: autostarting ncmpcpp [solved]

looks like i solved it, i changed

exec_always --no-startup-id urxvt -name ncmpcpp -e ncmpcpp

and tried

exec_always --no-startup-id sleep 7 && urxvt -name ncmpcpp -e ncmpcpp

rebooted and ncmpcpp autostarts fine. I also tried different values but it seems that it needs at least 7 seconds to start right.
What i cannot understand is what ncmpcpp's waiting for... is this related to mpd binding to an adress???
Although it's (kinda) solved, I'll try again your suggestion Mr Green and see if it changes anything...

Offline

#8 2013-09-02 06:55:13

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: autostarting ncmpcpp [solved]

I have never had any luck with mpd would have thought that it takes time to get server up and running so maybe the problem. If you turn it into a small script you can at least add 'sleep' to allow for starting. With i3 there are many different ways to start,run,place. As I am old I try very hard to keep things simple.


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#9 2013-09-02 07:13:47

xtremyst
Member
Registered: 2011-11-21
Posts: 331

Re: autostarting ncmpcpp [solved]

i tried again with

exec i3-msg 'workspace 2: music, exec urxvt -name ncmpcpp -e ncmpcpp'

and

exec i3-msg 'workspace 2: music; exec urxvt -name ncmpcpp -e ncmpcpp'

and none of them worked, in fact the only change was i3 starting straight from worlstation 2. But no ncmpcpp at all.
Anyway i'll stick to the line that worked and use the sleep option... after some testing i found that sometimes 7 seconds are not enough,so i'll give it 8 or 9 just to be sure.
To be totally honest i find mpd way complicated too and  i dont understand all the mpd.conf parameters... i just tested and googled a few things and somehow made it work and
since i got what i wanted never touched it again...

Offline

#10 2013-09-02 08:53:58

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: autostarting ncmpcpp [solved]

For everyone else there is cmus


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

Board footer

Powered by FluxBB