I got a pretty simple script for my Raspberry PI 5 which I intent to use primarily as a media center. In pseudocode, it does:
You got 5 seconds to press key
if no key pressed
launch desktop environment
if key pressed
launch media center application
Google searches only point to how to run non interactive scripts (cron, systemd services) which does not work for my example. The raspberry is configured to boot to terminal, so, there's any way to make this script to run first thing after the terminal is loaded?
-
1Is this before or after a user is logged in?NickSlash– NickSlash2025年10月05日 10:46:35 +00:00Commented Oct 5 at 10:46
-
Systemd services are usually non-interactive, they don't have to be though.NickSlash– NickSlash2025年10月05日 11:04:33 +00:00Commented Oct 5 at 11:04
-
Please have a look at How to run a shell script at startup, and explain how your question is different.Luuk– Luuk2025年10月05日 11:16:14 +00:00Commented Oct 5 at 11:16
-
1Like this? How can I spawn my own program in a linux tty-session instead of the shell?Kamil Maciorowski– Kamil Maciorowski2025年10月05日 11:19:57 +00:00Commented Oct 5 at 11:19
-
> NickSlash: After the user logs. I'm not familiarized with "what comes after what" on boot, but the basic idea would be that when the terminal shows up, instead of waiting for user input, the script is run. (Regarding the systemd thing, it's the first time I've used them, and I was just testing because all articles I've seen are to run non interactive scripts, hence why I'm asking this).Neuromante– Neuromante2025年10月05日 13:02:35 +00:00Commented Oct 5 at 13:02
You must log in to answer this question.
Explore related questions
See similar questions with these tags.