Tested on Ubuntu 20.04+
This files are to be used with systemd.
NOTE: Make sure to have screen or tmux installed in your machine .
You can check if you have screen or tmux installed with the command whereis screen
or whereis tmux
.
If you terminal returns no output with paths, then you need to install one of them or ask the system admin to install it for you.
To be ran as the user, so it doesn't require root
-
You need to enable lingering for your user with the following command:
loginctl enable-linger
-
Create the
~/.config/systemd/user/
folder with the following command:
mkdir -p ~/.config/systemd/user/
-
Go to the recently created directory with
cd ~/.config/systemd/user/
and downloadweechat_screen.service
orweechat_tmux.service
with one of the following commands:-
SCREEN
wget https://gist.githubusercontent.com/PeGaSuS-Coder/d270f31d49a24f13728cc07978520788/raw/weechat_screen.service
-
TMUX
wget https://gist.githubusercontent.com/PeGaSuS-Coder/d270f31d49a24f13728cc07978520788/raw/weechat_tmux.service
-
-
Use SYSTEMD CONTROL COMMANDS below to manage your instance
-
Basic screen and tmux usage are explained here
-
Useful extras can be found here
-
To start an instance:
-
SCREEN
systemctl --user start weechat_screen.service
-
TMUX
systemctl --user start weechat_tmux.service
-
-
To stop an instance:
-
SCREEN
systemctl --user stop weechat_screen.service
-
TMUX
systemctl --user stop weechat_tmux.service
-
-
To restart an instance (after an upgrade, e.g):
-
SCREEN
systemctl --user restart weechat_screen.service
-
TMUX
systemctl --user restart weechat_tmux.service
-
-
To enable a systemd user unit so it starts after a crash or a machine reboot:
-
SCREEN
systemctl --user enable weechat_screen.service
-
TMUX
systemctl --user enable weechat_tmux.service
-
SCREEN
-
To attach to a screen session:
screen -dr weechat
-
To detach from a screen session:
CTRL+A-D
TMUX
-
To attach to a tmux session:
tmux attach -t weechat
-
To detach from a tmux session:
CTRL+B-D
- For proper colour handling by screen or tmux, be sure to have
~/.screenrc
or~/.tmux.conf
with the following contents:-
~/.screenrc
term screen-256color
-
~/.tmux.conf
set -g default-terminal "tmux-256color"
-