I would like to run a simple Python script when a program starts (like Chrome). In Windows and ubuntu.
Asked
Active
Viewed 477 times
1 Answers
-1
https://www.youtube.com/watch?v=8BiOPBsXh0g&t=235s
There you can find tutorial to hide auto running program when someone run application on Windows :).
At ubuntu that is a little harder, u can create bash script for example... But any script can be revealed, and depends on visual interface, method to hide it can fail.
Otherwise is a method to edit .bashrc in home directory with some similar to:
alias COMMAND_DEFAULT_RUNING_PROGRAM='THAT_SAME_AS_LEFT;python3 your_script.py'
But that will be visible on aliases. I don't found any effective method to hide it :)

Guaz
- 193
- 1
- 1
- 12
-
Thank you for the fast reply but there is one problem. I am trying to start my script when a game from steam starts this makes it complicated to edit the shortcuts i think. (Win 10) is it possible to inplement it in the python code... – Johan Andersson Jan 12 '19 at 20:15
-
You tried os.system(*) or subprocess.call(*) ? Or when you don't have running script, maybe it is possible to get this from steam? https://gaming.stackexchange.com/questions/326173/can-i-run-a-steam-app-with-a-batch-script There you can find examples of usage, if u don't tried it: https://stackoverflow.com/questions/204017/how-do-i-execute-a-program-from-python-os-system-fails-due-to-spaces-in-path Unfortunatelly, I can't test it on windows, becouse using linux :). – Guaz Jan 12 '19 at 21:36