domenica 23 febbraio 2014

Cu2t0m1ziNg K4L1


Today I would like to write about CUSTOMING of Terminal (or Shell) Kali (Debian-based). We will put hands on Profile Preferences of Terminal and .bashrc file.

First, open Terminal, then go on Edit->Profiles. Here you can choose if make a new profile or edit Default profile. Assuming that we make a new profile, click on New, insert our profile name (here I call it as Pippo, based on Default, then Create.

Click on Pippo and then on Edit. Go on Colors Tab and here we can change Text color, Background color, etc.



In this options I noted that we can't edit color of prompt (user@host), but this we will see afterwards.
Then go on Background Tab and we can choose a background image for terminal and regulate the transparency of background

Then click on close. Move on Terminal Tab of terminal, click on Set Title and edit Title, for example Donald !!! Duck, but this remains only for one session of shell.


If you want, you can click with right bot. of mouse on terminal icon on kali bar (usually above), then click on Properties. Here you can change the words that are shown when you pass the mouse on terminal icon, and finally close. If you want to return to default words, click on Revert.

Uhm... Now I want to edit prompt. We have to put hands on .bashrc file.

Type

  • gedit /home/yourusername/.bashrc
In this file, search and uncomment the string "force_color_prompt=yes", and search the string

 if [ "$color_prompt" = yes ]; then
 PSI='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

Here we must edit the prompt.
\u suggests your username
\h suggests your host

The string  [\033[01;31m\] suggests that the part \u@\h will be red. You can have also several colors for username, @ and host, like this example:

PSI='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u\[\033[01;30m\]@\[\033[01;32m\]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' 

However, you can also choose to have as prompt, not username@host, but also word££duck, for example

 PSI='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]word\[\033[01;30m\]££\[\033[01;32m\]duck\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

The color numbers are


Sources: Bash Prompt How To; Color Bash Prompt
If you want, you can try these commands --> Changing font and background but I noted that only the command that change background prompt works on Kali

Save all, close shell and reopen it, and

Nessun commento:

Posta un commento