I have managed to get the C.H.I.P. Console Kit with DIP to autostart PICO-8 at bootup with gamepad enabled.
First I created a .config/autostart/PICO8.desktop file that instructs the xfce debian based c.h.i.p operating system to launch a script named pico.sh at bootup.
Inside the pico.sh script I tell the os to first launch a terminal
then I wait for the operating system to initialise before launching pico-8 because if I launch pico-8 too early then it will fail to initialise its full-screen mode.
After pico-8 have started up i use a tool called wmctl to grab the pico8 window and then uses another tool called xdotool to send then 0 key to pico-8 without having to use a keyboard.
Finally I simulate pressin alt+tab twice to enable the gamepad by using the wmctl tool to first switch to the Terminal window that i opened earlier and then switch back to pico-8. Done! Now you can browse the pico-8 splore using the gamepad directly after bootup!
I have prepared a script that do all the things listed above on your C.H.I.P. console-kit system:
cd wget https://gongiversum.com/chip/console-kit.tar.gz tar zxvf console-kit.tar.gz sudo sh console-kit-setup.sh sudo reboot
I hope these instructions and setup scripts will make your console kit more enjoyable!
I will continue and include the exact details found in the scripts installed by the above setup commands:
content of .config/autostart/PICO8.desktop
[Desktop Entry] Encoding=UTF-8 Version=0.9.4 Type=Application Name=PICO8 Comment= Exec=/home/chip/pico.sh OnlyShowIn=XFCE; StartupNotify=false Terminal=false Hidden=false
contents of the pico.sh
#!/bin/sh cd /home/chip exo-open --launch TerminalEmulator sleep 11 /usr/bin/pico8 & sleep 8 #send key 0 to pico 8 wmctrl -a pico-8 xdotool key 0 # activate gamepad by switching between desktop and pico 8 using wmctrl sleep 2 wmctrl -a Terminal sleep 2 wmctrl -a pico-8 # try send 0 again to just in case # the "you are now connected to wifi network" window popped up # and receive the 0 we sent earlier xdotool key 0
contents of the console-kit-setup.sh
apt update apt install xdotool wmctrl