this post was submitted on 07 Oct 2025
321 points (97.3% liked)

linuxmemes

27638 readers
1450 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack users for any reason. This includes using blanket terms, like "every user of thing".
  • Don't get baited into back-and-forth insults. We are not animals.
  • Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
  • 3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn, no politics, no trolling or ragebaiting.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, <loves/tolerates/hates> systemd, and wants to interject for a moment. You can stop now.
  • 5. πŸ‡¬πŸ‡§ Language/язык/Sprache
  • This is primarily an English-speaking community. πŸ‡¬πŸ‡§πŸ‡¦πŸ‡ΊπŸ‡ΊπŸ‡Έ
  • Comments written in other languages are allowed.
  • The substance of a post should be comprehensible for people who only speak English.
  • Titles and post bodies written in other languages will be allowed, but only as long as the above rule is observed.
  • 6. (NEW!) Regarding public figuresWe all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations.
  • Keep discussions polite and free of disparagement.
  • We are never in possession of all of the facts. Defamatory comments will not be tolerated.
  • Discussions that get too heated will be locked and offending comments removed.
  • Β 

    Please report posts and comments that break these rules!


    Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't remove France.

    founded 2 years ago
    MODERATORS
    321
    chmod 666 (discuss.tchncs.de)
    submitted 3 days ago* (last edited 3 days ago) by nutbutter@discuss.tchncs.de to c/linuxmemes@lemmy.world
     
    you are viewing a single comment's thread
    view the rest of the comments
    [–] Gonzako@lemmy.world 5 points 2 days ago (2 children)

    How does one actually use systemd? I tried making a script to trigger every time I boot up but it didn't work out for me

    [–] e8d79@discuss.tchncs.de 6 points 2 days ago (1 children)

    This 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.

    [–] Gonzako@lemmy.world 2 points 2 days ago

    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

    [–] jim3692@discuss.online 5 points 2 days ago

    Did you set the WantedBy field?

    Did you systemctl enable the service?