-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscreenrc
191 lines (161 loc) · 7.58 KB
/
screenrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# screenrc
echo "Running main screenrc"
##############################################################################
echo "--v--"
echo " HOME = $HOME"
echo " HOSTNAME = $HOSTNAME"
echo " PROFILECONFIGDIR = $PROFILECONFIGDIR"
echo " MACHINECONFIGDIR = $MACHINECONFIGDIR"
echo "--\^--"
# Set up the configuration, all the binds and options
##############################################################################
##########################################################################################
## Brak's screenrc (based off Shii's Easy Screenrc (based off of blcknight's screenrc)) ##
## Shii's Easy Screenrc : http://shii.org/knows/Screenrc ##
##########################################################################################
##
## Useful settings.
##
##########################################################################
crlf off ## No Microsoft linebreaks. ##
termcapinfo screen* ti@:te@ ##
startup_message off ## Bypass the GPL notice, please. ##
vbell off ## Disable the visual bell alert. ##
autodetach on ##
altscreen on ##
defscrollback 10000 ## Screen remembers more history. ##
defmousetrack off ## Enable mouse support for clicking areas. ##
# shell bash ## Bash is a rather nice shell. ##
# shelltitle "$ |bash" ## Blank shell title ##
defmonitor on ## Turn monitoring on (see 'activity') ##
activity "Activity in window %n" ## Let you know when stuff happens! ##
msgminwait 0 ## Messages on the screen for at least X ##
msgwait 3 ## Leave messages up for X. ##
sessionname main ## ##
defutf8 on ## ##
nonblock on ## ##
hardcopy_append on ## ##
#nethack on ## Makes error messages cryptic. ##
# Enable nethack to make screen more interesting, or keep it disabled ##
# to make screen more informative. ##
##########################################################################
##
## Make windows stay alive, even after they've been ended
##
############################################################
zombie kr
##
## Commands used for backtick substitutions: %` %0` %1`
##
############################################################
backtick 0 0 1 pwd
backtick 1 0 1 $HOME/Source/blakecode-linux-configs/justuptime.sh
backtick 2 0 5 $HOME/Source/blakecode-linux-configs/myip.sh
##
## This caption will always appear at the bottom of the window.
## To fiddle with it, read the man page for screen.
##
######################################################
#
caption always
#~ caption string "%{= bw} %H [%t] %h %= uptime: %1` %D %M %d %C%a "
# caption string '%{= mw} %H %0` [%t] %h %= %l %{-b W}%2`%{-} %D %M %d %C%a '
caption string '%{= mw} %1` %= %l %{-b W}%2`%{-} %D %M %d %C%a '
#~ hardstatus off
hardstatus alwayslastline
#~ hardstatus alwaysfirstline
#~ hardstatus string "%-Lw%{= bw}%50>%n%f* %t%{-}%+Lw%<"
#~ hardstatus string '%{= mK}%-Lw%{= KW}%50>%n%f* %t%{= mK}%+Lw%< %{= kG}%-=%D %d %M %Y %c:%s%{-}'
#~ hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{-}%{bW}%n*%f%t%?(%u)%?%{-}%{r})%{-}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'
hardstatus string '%{= kg}[ %{y}%H%{-} ][%= %{y}%?%-Lw%?%{-}%{+b mY} (%{-b W}%n %t%?(%u)%?%{+b .Y}) %{-}%{-}%{-}%{y}%+Lw%?%?%=%{-} ][ %{M}%Y-%m-%d %{W}%c%{= g} ]'
#~ hardstatus string '%{= kg}[ %{G}%H %{-}][%= %{G}%?%-Lw%?%{-}%{bW}%n%f %t%?(%u)%?%{-}%{G}%+Lw%?%?%=%{-} ][%{B} %d/%m %{W}%c %{g}]'
#~ hardstatus string '%{= kw}[ %{= kb}%H%{= kw} ][ %= %{= kw}%?%-Lw%?%{= kr}(%{= kW}%n*%f %t%?(%u)%?%{= kr})%{= kw}%?%+Lw%?%?%= %{w} ][ %{r}%l%{w} ]%{w}[%{r} %d/%m/%y %C %A %{w}]%{w}'
#~ hardstatus string '%{= kw}[ %{= kb}%H%{= kw} ][%= %{= kw}%?%-Lw%?%{= kW}%n*%f %t%?%?%{= kw}%?%+Lw%?%?%= ][ %{r}%l%{w} ]%{w}[%{r} %d/%m/%y %C %A %{w}]%{w}'
windowlist string "%3n %t %h%=%f"
##
## Let's do some bindings.
##
######################################################
#bind 'R' screen ssh s1554463@sunfire16
#bind 'R' screen -t sunfire16 ssh s1554463@sunfire16
#~ bind ^q quit ## Doesn't work. Use F12 instead.
bind ^t screen -t # ^T # Create a new window
bind q kill # ^Q # Quit a window
##
## Get F-Keys emulated properly
##
#############################################################################
## http://www.gnu.org/software/screen/manual/screen.html#Input-Translation ##
#############################################################################
terminfo * k1=\033OP
terminfo * k2=\033OQ
terminfo * k3=\033OR
terminfo * k4=\033OS
terminfo * k5=\E[15~
terminfo * k6=\E[17~
terminfo * k7=\E[18~
terminfo * k8=\E[19~
terminfo * k9=\E[20~
terminfo * k;=\E[21~
terminfo * F1=\E[23~
terminfo * F2=\E[24~
##
## Easy window switcher and command runner.
##
######################################################################
## I don't know of any Unix programs that use these keys... do you? ##
######################################################################
#~ bindkey "^T" screen -t # ^T # Create a new window
bindkey -k k1 select 1 # F1
bindkey -k k2 select 2 # F2
bindkey -k k3 select 3 # F3
bindkey -k k4 select 4 # F4
bindkey -k k5 select 5 # F5
bindkey -k k6 select 6 # F6
bindkey -k k7 select 7 # F7
bindkey -k k8 select 8 # F8
bindkey -k k9 select 9 # F9
bindkey -k k; source "$HOME/.screenrccfg" # F10 # Reload this file, in case we are editing it.
bindkey -k F1 command # F11 # Shortcut to [Ctrl]-[a]
bindkey -k F2 quit # F12 # Quick Quit All
bindkey -k kI command # Insert # Shortcut to [Ctrl]-[a]
# Pretend that the window numbering starts at 1, not 0.
# Then use command '0' to jump to window number #10.
bind c screen 1
bind 0 select 10
# use the PgUp and PgDn keys to enter copy mode
# and page through the window backlog:
# bindkey -k kP copy
##
## Scroll wheel moves up and down the terminal history.
##
#############################################################################
# http://www.staldal.nu/tech/2009/01/11/how-to-use-mousewheel-in-gnu-screen/comment-page-1/
#############################################################################
# Scroll up
bindkey -d "^[[5S" eval copy "stuff 5\025"
bindkey -m "^[[5S" stuff 5\025
# Scroll down
bindkey -d "^[[5T" eval copy "stuff 5\004"
bindkey -m "^[[5T" stuff 5\004
# Scroll up more
bindkey -d "^[[25S" eval copy "stuff \025"
bindkey -m "^[[25S" stuff \025
# Scroll down more
bindkey -d "^[[25T" eval copy "stuff \004"
bindkey -m "^[[25T" stuff \004
##
## Ensure New Windows Get Their Own Command History
##
#############################################################################
# http://stackoverflow.com/questions/14914570/bash-how-do-i-get-the-command-history-in-a-screen-session
#############################################################################
HISTPATHBASE='${HOME}/.bash_sessions/screen.window.'
bind c screen bash -ic 'HISTFILE=${HISTPATHBASE}${WINDOW} bash'
bind ^C screen bash -ic 'HISTFILE=${HISTPATHBASE}${WINDOW} bash'
# Load the machine version of this file
# echo "Loading: $MACHINECONFIGDIR/screenrc"
source "${MACHINECONFIGDIR}/screenrc"
### None of the below works...
# Load the machine version of this file
# source_machine_version screenrc