#[Solved] Script on startup
62 messages · Page 1 of 1 (latest)
On startup being as soon as you log in?
search for Autostart in start menu.
found it but how would i make that script run in the background
just press add -> add application and then open file dialog and select your script.
I think you can do
chmod +x script_file
to give permissions
i did
The best way would to make a systemd service.
still asks for password
This just makes it executable, not gives it sudo perms
.aw systemd
Make a systemd service
That runs as root iirc
You would want the /etc/systemd/system one https://wiki.archlinux.org/title/Systemd#Writing_unit_files
also did not even work
send the script here
oh
gotcha
[Unit]
Description=USB Kill
After=network.target
[Service]
ExecStart=/home/emanuel/usb_kill.sh
Restart=always
[Install]
WantedBy=default.target
if your script just runs usbkill why nt just set Execstart=usbkill
also i think you did some of that wrong
true
let me see
@finite hatch restart=always is not a good idea i think
try smth like this ```ini
[Unit]
Description=USB Kill
After=network.target
[Service]
ExecStart=/home/emanuel/usb_kill.sh
[Install]
WantedBy=multi-user.target
do i really need After
uh
well idk
what that does
is make it run after network.target is run
so
i think thats after network works
if you need network for this yes
otherwise no
then just ```ini
[Unit]
Description=USB Kill
[Service]
ExecStart=usbkill
[Install]
WantedBy=multi-user.target```
use this ^^
.
sudo systemctl daemon-reload && sudo systemctl restart usbkill should do it
it works now