Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Customize tty colors....

  1. #11
    Join Date
    Jan 2014
    Location
    The Endless Ocean
    Beans
    223
    Distro
    Xubuntu

    Re: Customize tty colors....

    Quote Originally Posted by The Cog View Post
    No need to reboot. I tried one of the commands (echo -en "\e]P0222222") in my tty and it kinda worked. It changed the background colour, the foreground stayed white.
    This changes the normal foreground (colour 7" from lightgray to a kind of orangey-brown: echo -en "\e]P7dd7733"
    So I put all the above (except for the if and fi lines) in a text file and sourced it in bash, and it changed the fireground to bright white.

    So the script works on my Xubuntu 18.04.

    Hmm. Why am I not on 18.10???
    Thank you very much for checking & for adding some detail ^^* Here is two screenshots showing what both sets of colors look like. I'm a tad confused so sorry in advanced if I I'm stupid in any way....
    [ d:Tour // Reviziis ]

  2. #12
    Join Date
    Jan 2014
    Location
    The Endless Ocean
    Beans
    223
    Distro
    Xubuntu

    Re: Customize tty colors....

    Quote Originally Posted by guber2 View Post
    Do you have a ~/.bash_profile file?
    If you have a ~/.bash_profile, tty will read that first I think.
    In my home folder I have..


    • .bash_history
    • .bash_logout
    • .bashrc
    • .bashrc


    I can see no ~/.bash_profile....
    [ d:Tour // Reviziis ]

  3. #13
    Join Date
    Dec 2014
    Beans
    2,590

    Re: Customize tty colors....

    .bashrc is for interactive non-login shells. login-shells don't read it unless .profile or .bash_profile tells them to (which the ~/.profile in Ubuntu does by default, I think).

    Instead of using unreadable (and probably not portable) escape sequences, you might want to take a look at the program tput and the manual for terminfo to get the names and possible values of terminal capabilities to use with tput. For example:
    Code:
    tput colors # outputs the number of colours the terminal can use (8 on the console of my machine, numbered 0 to 7)
    tput set_ab 0 # set background to colour 0
    tput set_af 7 # set foreground to colour 7
    tput initc 0 1000 0 0 # initialize colour 0 to a bright red (rgb, components from 0 to 1000)
    Holger

  4. #14
    Join Date
    Jan 2014
    Location
    The Endless Ocean
    Beans
    223
    Distro
    Xubuntu

    Re: Customize tty colors....

    Quote Originally Posted by Holger_Gehrke View Post
    .bashrc is for interactive non-login shells. login-shells don't read it unless .profile or .bash_profile tells them to (which the ~/.profile in Ubuntu does by default, I think).

    Instead of using unreadable (and probably not portable) escape sequences, you might want to take a look at the program tput and the manual for terminfo to get the names and possible values of terminal capabilities to use with tput. For example:
    Code:
    tput colors # outputs the number of colours the terminal can use (8 on the console of my machine, numbered 0 to 7)
    tput set_ab 0 # set background to colour 0
    tput set_af 7 # set foreground to colour 7
    tput initc 0 1000 0 0 # initialize colour 0 to a bright red (rgb, components from 0 to 1000)
    Holger
    Thanks for the suggestion & for going into some detail. Going to look into this now....
    [ d:Tour // Reviziis ]

  5. #15
    Join Date
    Jan 2014
    Location
    The Endless Ocean
    Beans
    223
    Distro
    Xubuntu

    Re: Customize tty colors....

    After some research I have found that this can be accomplished, but it is not easy & would take a fair amount of time / work. Marking this thread as solved....
    [ d:Tour // Reviziis ]

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •