I'd like to write a small script that will search for my touchscreen in /dev, and if present, use one xorg.conf file (sudo mv /etc/X11/xorg-touch.conf /etc/X11/xorg.conf), and if it's not present, use a different xorg.conf (sudo mv /etc/X11/xorg-NOtouch.conf /etc/X11/xorg.conf)

I would need the script to run on boot, before x11 reads the xorg file, but after USB is populated. I tried adding some simple mkdir commands to test if things were working when I tried /etc/X11/xinit/xinitrc and a couple other files, but nothing seemed to be called.

Is this possible? Any pointers on where to start? I don't necessarily need the code to do it (although I always like seeing different ways of accomplishing it), but more where to put the code so that it executes at the right time.

Thanks!

没有正确的解决方案

其他提示

You could try placing your script in the /etc/init.d file. For more information check out this guide.

http://raspberrywebserver.com/serveradmin/run-a-script-on-start-up.html

If you want to be sure that everything is up and running before you execute your script you could add $all to the LSB header, for details check:

https://wiki.debian.org/LSBInitScripts

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top