Alexmilk
Posts: 4
Joined: Fri Jun 22, 2018 9:16 am
Location: CH
Contact: Website

Open a fullscreen terminal window at start

Fri Jun 22, 2018 9:56 am

Hi!

I try to open a fullscreen terminal window at start. (should be simple no? :? )

I am new in raspberry, but I have a python file that use Lxterminal window as visualization.
> /home/pi/morse/code/morse.py

I can not open it from this command line:

Code: Select all

sudo python /home/pi/morse/code/morse.py
So I created a command file that open it (not in fullscreen...anyway :roll: ) : startup.sh

Code: Select all

#! /bin/bash
cd /home/pi/morse/code
 ./morse.py
.

And then I tried to call it at start from /etc/rc.local: (before the IP adress)

Code: Select all

sudo bash /etc/startup.sh
It was not working

So I tried with Crontab method. I put this code line inside:

Code: Select all

@reboot ( sleep 90 ; bash /etc/startup.sh )
It was also not working

If you have an idea of what kind of stupid mistake I did!
Thank you :D

Best,

Alex

User avatar
topguy
Posts: 7237
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Open a fullscreen terminal window at start

Fri Jun 22, 2018 1:40 pm

Probably safer to use LXDE own autostart featur.

A bit old this thread so you may want to look for a newer guide, but this should give you the keywords to search for.
viewtopic.php?p=1001600

Alexmilk
Posts: 4
Joined: Fri Jun 22, 2018 9:16 am
Location: CH
Contact: Website

Re: Open a fullscreen terminal window at start

Tue Jun 26, 2018 1:46 pm

Thank you very much topguy, this really help me !

I found this solution:

lxTerminal

Code: Select all

$ sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart

Code: Select all

#add this at the end

#for running a python program:
@lxterminal -e python /home/pi/morse_code.py

#for running a command:
@lxterminal --command /bin/bash --init-file /home/pi/startup.sh

Return to “Beginners”