Saturday, December 31, 2016

Start screen on Boot in Kali Rolling, Ubuntu, or Debian Linux

After booting straight to CLI in Kali Rolling, Ubuntu, or Debian, I also wanted to have a screen session started on boot to use for my window manager. In order to do this, I had to edit /etc/rc.local and add this command:
/usr/bin/screen -c /root/.screenrc -dmU -h 10000 -S kali_screen_session

Then add the next command to ~/.bashrc:
export HOME="/root"

Then add these lines to ~/.screenrc (the most important being the shell line):
#don't display the copyright page
startup_message off

activity "%C -> %n%f %t activity!"
bell "%C -> %n%f %t bell!~"
pow_detach_msg "BYE"

#visable bell
vbell_msg "*beep*"

# Change scrollback to 100000 lines
defscrollback 100000

# fix the scrollback problem in putty (for windows users)
termcapinfo xterm ti@:te@

shell bash
# Uncomment the following line in Kali Linux in order to start new windows in ~ instead of /
#chdir /root

# programs to auto start
screen -t htop 0 htop

# status line at the bottom
hardstatus on
hardstatus alwayslastline
hardstatus string '%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{=b kR}(%{W}%n*%f %t%?(%u)%?%{=b kR})%{= kw}%?%+Lw%?%?%= %{g}][%{Y}%l%{g}]%{=b C}[ %d/%m/%y %c ]%{W}'

Now to create a new terminal window press control+a then c.
To switch between windows press control+a control+a

No comments:

Post a Comment