Skip to content

Instantly share code, notes, and snippets.

@wyrmiyu
Last active September 3, 2020 13:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wyrmiyu/6adc3b2f46ec9937db6a to your computer and use it in GitHub Desktop.
Save wyrmiyu/6adc3b2f46ec9937db6a to your computer and use it in GitHub Desktop.
How to setup screen+irssi start at boot time
[user@ircshell ~]$ mkdir -p ~/bin
[user@ircshell ~]$ cat > ~/bin/start_irssi.sh <<-'EOF'
#!/bin/bash
# Set timezone
export TZ='EET'
#
# Start a new screen with unicode support (-U), named as 'irc' (-S),
# in detached mode (-m -d) and run irssi in it.
/usr/bin/screen -U -S irc -m -d /usr/bin/irssi
EOF
[user@ircshell ~]$ chmod +x ~/bin/start_irssi.sh
Use 'crontab -e' to edit your personal crontab and put this into it:
# Cron runs the script start_irssi.sh at boot time
# During the boot the system wide locale is not yet set and
# thus we are falling back to default locale 'C' so we want
# to provide the right one by setting LANG for our script.
@reboot LANG="en_DK.UTF-8" $HOME/bin/start_irssi.sh
Now, go ahead and read the fine manual in order to configure your irssi
to auto-connect and auto-join to channels when it starts:
https://irssi.org/documentation/startup/#server-and-channel-automation
@Armand-electron
Copy link

Thank you for this, just what I was looking for!

However, I encountered issue with not all necessary startup processes catching up there in the boot (mainly dns), so irssi
was nagging about Temporary failure in name resolution when connecting to a server.

I resolved the issue by adding one minute sleep to @reboot: the following way:

@reboot sleep 60 && LANG="en_DK.UTF-8" $HOME/bin/start_irssi.sh

ofc, chaning the LANG to my local one too ;)

Thanks again!

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