Linux Lite Forums

General => Suggestions and Feedback => Topic started by: arman1992 on December 31, 2014, 04:57:04 PM

Title: [SOLVED] Terminal emulator & GRUB coloring
Post by: arman1992 on December 31, 2014, 04:57:04 PM
Hi. Hope everyone is doing well.

I'm new to Linux Lite and so far, satisfied with it! A little suggestion. Just if the coloring of terminal emulator and grub was in harmony with the white and gray atmosphere of the distro...
Something like: https://www.dropbox.com/s/c6qoqp71nce87vs/Screenshot%20.png?dl=0 (https://www.dropbox.com/s/c6qoqp71nce87vs/Screenshot%20.png?dl=0)
Title: Re: Terminal emulator & GRUB coloring
Post by: altman on December 31, 2014, 05:47:35 PM
Great idea ! funny did had white over black on my Terminal .
Title: Re: Terminal emulator & GRUB coloring
Post by: shengchieh on December 31, 2014, 08:21:31 PM
http://docs.xfce.org/apps/terminal/preferences

You can configure the color anyway you like.

Sheng-Chieh
Title: Re: Terminal emulator & GRUB coloring
Post by: gold_finger on December 31, 2014, 09:44:49 PM
arman1992,

Very good idea -- it would be great to have the terminal set by default as you've shown in your pic.  Now that you mention it, the terminal does seem a bit out of place looking compared to everything else.  Much, much better the way you set it up!  (Don't know why it never occurred to me to do that too.)  Wouldn't surprise me at all if Jerry integrates your idea into the next version of LL.

Welcome to the forum and thanks for the suggestion.
Title: Re: Terminal emulator & GRUB coloring
Post by: altman on January 01, 2015, 10:17:44 AM
Keep the ideas coming up mate !
Title: Re: Terminal emulator & GRUB coloring
Post by: banko on January 01, 2015, 11:30:56 AM
anyone use " guake " ( in the repos).

I find it easier to use, just toggle on and off with F12, customize it to your liking :)

Worth a look.
Title: Re: Terminal emulator & GRUB coloring
Post by: Jerry on January 01, 2015, 12:56:05 PM
arman1992, what's the font and the hex color of the font you are using? Cheers.
Title: Re: Terminal emulator & GRUB coloring
Post by: arman1992 on January 01, 2015, 01:23:53 PM
^ Monospace 11
Background: #464646
Foreground: #F0F0F0
Title: Re: Terminal emulator & GRUB coloring
Post by: Jerry on January 01, 2015, 11:33:18 PM
Thank you, I have seen some nice white on grey terminals and have decided this theme better suits our overall look and will be going into 2.4
Title: Re: Terminal emulator & GRUB coloring
Post by: N4RPS on January 02, 2015, 09:51:30 AM
Hello!

Actually, being both old AND 'old school', on the UEFI netbook, I actually found myself doing such things to Ubuntu MATE as changing the terminal to the 'green screen' look, installing Thunar, Lite Cleaner, Pulse Audio, and the like.

I don't see this as a permanent solution - just waiting to be able to use LL in UEFI mode without resorting to terminal-switching tomfoolery (CTRL-F2/CTRL-F8) to get it to go to the logoff/shutdown screen in under a minute...

73 DE N4RPS
Rob

Title: Re: [SOLVED] Terminal emulator & GRUB coloring
Post by: anon222 on May 03, 2015, 10:15:03 PM
Perhaps we could change some colors
Code: [Select]
leafpad $HOME/.bashrcThem adding this to the end
Code: [Select]
if [ $USER = 'root' ]; then
    PS1="\[\033[01;31m\]$USER@$HOSTNAME\[\033[0;00m\] \[\033[01;32m\]\w\\$\[\033[0;00m\] "
else
    PS1="\[\033[01;33m\]$USER@$HOSTNAME\[\033[0;00m\] \[\033[01;32m\]\w\\$\[\033[0;00m\] "
