Skip to content

Instantly share code, notes, and snippets.

@raek
Last active July 22, 2022 22:18
Show Gist options
  • Save raek/c57c98c5f36203608d26dc46538ecb68 to your computer and use it in GitHub Desktop.
Save raek/c57c98c5f36203608d26dc46538ecb68 to your computer and use it in GitHub Desktop.
~/.config/systemd/user/weechat.service - SystemD unit for starting Weechat in a detached Screen
[Unit]
Description=Start Weechat in a screen at boot
[Service]
ExecStart=/usr/bin/screen -D -m -S weechat -U weechat
# -D -m Start detached, do not fork
# -S weechat Set name of session to "weechat"
# -U UTF-8 mode
# weechat Command to run
[Install]
WantedBy=default.target
# How to install:
# * Allow "linger" for your user (allowes services running when not logged in):
# sudo loginctl enable-linger $USER
# * Put this file in:
# ~/.config/systemd/user/weechat.service
# * Enable and start the service (no sudo):
# systemctl --user enable --now weechat.service
# How to uninstall:
# Run the above commands in reverse, but replace any "enable" with disable and delete the file.
@TehPeGaSuS
Copy link

Small updates:

  • Ubuntu allows users to enable lingering for themselves by default (been a while already)
  • By default the ~/.config/systemd/user/ doesn't exist, so the best way to create it is with the command: mkdir -p ~/.config/systemd/user/

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment