nutbutter@discuss.tchncs.de to linuxmemes@lemmy.world · edit-216 days agochmod 666discuss.tchncs.deimagemessage-square22linkfedilinkarrow-up1338arrow-down19
arrow-up1329arrow-down1imagechmod 666discuss.tchncs.denutbutter@discuss.tchncs.de to linuxmemes@lemmy.world · edit-216 days agomessage-square22linkfedilink
minus-squaree8d79@discuss.tchncs.delinkfedilinkarrow-up6·16 days agoThis should work. Add a file /home/username/.config/systemd/user/my_cool_service.service with this content: [Unit] Description=My cool service [Service] Type=oneshot ExecStart=/home/username/my_cool_script.sh [Install] WantedBy=default.target Now add the script /home/username/my_cool_script.sh. #!/bin/bash echo "Hello from my cool script." Enable and run the service. $ chmod +x /home/username/my_cool_script.sh $ systemctl --user daemon-reload $ systemctl --user enable my_cool_service.service # Optional: $ systemctl --user start my_cool_service.service $ journalctl -e --user-unit=my_cool_service # You should see the echoed string from the script. The service should now run every time the user username logs in.
minus-squareGonzako@lemmy.worldlinkfedilinkarrow-up2·16 days agoOh, thanks! My distro has a package that has a bunch of visual configurations that reset on boot and I wanted to do my configs on top
This should work. Add a file
/home/username/.config/systemd/user/my_cool_service.servicewith this content:Now add the script
/home/username/my_cool_script.sh.#!/bin/bash echo "Hello from my cool script."Enable and run the service.
$ chmod +x /home/username/my_cool_script.sh $ systemctl --user daemon-reload $ systemctl --user enable my_cool_service.service # Optional: $ systemctl --user start my_cool_service.service $ journalctl -e --user-unit=my_cool_service # You should see the echoed string from the script.The service should now run every time the user
usernamelogs in.Oh, thanks! My distro has a package that has a bunch of visual configurations that reset on boot and I wanted to do my configs on top