How to run Python script on boot?

Goo day. I want to run a py script on boot. This is my code

import subprocess

# subprocess.run(['ls'])
subprocess.run(["redshift"])
protonvpn

location:

/run/media/soumi/Luna/CF-0001/Programming/Python/terminal.py

I know it’s simple I just want to test and experiment with the terminal. What should I do so that everytime I boot, this script is executed? Thanks

Hello @soumi :wink:

First this is a temporary mount:

/run/media/soumi/Luna/

which will only mounted there if a user triggers the mount process in the file manager. Bad place for a script which have to run on boot.

Better would be:

$HOME/.local/bin

On KDE there is a autostart setting: System Settings/Autostart - KDE UserBase Wiki

3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.