You are Here:
Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section



[SOLVED] Terminal emulator & GRUB coloring

Author (Read 9584 times)

0 Members and 2 Guests are viewing this topic.

Re: [SOLVED] Terminal emulator & GRUB coloring
« Reply #20 on: July 10, 2015, 10:52:23 AM »
 

LL-user

  • I come here a lot
  • *****
  • 455
    Posts
  • Reputation: 214
  • Linux Lite Member
    • View Profile
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:

 

Re: [SOLVED] Terminal emulator & GRUB coloring
« Reply #19 on: June 29, 2015, 12:26:43 AM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Have started working on LL 2.6, here is what I have for the root prompt, with a caution:

 

Re: [SOLVED] Terminal emulator & GRUB coloring
« Reply #18 on: May 05, 2015, 04:25:57 PM »
 

anon222

  • Muted
  • Gold Level Poster
  • *
  • 688
    Posts
  • Reputation: 192
  • Linux Lite Member
    • View Profile

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
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
 

Re: [SOLVED] Terminal emulator & GRUB coloring
« Reply #17 on: May 05, 2015, 04:13:22 PM »
 

LL-user

  • I come here a lot
  • *****
  • 455
    Posts
  • Reputation: 214
  • Linux Lite Member
    • View Profile
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
 

Re: [SOLVED] Terminal emulator & GRUB coloring
« Reply #16 on: May 05, 2015, 03:55:24 PM »
 

anon222

  • Muted
  • Gold Level Poster
  • *
  • 688
    Posts
  • Reputation: 192
  • Linux Lite Member
    • View Profile

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
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.
 

Re: [SOLVED] Terminal emulator & GRUB coloring
« Reply #15 on: May 04, 2015, 06:08:39 PM »
 

LL-user

  • I come here a lot
  • *****
  • 455
    Posts
  • Reputation: 214
  • Linux Lite Member
    • View Profile
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!
« Last Edit: May 04, 2015, 10:18:20 PM by LL-user »
 

Re: [SOLVED] Terminal emulator & GRUB coloring
« Reply #14 on: May 04, 2015, 04:17:47 PM »
 

riser

  • Occasional Poster
  • **
  • 66
    Posts
  • Reputation: 30
  • Linux Lite Member
    • View Profile
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
 

Re: [SOLVED] Terminal emulator & GRUB coloring
« Reply #13 on: May 04, 2015, 01:18:27 PM »
 

gold_finger

  • Documentation Writer
  • Platinum Level Poster
  • *****
  • 1094
    Posts
  • Reputation: 325
  • Linux Lite Member
    • View Profile

  • CPU: Intel Core2 Duo E7500 3.0GHz

  • MEMORY: 4Gb

  • VIDEO CARD: Intel 4 Series Integrated Graphics
I like that idea too, Misko.
Try Linux Beginner Search Engine for answers to Linux questions.
 

Re: [SOLVED] Terminal emulator & GRUB coloring
« Reply #12 on: May 04, 2015, 01:02:32 AM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Misko, that is a great idea. Having root as either bold or a different color just makes sense.
 

Re: [SOLVED] Terminal emulator & GRUB coloring
« Reply #11 on: May 03, 2015, 10:15:03 PM »
 

anon222

  • Muted
  • Gold Level Poster
  • *
  • 688
    Posts
  • Reputation: 192
  • Linux Lite Member
    • View Profile

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
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

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


 

Re: Terminal emulator & GRUB coloring
« Reply #10 on: January 02, 2015, 09:51:30 AM »
 

N4RPS

  • Donator
  • Platinum Level Poster
  • **********
  • 1149
    Posts
  • Reputation: 155
  • Knows JUST ENOUGH Linux to be DANGEROUS
    • View Profile
    • Orphans for Christ, Self Advocates of Mecklenburg

  • CPU: Several Different 32-bit & 64-bit CPUs, 2-8 GB RAM

  • MEMORY: 8Gb

  • VIDEO CARD: Several Different AMD and Intel GPUs
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



A gun in your hand is worth more than a whole police force on the phone.
 

Re: Terminal emulator & GRUB coloring
« Reply #9 on: January 01, 2015, 11:33:18 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
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
 

Re: Terminal emulator & GRUB coloring
« Reply #8 on: January 01, 2015, 01:23:53 PM »
 

arman1992

  • Guest
^ Monospace 11
Background: #464646
Foreground: #F0F0F0
 

Re: Terminal emulator & GRUB coloring
« Reply #7 on: January 01, 2015, 12:56:05 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
arman1992, what's the font and the hex color of the font you are using? Cheers.
 

Re: Terminal emulator & GRUB coloring
« Reply #6 on: January 01, 2015, 11:30:56 AM »
 

banko

  • Forum Regular
  • ***
  • 154
    Posts
  • Reputation: 16
  • Linux Lite Member
    • View Profile

  • CPU: Dual core Celeron CPU T3300 (-MCP-)

  • MEMORY: 4Gb

  • VIDEO CARD: Intel Mobile 4 Series Integrated
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.
 

 

-->
X Close Ad

Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section