As some of you may know, my FB graphics are usually handled by CGUI.
But recently I have been developing applications for headless operation in Linux.
As I have not used Screen functions since my QB days, I am a beginner on this now.
Worth noting that this script below works perfectly for a cgui (Allegro) graphic program.
When the Beaglebone boots it uses .xinitrc which has the following lines for my program.
Code: Select all
#!/bin/sh
## Program restarts unless:
## If program returns an Error code of 254, it will exit and start openbox session.
## If program returns an Error code of 131, it will reboot the computer.
## If program returns an error code of 130, it will shut down the computer.
## If program returns an error code of 0, it will restar to a max of 5 times.
## Otherwise write Date & Error code to file
sleep 25
for I in 1 2 3 4 5
do
sudo nmcli device wifi connect "TP-Link_CE38" password "********"
sudo -u debian openbox-session &
sudo -u debian /home/debian/Client
STATUS=$?
##----------------------------
if test $STATUS -eq 254
then
sudo -u debian openbox-session
elif test $STATUS -eq 131
then
sleep 30
sudo reboot
elif test $STATUS -eq 130
then
sudo shutdown now
elif test $STATUS -eq 0
then
echo " `date ` exit code $STATUS " >> /home/debian/Errors.txt
sleep 10
fi
##---------------------------
done
## Startx to allow Geany etc.
sudo -u debian openbox-session
Code: Select all
Screen 19,8,1
Code: Select all
If Debug.PrintFlag Then
Locate 2,1:Print "Last Compiled on: " + __Time__
Locate 3,1:Print Times.Datum;";";Times.Tyd
Locate 4,1:Print "Press [Esc] to Quit"
Locate 5,1:Print "-------------,----------,----------,---------,--------"
Locate 6,1:Print "Location , Tag Code#, Date , Time , Tx Len."
Locate 7,1:Print "-------------,----------,----------,---------,--------"
Locate 8,1
EndIf
Because the program relies on a scanner dumping characters in to the keyboard buffer, I use this statement to position
the mouse cursor within my window.
Code: Select all
Dim as String Cmnd = "sudo xdotool mousemove 100 100"
Shell Cmnd
If I right click in the remaining background window, I can start Geany and the keyboard works correctly.
I can run the program from Geany and it will work correctly.
Removing the screen and the keyboard still alows the program to run correctly, but scanning a Tag does not produce
any char's.
For the keyboard to be linked to an open window, what are the conditions that must be satisfied.?
No amount of reading and browsing over the last two days has resolved this.
Would love to hear any suggestions that might resolve this.
Regards