This script is stored on the Pi in the Documents folder, not the thumb drive.
Code: Select all
#!/bin/bash omxplayer /media/pi/drivename/video_I_want_to_play.mp4
From what I read, I'm supposed to put a udev rule in /etc/udev/rules.d. Every example I've seen uses a different file name for that rule, so I guarantee I'm missing something there. I don't know what BLOCK== or whatever is. I figured out that KERNEL is supposed to be the drive device name, ex. sda1. I place that rule there, and when I plug in the drive, nothing happens.
A search of youtube turns up the usual incomprehensible Indians, videos with no sound from 16 years ago usingCentARCH on a graphing calculator, a pen test lecture, and two guys standing in the street hitting each other with shovels. A google search turns up basically a lot of people trying to get this to work, failing, and not finding solutions.
Actually, you know what? Screw udev. What I want is a script that launches on startup that checks to see if a drive has been inserted, when one has, try to play an mp4 on that usb drive, if that file isn't there, do nothing. Is this a thing that modern science can do?
On a related note, how do I get it to quit asking me if I want to open a folder to view the files, and just have it automatically do it without asking?