Hi everyone!
I installed ubuntu mate to raspberry pi 2 and wrote some program for it.
I want to start my program every boot and keep screen dark until program start is it possible?
Can anyone help me for direct answer or a place that i can learn about that thing.
Thank you.
Hi there.
Menu: System - Control Center - Startup Applications. Add a new startup program, in the Command field write the path to your program (or click Browse and find it that way), then add it, restart the OS and see if it works.
If I understand correctly, you:
- don't want to show Ubuntu MATE booting
- don't want to show login (autologin)
- don't want to show Ubuntu MATE desktop
- don't want to show the starting of your program
- want to enable display when your program is running
Did I get it right?
1 Like
Thank you GizmoXomziG
You got it right these are exactly what i want.
- don’t want to show Ubuntu MATE booting
I don’t know how I imagine it could be done by corrupting the config (wrong output display?) on purpose, then after the program started, a script would manually fix the display output
- don’t want to show login (autologin)
You can set this up (if you haven’t already) in Control Center, under users, so it skips the login altogether
- don’t want to show Ubuntu MATE desktop
see below
- don’t want to show the starting of your program
see below
- want to enable display when your program is running
see below
You can try this:
Create a script file (e.g. myblankstartup.sh), make it executable, add it to startup applications, and edit the script: (replace ~/myProgram.sh with the path to your actual program, don’t forget to add the & at the end)
#!/bin/bash
/opt/vc/bin/tvservice -o
~/myProgram.sh &
sleep 5
/opt/vc/bin/tvservice -p
or
#!/bin/bash
xset dpms force off
~/myProgram.sh &
sleep 5
xset dpms force on
What I imagine this script does is:
- show Ubuntu MATE booting
- insta-auto-login
- run the script, which does:
- make the display blank (it doesn’t power off your monitor, it just outputs blank screen)
- start you program
- wait for 5 seconds (if it isn’t enough, increase it)
- make the display active again
I can’t try this at the moment, don’t know if Ubuntu MATE has tvservice or xset installed by default. So, before you do anything, open a terminal (Ctrl+Alt+T) and input these two commands, to check if the apps are installed:
- xset dpms force on
- /opt/vc/bin/tvservice -p
Report with results
1 Like
Thank you so much mate it works.
But if there is a way to start computer screen off by default that will be best solution for me i can enable screen again when program starts call system() function with xset dpms force on. By that way i can skip all things when booting. Right?
Yes, if you could (somehow) call “xset dpms force off” at the very beginning of booting Ubuntu MATE, then you could call “xset dpms force on” inside your program whenever it was ready to show the display.
Try putting “xset dpms force off” in /etc/rc.local (and check if it’s executable). I’m not sure at what stage of booting it executes, but I think it executes before login, so maybe this trick will give it a head start.
Then add “xset dpms force on” inside your program and try.
I changed ubuntu mate boot it is good.And Screen open when program starts just one problem left. Just before OS starts there are some line on screen with raspberry logos
[OK] bla bla
[OK] bla bla
i couldnt read it because stays around 3 sec. if i can disable this screen i m done.
Thank you again.