Mageia Bugzilla – Attachment 9342 Details for
Bug 19026
sshd no longer sets DISPLAY variable (with X11UseLocalhost workaround)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
rc file for color script
99prompt.rc (text/plain), 6.14 KB, created by
Pierre Fortin
on 2017-05-26 23:07:30 CEST
(
hide
)
Description:
rc file for color script
Filename:
MIME Type:
Creator:
Pierre Fortin
Created:
2017-05-26 23:07:30 CEST
Size:
6.14 KB
patch
obsolete
># -*- Mode: sh; -*- > ># Copyright: Pierre Fortin, 2007-present <pf@pfortin.com> ># License: GPLv3 > ># 07/02/2016 use new colors for "su" v. "su -" ># 07/23/2016 unset our variables to minimize userspace polution ># 08/01/2016 added error & debug code ># complete rework of main script and color setting variables ># colormap is now incorporated in this file > >prompt_DEBUG=0 # set to 1 to enable basic debugging > ># This file contains the user changeable parameters. It may be copied to ># the user's home directory as ".99prompt.rc" (note leading '.') and ># altered to suit for specific users, or globally in /etc/profile.d as ># 99prompt.rc > ># PROMPT ># See 'man bash' -> 'PROMPTING' for codes... ># ># Syntax: ># PROMPT=("string1" "string2" ...) # parens required ># ># Each string will appear in a separate color bar (if background colors are ># used) -- add \n where you want a newline ># ># Traditional prompt: ># PROMPT="[\u@\h \W]" # colors make [..] brackets redundant ># ># The LAST uncommented PROMPT will be used: ># ># Sample prompts: >#PROMPT=(\$) # just raw prompts "$" or "#" >#PROMPT=("\u@\h \w" "\t") # "user@host ~", "time" >#PROMPT=("\u@\h \w" "\D{%x} \t") # "user@host ~", "date time" >#PROMPT=("\u@\h \w" "\D{%x} \t") # "1.2.3.4:user@host ~", "date time" >#PROMPT=("\D{%x} \t \u@\h \w") # "date time user@host ~" >#PROMPT=("\D{%x} \t \u@\H \W") # "date time user@host.domain.tld ~" >PROMPT=("\D{%x} \t" "\u@\h" "\n\w" "\n\$") # "date time user@host ~", [$#] on separate line >PROMPT=("\u@\h" " \d \t" "\n\w" "\n\$ ") # "date time user@host ~", [$#] on separate line > ># NOTES: ># 1. when using "su" v. {"su -","su --login"} ># $USER contains the user name of the caller, not "root" > >################################################################################ ># Color variables > ># WARNING!! WARNING!! WARNING!! WARNING!! WARNING!! WARNING!! WARNING!! ># ># bash silently (mostly) ignores variable typos and returns an empty string ># So DO be careful if you change colors; these are DuAlCaSe... > >modeRESET="0"; ># Modes >modeBRIGHT="1"; modeBRIGHToff="21"; >modeBOLD="1"; modeBOLDoff="21"; >modeDIM="2"; modeDIMoff="22"; >modeSTANDOUT="3"; modeSTANDOUToff="23"; modeITALIC="3"; modeITALICoff="23"; >modeUNDERSCORE="4"; modeUNDERSCOREoff="24"; >modeBLINK="5"; modeBLINKoff="25"; >modeREVERSE="7"; modeREVERSEoff="27"; >modeHIDDEN="8"; modeHIDDENoff="28"; > ># Foreground Colors >fgDEFAULT="39"; fgBLACK="30"; fgRED="31"; fgGREEN="32"; fgYELLOW="33"; >fgBLUE="34"; fgMAGENTA="35"; fgCYAN="36"; fgLTGRAY="37"; >fgDKGRAY="90"; fgLTRED="91"; fgLTGREEN="92"; fgLTYELLOW="93"; >fgLTBLUE="94"; fgLTMAGENTA="95"; fgLTCYAN="96"; fgWHITE="97"; > ># Backgrounds >bgDEFAULT="49"; bgBLACK="40"; bgRED="41"; bgGREEN="42"; bgYELLOW="43"; >bgBLUE="44"; bgMAGENTA="45"; bgCYAN="46"; bgWHITE="47"; >bgDKGRAY="100"; bgLTRED="101"; bgLTGREEN="102"; bgLTYELLOW="103"; >bgLTBLUE="104"; bgLTMAGENTA="105"; bgLTCYAN="106"; bgWHITE="107"; > >###################################################################### ># I hope you like my choice of colors/modes... they were chosen ># to maximize the visibility and user/root modes on either ># black or white backgrounds. They also help to find the ># prompts when scrolling through a lot of output. > >###################################################################### > ># The following variables define the color scheme you get for each ># type of connection and user v. root v. [user]root. > ># The color variables consist of PROMPT plus 5 underscore-joined label parts: ># 1 - instance: {REAL,SSH} ># 2 - location: {LOCAL,REMOTE} ># 3 - how: {INIT,SU} ># 4 - user: {USER,ROOT} ># 5 - mode: {LOGIN,NOLOGIN} > ># Each variable requires, in order, one each: ># $modeMODE $fgCOLOR $bgCOLOR ># within parentheses. > ># At initial release, the following logic was used: ># 1. when first opening a new konsole, xterm, ssh etc, the prompt is green ># to indicate this is the initial conection. ># 2. the prompt will also indicate how the connection was made: ># a) normal font = direct connection ># b) italic font = ssh to local host ># c) underscored font = ssh to remote host (over the "wire") ># 3. font color indicates how the connection was made: ># a) red: su -|--login (root) ># b) magenta: su (root) ># c) cyan: su -|--login user ># d) yellow: su user > ># initial (kdeinit, xterm) >PROMPT_REAL_LOCAL_INIT_USER_LOGIN=( $modeRESET $fgLTGREEN $bgBLACK ) # new konsole ># included for completeness; but unwise for security reasons: >PROMPT_REAL_LOCAL_INIT_ROOT_NOLOGIN=( $modeITALIC $fgLTMAGENTA $bgBLACK ) # new root konsole ># >PROMPT_REAL_LOCAL_SU_ROOT_NOLOGIN=( $modeRESET $fgLTMAGENTA $bgBLACK ) # su >PROMPT_REAL_LOCAL_SU_ROOT_LOGIN=( $modeRESET $fgLTRED $bgBLACK ) # su --login >PROMPT_REAL_LOCAL_SU_USER_NOLOGIN=( $modeRESET $fgLTYELLOW $bgBLACK ) # su user >PROMPT_REAL_LOCAL_SU_USER_LOGIN=( $modeRESET $fgLTCYAN $bgBLACK ) # su --login user > ># Not possible to connect to a remote host directly; hence: ># PROMPT_REAL_REMOTE_* = not valid > ># ssh to local host (initial connection) -- italicized prompts >PROMPT_SSH_LOCAL_INIT_USER_NOLOGIN=( $modeITALIC $fgLTYELLOW $bgBLACK ) # ssh to local host >PROMPT_SSH_LOCAL_INIT_USER_LOGIN=( $modeITALIC $fgLTGREEN $bgBLACK ) # ssh to local host ># >PROMPT_SSH_LOCAL_SU_ROOT_NOLOGIN=( $modeITALIC $fgLTMAGENTA $bgBLACK ) # ssh + su >PROMPT_SSH_LOCAL_SU_ROOT_LOGIN=( $modeITALIC $fgLTRED $bgBLACK ) # ssh + su --login >PROMPT_SSH_LOCAL_SU_USER_NOLOGIN=( $modeITALIC $fgLTYELLOW $bgBLACK ) # ssh + su user >PROMPT_SSH_LOCAL_SU_USER_LOGIN=( $modeITALIC $fgLTCYAN $bgBLACK ) # ssh + su --login user > ># ssh to remote host (initial connections) -- underscore (prompts over "wire") >PROMPT_SSH_REMOTE_INIT_USER_NOLOGIN=( $modeUNDERSCORE $fgLTYELLOW $bgBLACK ) # ssh to remote host >PROMPT_SSH_REMOTE_INIT_USER_LOGIN=( $modeUNDERSCORE $fgLTGREEN $bgBLACK ) # ssh to remote host ># >PROMPT_SSH_REMOTE_SU_ROOT_NOLOGIN=( $modeUNDERSCORE $fgLTMAGENTA $bgBLACK ) # ssh + su >PROMPT_SSH_REMOTE_SU_ROOT_LOGIN=( $modeUNDERSCORE $fgLTRED $bgBLACK ) # ssh + su --login >PROMPT_SSH_REMOTE_SU_USER_NOLOGIN=( $modeUNDERSCORE $fgLTYELLOW $bgBLACK ) # ssh + su user >PROMPT_SSH_REMOTE_SU_USER_LOGIN=( $modeUNDERSCORE $fgLTCYAN $bgBLACK ) # ssh + su --login user
# -*- Mode: sh; -*- # Copyright: Pierre Fortin, 2007-present <pf@pfortin.com> # License: GPLv3 # 07/02/2016 use new colors for "su" v. "su -" # 07/23/2016 unset our variables to minimize userspace polution # 08/01/2016 added error & debug code # complete rework of main script and color setting variables # colormap is now incorporated in this file prompt_DEBUG=0 # set to 1 to enable basic debugging # This file contains the user changeable parameters. It may be copied to # the user's home directory as ".99prompt.rc" (note leading '.') and # altered to suit for specific users, or globally in /etc/profile.d as # 99prompt.rc # PROMPT # See 'man bash' -> 'PROMPTING' for codes... # # Syntax: # PROMPT=("string1" "string2" ...) # parens required # # Each string will appear in a separate color bar (if background colors are # used) -- add \n where you want a newline # # Traditional prompt: # PROMPT="[\u@\h \W]" # colors make [..] brackets redundant # # The LAST uncommented PROMPT will be used: # # Sample prompts: #PROMPT=(\$) # just raw prompts "$" or "#" #PROMPT=("\u@\h \w" "\t") # "user@host ~", "time" #PROMPT=("\u@\h \w" "\D{%x} \t") # "user@host ~", "date time" #PROMPT=("\u@\h \w" "\D{%x} \t") # "1.2.3.4:user@host ~", "date time" #PROMPT=("\D{%x} \t \u@\h \w") # "date time user@host ~" #PROMPT=("\D{%x} \t \u@\H \W") # "date time user@host.domain.tld ~" PROMPT=("\D{%x} \t" "\u@\h" "\n\w" "\n\$") # "date time user@host ~", [$#] on separate line PROMPT=("\u@\h" " \d \t" "\n\w" "\n\$ ") # "date time user@host ~", [$#] on separate line # NOTES: # 1. when using "su" v. {"su -","su --login"} # $USER contains the user name of the caller, not "root" ################################################################################ # Color variables # WARNING!! WARNING!! WARNING!! WARNING!! WARNING!! WARNING!! WARNING!! # # bash silently (mostly) ignores variable typos and returns an empty string # So DO be careful if you change colors; these are DuAlCaSe... modeRESET="0"; # Modes modeBRIGHT="1"; modeBRIGHToff="21"; modeBOLD="1"; modeBOLDoff="21"; modeDIM="2"; modeDIMoff="22"; modeSTANDOUT="3"; modeSTANDOUToff="23"; modeITALIC="3"; modeITALICoff="23"; modeUNDERSCORE="4"; modeUNDERSCOREoff="24"; modeBLINK="5"; modeBLINKoff="25"; modeREVERSE="7"; modeREVERSEoff="27"; modeHIDDEN="8"; modeHIDDENoff="28"; # Foreground Colors fgDEFAULT="39"; fgBLACK="30"; fgRED="31"; fgGREEN="32"; fgYELLOW="33"; fgBLUE="34"; fgMAGENTA="35"; fgCYAN="36"; fgLTGRAY="37"; fgDKGRAY="90"; fgLTRED="91"; fgLTGREEN="92"; fgLTYELLOW="93"; fgLTBLUE="94"; fgLTMAGENTA="95"; fgLTCYAN="96"; fgWHITE="97"; # Backgrounds bgDEFAULT="49"; bgBLACK="40"; bgRED="41"; bgGREEN="42"; bgYELLOW="43"; bgBLUE="44"; bgMAGENTA="45"; bgCYAN="46"; bgWHITE="47"; bgDKGRAY="100"; bgLTRED="101"; bgLTGREEN="102"; bgLTYELLOW="103"; bgLTBLUE="104"; bgLTMAGENTA="105"; bgLTCYAN="106"; bgWHITE="107"; ###################################################################### # I hope you like my choice of colors/modes... they were chosen # to maximize the visibility and user/root modes on either # black or white backgrounds. They also help to find the # prompts when scrolling through a lot of output. ###################################################################### # The following variables define the color scheme you get for each # type of connection and user v. root v. [user]root. # The color variables consist of PROMPT plus 5 underscore-joined label parts: # 1 - instance: {REAL,SSH} # 2 - location: {LOCAL,REMOTE} # 3 - how: {INIT,SU} # 4 - user: {USER,ROOT} # 5 - mode: {LOGIN,NOLOGIN} # Each variable requires, in order, one each: # $modeMODE $fgCOLOR $bgCOLOR # within parentheses. # At initial release, the following logic was used: # 1. when first opening a new konsole, xterm, ssh etc, the prompt is green # to indicate this is the initial conection. # 2. the prompt will also indicate how the connection was made: # a) normal font = direct connection # b) italic font = ssh to local host # c) underscored font = ssh to remote host (over the "wire") # 3. font color indicates how the connection was made: # a) red: su -|--login (root) # b) magenta: su (root) # c) cyan: su -|--login user # d) yellow: su user # initial (kdeinit, xterm) PROMPT_REAL_LOCAL_INIT_USER_LOGIN=( $modeRESET $fgLTGREEN $bgBLACK ) # new konsole # included for completeness; but unwise for security reasons: PROMPT_REAL_LOCAL_INIT_ROOT_NOLOGIN=( $modeITALIC $fgLTMAGENTA $bgBLACK ) # new root konsole # PROMPT_REAL_LOCAL_SU_ROOT_NOLOGIN=( $modeRESET $fgLTMAGENTA $bgBLACK ) # su PROMPT_REAL_LOCAL_SU_ROOT_LOGIN=( $modeRESET $fgLTRED $bgBLACK ) # su --login PROMPT_REAL_LOCAL_SU_USER_NOLOGIN=( $modeRESET $fgLTYELLOW $bgBLACK ) # su user PROMPT_REAL_LOCAL_SU_USER_LOGIN=( $modeRESET $fgLTCYAN $bgBLACK ) # su --login user # Not possible to connect to a remote host directly; hence: # PROMPT_REAL_REMOTE_* = not valid # ssh to local host (initial connection) -- italicized prompts PROMPT_SSH_LOCAL_INIT_USER_NOLOGIN=( $modeITALIC $fgLTYELLOW $bgBLACK ) # ssh to local host PROMPT_SSH_LOCAL_INIT_USER_LOGIN=( $modeITALIC $fgLTGREEN $bgBLACK ) # ssh to local host # PROMPT_SSH_LOCAL_SU_ROOT_NOLOGIN=( $modeITALIC $fgLTMAGENTA $bgBLACK ) # ssh + su PROMPT_SSH_LOCAL_SU_ROOT_LOGIN=( $modeITALIC $fgLTRED $bgBLACK ) # ssh + su --login PROMPT_SSH_LOCAL_SU_USER_NOLOGIN=( $modeITALIC $fgLTYELLOW $bgBLACK ) # ssh + su user PROMPT_SSH_LOCAL_SU_USER_LOGIN=( $modeITALIC $fgLTCYAN $bgBLACK ) # ssh + su --login user # ssh to remote host (initial connections) -- underscore (prompts over "wire") PROMPT_SSH_REMOTE_INIT_USER_NOLOGIN=( $modeUNDERSCORE $fgLTYELLOW $bgBLACK ) # ssh to remote host PROMPT_SSH_REMOTE_INIT_USER_LOGIN=( $modeUNDERSCORE $fgLTGREEN $bgBLACK ) # ssh to remote host # PROMPT_SSH_REMOTE_SU_ROOT_NOLOGIN=( $modeUNDERSCORE $fgLTMAGENTA $bgBLACK ) # ssh + su PROMPT_SSH_REMOTE_SU_ROOT_LOGIN=( $modeUNDERSCORE $fgLTRED $bgBLACK ) # ssh + su --login PROMPT_SSH_REMOTE_SU_USER_NOLOGIN=( $modeUNDERSCORE $fgLTYELLOW $bgBLACK ) # ssh + su user PROMPT_SSH_REMOTE_SU_USER_LOGIN=( $modeUNDERSCORE $fgLTCYAN $bgBLACK ) # ssh + su --login user
View Attachment As Raw
Actions:
View
Attachments on
bug 19026
:
9341
| 9342 |
9395