screen git 24-bit color needs rewriting of the caption and hardstatus strings
by fakie_flip from LinuxQuestions.org on (#545D5)
I installed the latest aur/screen-git package to get 24-bit colors, so that bashtop and a few others display properly.
screen is useful to be able to switch windows with a key combo and re-attach an already running screen even if you close the terminal and reopen it, always resume where you left off, etc., etc. It also supports vertical and horizontal splits.
Some lines in my ~/.screenrc
Code:term screen-256color
truecolor on
hardstatus off
##hardstatus alwayslastline
hardstatus firstline # Statusbar at top
hardstatus string '%{= bW}%-Lw%{= rW}%50>%n%f* %t%{= bW}%+Lw%< %{= bd}%-=%D %d %M %Y %c:%s%{-}'
caption always "%{= rW} [ %S ] %f %t %? ( %{rY} %u %{rW} ) %?"
## Default screens
screen -t root 0
stuff "su -\n"
screen -t weather 1 curl -s wttr.in
screen -t music 2 mocpThe hardstatus string and caption string were compatible with screen 0.4 but not screen 0.5 git. I need help rewriting them to be compatible.
I found this example on the arch wiki to get the date to show properly using backtick.
Code:truecolors on
hardstatus off
backtick 0 5 5 "/bin/date" '+%Y-%m-%d'
backtick 1 5 5 "/bin/date" '+%H:%M'
hardstatus alwayslastline '%{#00ff00}[ %H ][%{#ffffff}%= %{7}%?%-Lw%?%{1;0}%{1}(%{15}%n%f%t%?(%u)%?%{1;0}%{1})%{7}%?%+Lw%?%? %=%{#00ff00}][ %{#00a5ff}%{6}%0` %{#ffffff}%{7}%1`%{#00ff00} ]'Color codes:
White #FFFFFF
Blue #0000FF
Red #FF0000
Understanding GNU Screen's hardstatus Strings: https://www.kilobitspersecond.com/20...tatus-strings/
String Escapes : https://www.gnu.org/software/screen/...g-Escapes.html
I tried this.
Code:hardstatus string '%{#ffffff;#0000ff}%-Lw%{#ffffff;#ff0000}%50>%n%f* %t%{#ffffff;#0000ff}%+Lw%< %{#0000ffd}%-=%D %d %M %Y %c:%s%{-}'This is what it looks like in screen 0.4 and what it looks like in screen git 0.5 after I rewrote some of it to have the new color codes. Also the colors look differently because I couldn't find out how to do dim, bright, and other attributes in screen git 0.5, need help with that too.
Maybe the = belongs somewhere in there even after changing out the color codes?
EDIT: I changed the caption line to this:
Code:caption always "%{#ffffff;#ff0000} [ %S ] %f %t %? ( %{rY} %u %{#ffffff;#ff0000} ) %?"And now it looks correct with red and white. Only it's showing the tty and hostname pts-2.plasma instead of the screen session name for example xyz when starting screen with screen -S xyz
Attached Thumbnails


screen is useful to be able to switch windows with a key combo and re-attach an already running screen even if you close the terminal and reopen it, always resume where you left off, etc., etc. It also supports vertical and horizontal splits.
Some lines in my ~/.screenrc
Code:term screen-256color
truecolor on
hardstatus off
##hardstatus alwayslastline
hardstatus firstline # Statusbar at top
hardstatus string '%{= bW}%-Lw%{= rW}%50>%n%f* %t%{= bW}%+Lw%< %{= bd}%-=%D %d %M %Y %c:%s%{-}'
caption always "%{= rW} [ %S ] %f %t %? ( %{rY} %u %{rW} ) %?"
## Default screens
screen -t root 0
stuff "su -\n"
screen -t weather 1 curl -s wttr.in
screen -t music 2 mocpThe hardstatus string and caption string were compatible with screen 0.4 but not screen 0.5 git. I need help rewriting them to be compatible.
I found this example on the arch wiki to get the date to show properly using backtick.
Code:truecolors on
hardstatus off
backtick 0 5 5 "/bin/date" '+%Y-%m-%d'
backtick 1 5 5 "/bin/date" '+%H:%M'
hardstatus alwayslastline '%{#00ff00}[ %H ][%{#ffffff}%= %{7}%?%-Lw%?%{1;0}%{1}(%{15}%n%f%t%?(%u)%?%{1;0}%{1})%{7}%?%+Lw%?%? %=%{#00ff00}][ %{#00a5ff}%{6}%0` %{#ffffff}%{7}%1`%{#00ff00} ]'Color codes:
White #FFFFFF
Blue #0000FF
Red #FF0000
Understanding GNU Screen's hardstatus Strings: https://www.kilobitspersecond.com/20...tatus-strings/
String Escapes : https://www.gnu.org/software/screen/...g-Escapes.html
I tried this.
Code:hardstatus string '%{#ffffff;#0000ff}%-Lw%{#ffffff;#ff0000}%50>%n%f* %t%{#ffffff;#0000ff}%+Lw%< %{#0000ffd}%-=%D %d %M %Y %c:%s%{-}'This is what it looks like in screen 0.4 and what it looks like in screen git 0.5 after I rewrote some of it to have the new color codes. Also the colors look differently because I couldn't find out how to do dim, bright, and other attributes in screen git 0.5, need help with that too.
Maybe the = belongs somewhere in there even after changing out the color codes?
EDIT: I changed the caption line to this:
Code:caption always "%{#ffffff;#ff0000} [ %S ] %f %t %? ( %{rY} %u %{#ffffff;#ff0000} ) %?"And now it looks correct with red and white. Only it's showing the tty and hostname pts-2.plasma instead of the screen session name for example xyz when starting screen with screen -S xyz
Attached Thumbnails