fi
(http://i.imgur.com/3hlDmMC.png)
Perhaps white bold would better match the current theme
Code: [Select]
if [ $USER = 'root' ]; then
    #If user is root just print the hostname in yellow
    PS1="\[\033[01;33m\]$HOSTNAME\[\033[0;00m\] \[\033[01;32m\]\w\\$\[\033[0;00m\] "
else
    PS1="\[\033[01;97m\]$USER@$HOSTNAME\[\033[0;00m\] \[\033[01;32m\]\w\\$\[\033[0;00m\] "
fi


Title: Re: [SOLVED] Terminal emulator & GRUB coloring
Post by: Jerry on May 04, 2015, 01:02:32 AM
Misko, that is a great idea. Having root as either bold or a different color just makes sense.
Title: Re: [SOLVED] Terminal emulator & GRUB coloring
Post by: gold_finger on May 04, 2015, 01:18:27 PM
I like that idea too, Misko.
Title: Re: [SOLVED] Terminal emulator & GRUB coloring
Post by: riser on May 04, 2015, 04:17:47 PM
Code: [Select]
I'm surprised people have not been doing this within their profiles.  I've had my terminal colors and PS1 set for years across distros.


Here is my prompt configuration (compilation of various online resources over time):
##################################################
# Fancy PWD display function
##################################################
# The home directory (HOME) is replaced with a ~
# The last pwdmaxlen characters of the PWD are displayed
# Leading partial directory names are striped off
# /home/me/stuff          -> ~/stuff               if USER=me
# /usr/share/big_dir_name -> ../share/big_dir_name if pwdmaxlen=20
##################################################
bash_prompt_command() {
    # How many characters of the $PWD should be kept
    local pwdmaxlen=25


    # Indicate that there has been dir truncation
    local trunc_symbol=".."
    local dir=${PWD##*/}
    pwdmaxlen=$(( ( pwdmaxlen < ${#dir} ) ? ${#dir} : pwdmaxlen ))


    NEW_PWD=${PWD/#$HOME/\~}
    local pwdoffset=$(( ${#NEW_PWD} - pwdmaxlen ))


    if [ ${pwdoffset} -gt "0" ]
    then
        NEW_PWD=${NEW_PWD:$pwdoffset:$pwdmaxlen}
        NEW_PWD=${trunc_symbol}/${NEW_PWD#*/}
    fi
}
 
bash_prompt() {
    case $TERM in
     xterm*|rxvt*)
         local TITLEBAR='\[\033]0;\u:${NEW_PWD}\007\]'
          ;;
     *)
         local TITLEBAR=""
          ;;
    esac


    local NONE="\[\033[0m\]"    # unsets color to term's fg color


    # regular colors
    local K="\[\033[0;30m\]"    # black
    local R="\[\033[0;31m\]"    # red
    local G="\[\033[0;32m\]"    # green
    local Y="\[\033[0;33m\]"    # yellow
    local B="\[\033[0;34m\]"    # blue
    local M="\[\033[0;35m\]"    # magenta
    local C="\[\033[0;36m\]"    # cyan
    local W="\[\033[0;37m\]"    # white


    # empahsized (bolded) colors
    local EMK="\[\033[1;30m\]"
    local EMR="\[\033[1;31m\]"
    local EMG="\[\033[1;32m\]"
    local EMY="\[\033[1;33m\]"
    local EMB="\[\033[1;34m\]"
    local EMM="\[\033[1;35m\]"
    local EMC="\[\033[1;36m\]"
    local EMW="\[\033[1;37m\]"


    # background colors
    local BGK="\[\033[40m\]"
    local BGR="\[\033[41m\]"
    local BGG="\[\033[42m\]"
    local BGY="\[\033[43m\]"
    local BGB="\[\033[44m\]"
    local BGM="\[\033[45m\]"
    local BGC="\[\033[46m\]"
    local BGW="\[\033[47m\]"


    local UC=$W                 # user's color


    [ $UID -eq "0" ] && UC=$R   # root's color


    #PS1="$TITLEBAR ${EMG}[${UC}$(date +%H:%M:%S) ${UC}\u${EMB}@${UC}\h ${EMG}\${NEW_PWD}${EMB}]${UC}\\$ ${NONE}"
    PS1="$TITLEBAR ${G}[${C}\d \t \h ${G}\${NEW_PWD}]${UC}\\$ ${NONE}"


    # without colors: PS1="[\u@\h \${NEW_PWD}]\\$ "


    # extra backslash in front of \$ to make bash colorize the prompt
}


PROMPT_COMMAND=bash_prompt_command


bash_prompt


unset bash_prompt
Title: Re: [SOLVED] Terminal emulator & GRUB coloring
Post by: LL-user on May 04, 2015, 06:08:39 PM
Great idea, Misko, especially considering newcomers to Linux would be a bit overwhelmed in having to figure that out.

I have configured it myself. BUT I definitely would prefer it coming out of the box this way.

In addition to this and even more important for me would be to implement that broken links are shown in a different color like this:
(http://i.imgur.com/r4cDxiq.png)

The last couple of days I have extensively worked with softlinks and it was a huge hassle with the default setting not showing valid and broken links in different colors.

Thanks, riser, for sharing!
Title: Re: [SOLVED] Terminal emulator & GRUB coloring
Post by: anon222 on May 05, 2015, 03:55:24 PM
Misko, that is a great idea. Having root as either bold or a different color just makes sense.
It's logical.
I like that idea too, Misko.
I think it would be helpfull. Some other distros use this by default.
I'm surprised people have not been doing this within their profiles.  I've had my terminal colors and PS1 set for years across distros.
Here is my prompt configuration (compilation of various online resources over time):
Thanks for sharing riser. +
Great idea, Misko, especially considering newcomers to Linux would be a bit overwhelmed in having to figure that out.

I have configured it myself. BUT I definitely would prefer it coming out of the box this way.

In addition to this and even more important for me would be to implement that broken links are shown in a different color like this:

The last couple of days I have extensively worked with softlinks and it was a huge hassle with the default setting not showing valid and broken links in different colors.

Thanks, riser, for sharing!
LL-user everything is customizable. Those who remember DOS would easily adapt. ;)
I think those os us who use the terminal more often would like to have some colors.
Those who don't probably think it's too geeky. :)
Thanks for your suggestion. We'll see about that.
Title: Re: [SOLVED] Terminal emulator & GRUB coloring
Post by: LL-user on May 05, 2015, 04:13:22 PM
I'm just using the default color settings. So the setup only needs one step, i.e. putting the following code into /etc/bash.bashrc:
Code: [Select]
if [ -f $HOME/.dir_colors ]; then
  eval $(/usr/bin/dircolors -b $HOME/.dir_colors)
elif [ -f /etc/DIR_COLORS ]; then
  eval $(/usr/bin/dircolors -b /etc/DIR_COLORS)
else
  eval $(/usr/bin/dircolors -b)
fi
Title: Re: [SOLVED] Terminal emulator & GRUB coloring
Post by: anon222 on May 05, 2015, 04:25:57 PM
I like that. No need for the eval here though.
Code: [Select]
if [ -f $HOME/.dir_colors ]; then
  /usr/bin/dircolors -b $HOME/.dir_colors
elif [ -f /etc/DIR_COLORS ]; then
  /usr/bin/dircolors -b /etc/DIR_COLORS
else
  /usr/bin/dircolors -b
fi
Title: Re: [SOLVED] Terminal emulator & GRUB coloring
Post by: Jerry on June 29, 2015, 12:26:43 AM
Have started working on LL 2.6, here is what I have for the root prompt, with a caution:

(http://i.imgur.com/bWncATS.png)
Title: Re: [SOLVED] Terminal emulator & GRUB coloring
Post by: LL-user on July 10, 2015, 10:52:23 AM
Hi Jerry,

Good idea to give an additional heads up.

I just did a test installation of Fedora and very much like their approach, a one time, extended warning at the beginning:

(http://t6.pixhost.org/thumbs/2961/28579407_sudo_message.png) (http://www.pixhost.org/show/2961/28579407_sudo_message.png)