Adjustment the PS1 shade based upon the history shade?

I found out that I can transform the layout of PS1, specifically the shade of the string. After that, is it feasible to transform the shade based upon the history shade of the covering? Or, just how can I identify the history shade of the covering?

2019-05-07 01:20:24
Source Share
Answers: 2

As much as I recognize, there's no other way to quiz the colors of the terminal emulator. You can transform them with \e]4;NUMBER;#RRGGBB\a (where NUMBER is the terminal shade number (0-- 7 for light colors, 8-- 15 for intense colors) and also #RRGGBB is a hexadecimal RGB shade value) if your terminal assistances that series (reference : ctlseqs).

Effective color pattern devices usually have a dark or light history establishing that you have to provide to show whether you have a black or dark grey history, or a white or light grey history.

When you're setting up on your own, it's generally adequate to determine you'll constantly make use of the very same history shade.

2019-05-08 22:30:13

If you are making use of gnome - terminal you can get the history shade for any kind of account, in this instance for the Default account as

   $ gconftool-2 --get /apps/gnome-terminal/profiles/Default/background_color

after that you can determine just how to set your prompt as necessary.

2019-05-08 21:54:22