Sunday, May 18, 2014

Replacing login manager with tty

This post describes how to disable login manager and use only tty to start desktop environment.
Also it shows how to create fancy image as welcome screen for tty login.


To disable your login manager just run:
sctl disable slim (for SLiM login manager)
or as in my case
mv /etc/systemd/system/display-manager.service{,.disabled}

Next step is to check if you have startx command, to start you DE from tty. If you don't have it, install package xorg-xinit.

The you can create an alias for starting DE and in my case also for exiting i3:
# i3wm aliases
alias sx="startx &>/dev/null"
alias i3e="i3-msg exit"

So this is how it'll look after reboot:

You can then start your DE with command sx (of course, not as root user).

tty picture:
Creating picture for console is not hard, you just need to spend some time to make it look good. Take a look on small how to for creating colors in terminal.
So this is how I did it:
  1. I've found a picture I like (simple picture)
  2. Then I've converted it to ascii picture with converter
  3. and finally I've edited it and added colors.
This took my about 2 hours. Here's a sample file for the picture above:
                    ^[[47m                         ^[[m
                    ^[[47m ^[[30m^[[40mMMMMMMMMMMMMMMMMMMMMMMM^[[47m ^[[m
             ^[[47m        ^[[30m^[[40mMMMMMMMMMMMMMMMMMMMMMMM^[[47m        ^[[m
             ^[[47m ^[[30m^[[40mMMMMMMMMMMM^[[47m    ^[[42m       ^[[47m    ^[[40mMMMMMMMMMMM^[[47m ^[[m
          ^[[47m    ^[[30m^[[40mMMMMMMMMMMM^[[47m    ^[[42m       ^[[47m    ^[[40mMMMMMMMMMMM^[[47m    ^[[m
          ^[[47m ^[[30m^[[40mMMMMMM^[[47m            ^[[42m       ^[[47m            ^[[40mMMMMMM^[[47m ^[[m
       ^[[47m    ^[[30m^[[40mMMMMMM^[[47m            ^[[42m       ^[[47m            ^[[40mMMMMMM^[[47m    ^[[m
       ^[[47m ^[[30m^[[40mMMMMMM^[[42m   ^[[47m         ^[[42m             ^[[47m         ^[[42m   ^[[40mMMMMMM^[[47m ^[[m
       ^[[47m ^[[30m^[[40mMMMMMM^[[42m   ^[[47m         ^[[42m             ^[[47m         ^[[42m   ^[[40mMMMMMM^[[47m ^[[m
       ^[[47m ^[[30m^[[40mMMM^[[47m   ^[[42m                                     ^[[47m   ^[[40mMMM^[[47m ^[[m
   ^[[47m     ^[[30m^[[40mMMM^[[47m   ^[[42m                                     ^[[47m   ^[[40mMMM^[[47m     ^[[m
   ^[[47m ^[[30m^[[40mMMMMMMM^[[47m      ^[[42m       ^[[47m                 ^[[42m       ^[[47m      ^[[40mMMMMMMM^[[47m ^[[m
   ^[[47m ^[[30m^[[40mMMMMMMM^[[47m      ^[[42m       ^[[47m                 ^[[42m       ^[[47m      ^[[40mMMMMMMM^[[47m ^[[m
   ^[[47m ^[[30m^[[40mMMMM^[[47m         ^[[42m    ^[[47m                       ^[[42m    ^[[47m         ^[[40mMMMM^[[47m ^[[m
   ^[[47m ^[[30m^[[40mMMMM^[[47m         ^[[42m    ^[[47m                       ^[[42m    ^[[47m         ^[[40mMMMM^[[47m ^[[m
   ^[[47m ^[[30m^[[40mMMMM^[[47m      ^[[42m       ^[[47m                       ^[[42m       ^[[47m      ^[[40mMMMM^[[47m ^[[m
   ^[[47m ^[[30m^[[40mMMMM^[[47m      ^[[42m       ^[[47m                       ^[[42m       ^[[47m      ^[[40mMMMM^[[47m ^[[m
   ^[[47m ^[[30m^[[40mMMMM^[[42m                ^[[47m                 ^[[42m                ^[[40mMMMM^[[47m ^[[m
   ^[[47m ^[[30m^[[40mMMMM^[[42m                ^[[47m                 ^[[42m                ^[[40mMMMM^[[47m ^[[m
   ^[[47m ^[[30m^[[40mMMMM^[[42m      ^[[40mMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM^[[42m      ^[[40mMMMM^[[47m ^[[m
   ^[[47m ^[[30m^[[40mMMMM^[[42m      ^[[40mMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM^[[42m      ^[[40mMMMM^[[47m ^[[m
   ^[[47m ^[[30m^[[40mMMMMMMMMMMMMM^[[47m         ^[[40mMMM^[[47m       ^[[40mMMM^[[47m         ^[[40mMMMMMMMMMMMMM^[[47m ^[[m
   ^[[47m ^[[30m^[[40m    MMMMMM   ^[[47m         ^[[40mMMM^[[47m       ^[[40mMMM^[[47m         ^[[40m   MMMMMM   O^[[47m ^[[m
   ^[[47m     ^[[30m^[[40mMMMMMM^[[47m            ^[[40mMMM^[[47m       ^[[40mMMM^[[47m            ^[[40mMMMMMM^[[47m     ^[[m
       ^[[47m ^[[30m^[[40mDDDMMM^[[47m            ^[[40mDDD^[[47m       ^[[40mDDD^[[47m            ^[[40mMMMDDD^[[47m ^[[m
       ^[[47m    ^[[30m^[[40mMMM^[[47m                                     ^[[40mMMM^[[47m    ^[[m
          ^[[47m ^[[30m^[[40mMMMMMM^[[47m                               ^[[40mMMMMMM^[[47m ^[[m
          ^[[47m ^[[30m^[[40mMMMMMM^[[47m                               ^[[40mMMMMMM^[[47m ^[[m
          ^[[47m    ^[[30m^[[40mMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM^[[47m    ^[[m
             ^[[47m ^[[30m^[[40mMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM^[[47m ^[[m
             ^[[47m                                       ^[[m  krisko 2014
   ^[[1m^[[36m       . 
   ^[[36m      /#\                      _     ^[[37m _ _
   ^[[36m     /###\       __ _ _ __ ___| |__  ^[[37m| (_)_ __  _   ___  __
   ^[[36m    /#####\     / _' | '__/ __| '_ \ ^[[37m| | | '_ \| | | \ \/ /
   ^[[36m   /##.-.##\   | (_| | | | (__| | | |^[[37m| | | | | | |_| |>  <  
   ^[[36m  /##(   )##\   \__,_|_|  \___|_| |_|^[[37m|_|_|_| |_|\__,_/_/\_\
   ^[[36m /#.--   --.#\ 
   ^[[36m/'           '\ ^[[m

NOTE: the '^[' in the file is a special character (just one), it won't work if you just type it like you see it, instead use e.g. echo, or in vim you can type ctrl+v ctrl+[:
echo -en '\E[47;34m'"\033[1mE\033[0m" >> somefile  # Blue

You can download my original file from here. Then just try to cat the file.

Putting it to tty:
If you'd like to have this picture printed in tty before login prompt, add it to /etc/issue file.  

Note: it is crucial to preserve special character '^[', which might get lost during copy/paste.

Note: in /etc/issue file you need to backslash every backslash character (you should have double backslash \\ instead of single backslash \).

No comments:

Post a Comment