How to pass command line args to startx?

So i have an old computer that i want to use to watch tv. The plan was install freebsd, load up hard drive with content, plug in the hdmi, and simply pass command line args to startx to select the file i want to watch ie
startx vlc path/to/file
i tried just adding
exec $1 $2 $3 $4
and also
exec xterm -e $1 $2 $3 $4
to the system wide xinitrc (single user setup cuz its just a tv box) but this just crashes the x server. i can run vlc from xterm but then i gotta fuck around with a mouse to change focus. for simplicity and viewing comfort i dont wanna have to fuck with a mouse.
 
try startx /path/to/vlc /path/to/file

I've found startx to be flaky about path to executable if it is missing.

Starting the X server and clients can be kind of tricky if you want to do custom stuff. You need to indirectly start the X server in the background, then execute at least one client, and if all clients exit then the X server itself will exit. In the past i've done stuff like

(X {x-options} &; sleep 2; client1&; client2 &; client3)
 
Back
Top