You are not logged in.

#1 2015-11-19 21:12:58

sanchostache
Member
Registered: 2015-11-19
Posts: 6

Running shell commands on startup?

I have a .screenlayout config I want to run on startup but I can't seem to figure out how to add it to the autostart config. I also want to run the command "sudo service plexmediaserver start" so I can get my plex media server started on boot. Any suggestions? Sorry for the newbie questions but I'm really enjoying learning this.

Offline

#2 2015-11-19 21:19:23

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,370
Website

Re: Running shell commands on startup?

For the first one you could just add a call to it to the .config/openbox/autostart, like

~/bin/changeres &

2nd one, check if /etc/init.d/ has a plex*something file in it and its marked as executable, if not

sudo chmod +x /ect/init.d/plex*stuff
# or
sudo systemctl enable plex*stuff

(And it should autostart from now on).

Last edited by brontosaurusrex (2015-11-19 21:24:05)

Offline

#3 2015-11-19 21:23:46

damo
....moderator....
Registered: 2015-08-20
Posts: 6,701

Re: Running shell commands on startup?

` arandr` saves layouts in ~/.screenlayout as an executable file. Just add that to your autostart with

./layout-name.sh &

Enable services at startup with

sudo systemctl enable foo 

Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#4 2015-11-19 21:26:52

sanchostache
Member
Registered: 2015-11-19
Posts: 6

Re: Running shell commands on startup?

brontosaurusrex wrote:

For the first one you could just add a call to it to the .config/openbox/autostart, like

~/bin/changeres &

2nd one, check if /etc/init.d/ has a plex*something file in it and its marked as executable, if not

sudo chmod +x /ect/init.d/plex*stuff
# or
systemctl enable plex*stuff

(And it should autostart from now on).


I'm not sure what you mean by ~/bin/changeres &... I have 2 monitors and in ARandR I adjusted the monitors to my liking and hit "save as" and now it's a shell script in /home/.screenlayouts

Also, there is an executable for "plexmediaserver" in /etc/init.d/ but not sure how to actually get it to autostart

Offline

#5 2015-11-19 21:36:21

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: Running shell commands on startup?

You need to edit the systemd unit file supplied with Plex then re-create the Plex user group and add your user to that group (apparently -- I had never heard of Plex until approx. 2 minutes ago...)

See https://forums.plex.tv/discussion/comme … ent_916656

You may receive better assistance on the Plex forums.

Last edited by Head_on_a_Stick (2015-11-19 21:39:21)


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#6 2015-11-19 21:38:44

sanchostache
Member
Registered: 2015-11-19
Posts: 6

Re: Running shell commands on startup?

Head_on_a_Stick wrote:

You need to edit the systemd unit file supplied with Plex.

See https://forums.plex.tv/discussion/comme … ent_916656

You may receive better assistance on the Plex forums.


Thanks. I'll go there for my plex problems. But how about my .screenlayout autostart?

Offline

#7 2015-11-19 21:40:11

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: Running shell commands on startup?

sanchostache wrote:

how about my .screenlayout autostart?

damo wrote:

` arandr` saves layouts in ~/.screenlayout as an executable file. Just add that to your autostart with

./layout-name.sh &

“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#8 2015-11-19 21:43:12

sanchostache
Member
Registered: 2015-11-19
Posts: 6

Re: Running shell commands on startup?

Head_on_a_Stick wrote:
sanchostache wrote:

how about my .screenlayout autostart?

damo wrote:

` arandr` saves layouts in ~/.screenlayout as an executable file. Just add that to your autostart with

./layout-name.sh &

Thanks smile   sorry for the newb questions

Offline

#9 2015-11-20 07:36:07

ohnonot
...again
Registered: 2015-09-29
Posts: 5,554

Re: Running shell commands on startup?

sanchostache, both damo and HoaS have given example names to the scripts in their examples, because it can be any name you give it.
hence the confusion i guess.
it gets much clearer once you look closer at arandr's functionality, or open the folder/file in question...

so, to autostart you have to add:

~/.screenlayouts/<whichevernameyougavetoyourscript> &

Give to COVAX! Here or here. (explanation)

Offline

#10 2015-11-20 10:41:47

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,370
Website

Re: Running shell commands on startup?

p.s. I have exactly this on top of autostart on one machine;

~/.screenlayout/dual.sh && sleep 3

Offline

Board footer

Powered by FluxBB