Brian_Arita

Brian_Arita

1p

1 comments posted · 0 followers · following 0

14 years ago @ Ubuntu Tutorials : Dap... - .screenrc · 0 replies · +1 points

I use this hard status because frequently I have a lot of windows open. I added comments for clarity
# Output green [] with the hostname colored brown in the middle
# %{= kG}[ %{y}%H %{g}]
# Output a [ thats green
# [
# Leave a gap for the hostname
# %15=
# Mark that spot for truncation
# %>
# Print all the other windows prior to the current one up to 40% width
# %-Lw%40>
# Print out a red (
# %{r}(
# Print out White Bold Text Of the Window Number, a *, flags, title
# %{W}%n*%f %t
# Print out other users on that screen (if some exist)
# %?(%u)%?
# Print out a red ) and then switch back to green
# %{r})%{g}
# Print out all the other windows after the current one
# %+Lw
# Leave some room on the end for the date and time and mark that as the other truncation point
# %-22<
# Print the closing bracket, the opening bracket for the final section, a cyan marker, the date and time, and a green ]
# ][%{c} %Y-%m-%d %c %{g}]
hardstatus alwayslastline '%{= kG}[ %{y}%H %{g}][%15= %>%-Lw%40>%{r}(%{W}%n*%f %t%?(%u)%?%{r})%{g}%+Lw%-22< ][%{c} %Y-%m-%d %c %{g}]'

Another nice thing is to use this:
bind e stuff 'echo -en "\ekU@H\e\\"|sed -e "s/H/`hostname`/" -e "s/U/`whoami`/"'

So that when you ssh into a new computer you can have the title of the screen be User@hostname

If you use vim to edit your screenrc file you can press Ctrl+v ctrl+m before the last ' on the echo command, then a return key will be added to that command.