hackbyte

.screenrc_reallyfat_mainscreen

Jul 25th, 2017
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.99 KB | None | 0 0
  1. # $Id: hackysscreenrc,v 0.5 2018/07/29 03:15:53 ??? Exp $
  2. # sources and such
  3. # https://unix.stackexchange.com/questions/74785/how-to-open-tabs-windows-in-gnu-screen-execute-commands-within-each-one
  4. ################################################################################
  5. # SCREEN SETTINGS
  6. ################################################################################
  7. startup_message off
  8. nethack on
  9. #defflow on # will force screen to process ^S/^Q
  10. deflogin on
  11. autodetach on # preserve my precious screen! ;)
  12. # turn visual bell on
  13. vbell on
  14. vbell_msg "GNOP"
  15. # define a bigger scrollback, default is 100 lines
  16. defscrollback 1500
  17. ################################################################################
  18. activity "%{= wk} Window %n"
  19. ################################################################################
  20. #backtick id lifespan autorefresh command [args] # was this or so: backtick 0 30 30 sh -c 'screen -ls | grep --color=no -o "$PPID[^[:space:]]*"'
  21. # show number of users on the machine (or your own shells in modern times. ;))
  22. backtick 0 10 10 sh -c 'who | wc -l'
  23. #
  24. # bashiges zeugs PROMPT_COMMAND='printf "\033k\033\134"'
  25. #
  26. # when we open a window, where shall its CWD be?
  27. chdir # without argument it's my $HOME
  28. ################################################################################
  29. # SCREEN KEYBINDINGS
  30. ################################################################################
  31. # Remove some stupid / dangerous key bindings
  32. #bind L
  33. bind ^\
  34. # Make them better
  35. bind \\ quit
  36. bind I login on
  37. bind O login off
  38. bind } history
  39. bind + resize +1
  40. bind - resize -1
  41. bind = resize =
  42. bind _ resize max
  43. # unbind kill, rebind to upper case K
  44. bind k
  45. bind ^k
  46. bind K kill
  47. # unbind clear
  48. bind C
  49. # unbind XOFF
  50. bind s
  51. bind ^s
  52. # unbind lock
  53. bind x
  54. bind ^x
  55. ###bind s screen -t '% |root:' sudo su -l
  56. # Useful zeugs eventuel
  57. ##bind ^h screen -t htop sudo su -l -c "htop -d 1"
  58. # An example of a "screen scraper" which will launch urlview on the current
  59. # screen window
  60. #
  61. #bind ^B eval "hardcopy_append off" "hardcopy -h $HOME/.screen-urlview" "screen urlview $HOME/.screen-urlview"
  62. #
  63. # ... now a little bit of key bindings
  64. # In case we don't have write permission for /etc/utmp (no s-bit)
  65. # we create even local windows via rlogin. -> Et voila: a utmp-slot
  66. # utmp-slots are strongly recomended to keep sccs and talk happy.
  67. # (thus we have ^A# or. ^Ac for windowcreation with or without utmp-slot.)
  68. # but if we run suid-root, we produce all the rlogins with -ln,
  69. # as nobody shall refer to these pty's.
  70. #bind '!' screen -ln -k faui41 rlogin faui41
  71. #bind '@' screen -ln -k vme2 rlogin faui4_vme2
  72. #bind '#' screen -k faui43
  73. #bind '#' screen -ln -k faui43 rlogin faui43
  74. #bind '$' screen -ln -k faui44 rlogin faui44
  75. #bind '%' screen -ln -k faui45 rlogin faui45
  76. #bind '\^' screen -ln -k sup1 rlogin fausup1
  77. #bind '&' screen -ln -k sup2 rlogin fausup2
  78. #bind '*' screen -ln -k faui48 rlogin faui48
  79. #bind '(' screen -ln -k faui09 rlogin faui09
  80. #bind ')' screen -ln -k faui10 rlogin faui10
  81. #bind 'J' screen -ln -k 4j rlogin faui4j
  82. #bind 'P' screen -ln -k 4p rlogin faui4p
  83. #bind '^C' screen -ln -k 45c rlogin faui45c
  84. #bind '^D' screen -ln -k 45d rlogin faui45d
  85. #bind '^E' screen -ln -k 45e rlogin faui45e
  86. #bind '^I' screen -ln -k 45i rlogin faui45i
  87. #
  88. # these two are logIn and logOut. As a toggle is too stupid.
  89. #bind 'I' set login on
  90. #bind 'O' set login off
  91. bind 'L'
  92. # What happens, when you 'think emacs' and want to erase a whole
  93. # line? You type ^A^K right? Under screen it should be ^Aa^K. But...
  94. # killing the window would be a real punishment for a little mistyping.
  95. bind k #wow! I even amange to type ^Ak by accident.
  96. #bind ^k
  97. #bind K kill
  98. ################################################################################
  99. # TERMINAL SETTINGS
  100. ################################################################################
  101. # The vt100 description does not mention "dl". *sigh*
  102. termcapinfo vt100 dl=5\E[M
  103. # Set the hardstatus prop on gui terms to set the titlebar/icon title
  104. termcapinfo xterm*|rxvt*|kterm*|Eterm* hs:ts=\E]0;:fs=\007:ds=\E]0;\007
  105.  
  106. ################################################################################
  107. # HARDSTATUS AND FOO
  108. ################################################################################
  109.  
  110. # use this for the hard status string
  111. #hardstatus string "%h%? users: %u%?"
  112.  
  113. # An alternative hardstatus to display a bar at the bottom listing the
  114. # windownames and highlighting the current windowname in blue. (This is only
  115. # enabled if there is no hardstatus setting for your terminal)
  116. #
  117. #hardstatus lastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%< %{+b}%=%Y%M%d-%c"
  118. ##hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
  119. #
  120.  
  121. # old default i think.
  122. #hardstatus alwayslastline "%{Wb}%H%{-}%70>%-Lw%{Yb}%n%f*!!%t%{-}%+Lw%< %=|%{+b}%2D|%Y%m%d-%c"
  123.  
  124. caption always
  125. caption string "%{Yb}%?%F%{+B Rb}%?%2n %f %t%? %h%?%?%F%{-}%?%=%?%u%?%?%F%{Rb}%?%l"
  126.  
  127. # out hardstatus will _always_ get displayed in the last line of the terminal screen recognizes..
  128. hardstatus alwayslastline
  129.  
  130. # old fancy variant, no longer used and changes at 20180729T0240+20:00 (CEST)
  131. #hardstatus string "%{+b dC}%H%{-} %{-b dd}%S%{-} %{+b dy}Usr:%`%{-} %{+b dR}|%{-} %?%{dc}%-Lw%{-}%?%50>%{+b kR}>>%2n%f%{-} %{+b kY}%t%{-} %{+b dR}<<%{-}%?%{kc}%+Lw%{=b dd}%<%?%=%{=b dR}|%{-} %{kC}%Y-%m-%d %c:%s"
  132.  
  133. # And here we set our hardstatus
  134. hardstatus string "%{+b dC}%H%{-} %{-b dd}%S%{-} %{+b dy}Usr:%`%{-} %{+b dR}|%{-} %?%{dc}%-Lw%{-}%?%50>%{+b kR}>>%2n%f%{-} %{+b kY}%t%{-} %{+b dR}<<%{-}%?%{kc}%+Lw%{=b dd}%<%?%=%{=b dR}|%{-} %{kC}%Y-%m-%d %c:%s"
  135.  
  136. #hardstatus string 'translation', part by part
  137. #
  138. #%{+b dC} # add specified set of attributes (b=bold, d=default background, C = bright cyan)
  139. #%H% # print %H (hostname if you might wonder)
  140. #{-} # - remove the set from the current attributes (i like to clean up behind myself.. ;)
  141. #%{-b dd} # remove specified attributes (d=default background, d=default foreground) ## yah, i know i'm crazy .. sort of.. ;)
  142. #%S%{-} # print $S (yeah, our session name.. oh, and clean up!)
  143. #%{+b dy}Usr:%`%{-} # add attributes; b=bold, d=default background, y=yellow foreground, print the number of users from a `backticks` command above - and don't forget to clean up! ;)
  144. #%{+b dR}|%{-} # boring stuff, we paint just in bold red on default background a | char. ;)
  145. #%? # NOW, we're talking and getting really fancy.
  146. # # the part to the next %? is displayed only if a % escape inside the part expands to a non-empty string
  147. # %{dc} # default bacckground, cyan foreground
  148. # %-L #
  149. # %{-} # aaand, reset. ;)O
  150. # %?%50> #
  151. # %{+b kR}>> # set bold, black foreground red and print just '>>' ;)
  152. # %2n
  153. # %f # flags of the window
  154. # %{-}
  155. #%{+b kY}%t%{-}
  156. #%{+b dR}<<%{-}%?%{kc}%+Lw%{=b dd}%<%?%=%{=b dR}|%{-}
  157. #%{kC}%Y-%m-%d %c:%s ## The easiest one, kC sets a color and "%Y-%m-%d %c:%s" is just a timestamp (based on ISO8609)
  158.  
  159. ##hardstatus string "%{= KW} %H [%`] %{= Kw}|%{-} %-Lw%{= bW}%n%f %t%{-}%+Lw %{}%=%Y%m%d-%c"
  160. #
  161. # http://www.gnu.org/software/screen/manual/html_node/String-Escapes.html
  162. #
  163. # %= : expand to fill all space (used here to make remaining content flush right)
  164. # %{= wK} : set colors to bright white (W) on bright black (K) and keep current text styles (=)
  165. # %{= wW} : set colors to white (w) on bright black (K) and keep current text styles (=)
  166. # %{-} : restore colors to previous colors / undo last color change
  167. # %{= bW} : set colors to bright white (W) on blue (b) and keep current text styles (=)
  168.  
  169.  
  170. # %` : print output of 'backtick' command (defined elsewhere in .screenrc)
  171. # %H : hostname
  172. # %f : window flags
  173. # %t : window title
  174. # %-Lw : list windows before current window (L [optional] = "include flags")
  175. # %+Lw : list windows after current window (L [optional] = "include flags")
  176. # %l : current load of the system
  177. # %n : window number
  178. # %a : session name
  179. # %t : window title
  180. # %u : all other users on this window
  181. # %w : all window numbers and names. With - qualifier: up to the current window; with + qualifier: starting with the window after the current one.
  182. # %W : all window numbers and names except the current one
  183.  
  184.  
  185. # %C : current time (12-hr; 24-hr is %c)
  186. # %a : am/pm (lowercase; uppercase is %A)
  187. # %s : seconds
  188. # %Y : current year
  189. # %m : current month (0-padded; %M for "Jan" etc.)
  190. # %d : current date (0-padded)
  191.  
  192.  
  193. # [ : opening bracket character
  194. # ] : closing bracket character
  195. # | : bar character
  196. # - : hyphen character
  197.  
  198. # '%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<'
  199. #The available windows centered at the current win dow and truncated to the available width. The current window is displayed white on blue.
  200. #This can be used with 'hardstatus alwayslastline'
  201.  
  202. ## --> sets %? to true if the window has the focus
  203. #
  204.  
  205. # '%?%F%{.R.}%?%3n %t%? [%h]%?'
  206. #The window number and title and the window's hardstatus, if one is set. Also use a red background if this is the active focus.
  207. #Useful for 'caption string'.
  208.  
  209. ################################################################################
  210. ########## TERMCAP FOO
  211. ################################################################################
  212.  
  213.  
  214. # all termcap entries are now duplicated as terminfo entries.
  215. # only difference should be the slightly modified syntax, and check for
  216. # terminfo entries, that are already corected in the database.
  217. #
  218. # G0 we have a SEMI-GRAPHICS-CHARACTER-MODE
  219. # WS this sequence resizes our window.
  220. # cs this sequence changes the scrollregion
  221. # hs@ we have no hardware statusline. screen will only believe that
  222. # there is a hardware status line if hs,ts,fs,ds are all set.
  223. # ts to statusline
  224. # fs from statusline
  225. # ds delete statusline
  226. # al add one line
  227. # AL add multiple lines
  228. # dl delete one line
  229. # DL delete multiple lines
  230. # ic insert one char (space)
  231. # IC insert multiple chars
  232. # nx terminal uses xon/xoff
  233.  
  234.  
  235. # set these terminals up to be 'optimal' instead of vt100
  236. termcapinfo xterm*|linux*|rxvt*|Eterm* OP
  237.  
  238. # Change the xterm initialization string from is2=\E[!p\E[?3;4l\E[4l\E>
  239. # (This fixes the "Aborted because of window size change" konsole symptoms found
  240. # in bug #134198)
  241. termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'
  242.  
  243. # To get screen to add lines to xterm's scrollback buffer, uncomment the
  244. # following termcapinfo line which tells xterm to use the normal screen buffer
  245. # (which has scrollback), not the alternate screen buffer.
  246. #
  247. termcapinfo xterm|xterms|xs|rxvt ti@:te@
  248.  
  249. # Make the output buffer large for (fast) xterms.
  250. termcapinfo xterm* OL=10000
  251. #termcapinfo xterm* OL=100
  252.  
  253. # tell screen that xterm can switch to dark background and has function
  254. # keys.
  255. termcapinfo xterm 'VR=\E[?5h:VN=\E[?5l'
  256. termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~'
  257. termcapinfo xterm 'kh=\EOH:kI=\E[2~:kD=\E[3~:kH=\EOF:kP=\E[5~:kN=\E[6~'
  258.  
  259. # special xterm hardstatus: use the window title.
  260. termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
  261.  
  262. #terminfo xterm 'vb=\E[?5h$<200/>\E[?5l'
  263. termcapinfo xterm 'vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l'
  264.  
  265. # emulate part of the 'K' charset
  266. termcapinfo xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334,{\344,|\366,}\374,~\337'
  267.  
  268. # Extend the vt100 desciption by some sequences.
  269. termcap vt100* ms:AL=\E[%dL:DL=\E[%dM:UP=\E[%dA:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC
  270. terminfo vt100* ms:AL=\E[%p1%dL:DL=\E[%p1%dM:UP=\E[%p1%dA:DO=\E[%p1%dB:LE=\E[%p1%dD:RI=\E[%p1%dC
  271. termcapinfo linux C8
  272. # old rxvt versions also need this
  273. # termcapinfo rxvt C8
  274.  
  275. # Enable non-blocking mode to better cope with flaky ssh connections.
  276. #defnonblock 5
  277. defnonblock on
  278. nonblock on
  279.  
  280. defutf8 on
  281. utf8 on
  282.  
  283.  
  284. # emulate .logout message
  285. pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended."
  286.  
  287. # advertise hardstatus support to $TERMCAP
  288. termcapinfo * '' 'hs:ts=\E_:fs=\E\\:ds=\E_\E\\'
  289.  
  290. # make the shell in every window a login shell
  291. shell -$SHELL
  292.  
  293. # don't kill window after the process died
  294. #zombie "^["
  295.  
  296. # enable support for the "alternate screen" capability in all windows
  297. altscreen on
  298.  
  299.  
  300.  
  301.  
  302. # DEFAULT KEY BINDINGS
  303. # As mentioned, each screen command consists of a "C-a" followed by one other character. For your convenience, all commands that are bound to lower-case letters are also bound to their control charac\u2010
  304. # ter counterparts (with the exception of "C-a a"; see below), thus, "C-a c" as well as "C-a C-c" can be used to create a window. See section "CUSTOMIZATION" for a description of the command.
  305. #
  306. # The following table shows the default key bindings:
  307. #
  308. # C-a ' (select) Prompt for a window name or number to switch to.
  309. #
  310. # C-a " (windowlist -b)
  311. # Present a list of all windows for selection.
  312. #
  313. # C-a 0 (select 0)
  314. # \u2026 \u2026
  315. # C-a 9 (select 9)
  316. # C-a - (select -) Switch to window number 0 - 9, or to the blank window.
  317. #
  318. # C-a tab (focus) Switch the input focus to the next region. See also split, remove, only.
  319. #
  320. # C-a C-a (other) Toggle to the window displayed previously. Note that this binding defaults to the command character typed twice, unless overridden. For instance, if you use the option
  321. # "-e]x", this command becomes "]]".
  322. #
  323. # C-a a (meta) Send the command character (C-a) to window. See escape command.
  324. #
  325. # C-a A (title) Allow the user to enter a name for the current window.
  326. #
  327. # C-a b
  328. # C-a C-b (break) Send a break to window.
  329. #
  330. # C-a B (pow_break) Reopen the terminal line and send a break.
  331. #
  332. # C-a c
  333. # C-a C-c (screen) Create a new window with a shell and switch to that window.
  334. #
  335. # C-a C (clear) Clear the screen.
  336. #
  337. # C-a d
  338. # C-a C-d (detach) Detach screen from this terminal.
  339. #
  340. # C-a D D (pow_detach) Detach and logout.
  341. #
  342. # C-a f
  343. # C-a C-f (flow) Toggle flow on, off or auto.
  344. #
  345. # C-a F (fit) Resize the window to the current region size.
  346. #
  347. # C-a C-g (vbell) Toggles screen's visual bell mode.
  348. #
  349. # C-a h (hardcopy) Write a hardcopy of the current window to the file "hardcopy.n".
  350. #
  351. # C-a H (log) Begins/ends logging of the current window to the file "screenlog.n".
  352. #
  353. # C-a i
  354. # C-a C-i (info) Show info about this window.
  355. #
  356. # C-a k
  357. # C-a C-k (kill) Destroy current window.
  358. #
  359. # C-a l
  360. # C-a C-l (redisplay) Fully refresh current window.
  361. #
  362. # C-a L (login) Toggle this windows login slot. Available only if screen is configured to update the utmp database.
  363. #
  364. # C-a m
  365. # C-a C-m (lastmsg) Repeat the last message displayed in the message line.
  366. #
  367. # C-a M (monitor) Toggles monitoring of the current window.
  368. #
  369. # C-a space
  370. # C-a n
  371. # C-a C-n (next) Switch to the next window.
  372. #
  373. # C-a N (number) Show the number (and title) of the current window.
  374. #
  375. # C-a backspace
  376. # C-a C-h
  377. # C-a p
  378. # C-a C-p (prev) Switch to the previous window (opposite of C-a n).
  379. #
  380. # C-a q
  381. # C-a C-q (xon) Send a control-q to the current window.
  382. #
  383. # C-a Q (only) Delete all regions but the current one. See also split, remove, focus.
  384. #
  385. # C-a r
  386. # C-a C-r (wrap) Toggle the current window's line-wrap setting (turn the current window's automatic margins on and off).
  387. # C-a s
  388. # C-a C-s (xoff) Send a control-s to the current window.
  389. #
  390. # C-a S (split) Split the current region horizontally into two new ones. See also only, remove, focus.
  391. #
  392. # C-a t
  393. # C-a C-t (time) Show system information.
  394. #
  395. # C-a v (version) Display the version and compilation date.
  396. #
  397. # C-a C-v (digraph) Enter digraph.
  398. #
  399. # C-a w
  400. # C-a C-w (windows) Show a list of window.
  401. #
  402. # C-a W (width) Toggle 80/132 columns.
  403. #
  404. # C-a x
  405. # C-a C-x (lockscreen) Lock this terminal.
  406. #
  407. # C-a X (remove) Kill the current region. See also split, only, focus.
  408. #
  409. # C-a z
  410. # C-a C-z (suspend) Suspend screen. Your system must support BSD-style job-control.
  411. #
  412. # C-a Z (reset) Reset the virtual terminal to its "power-on" values.
  413. #
  414. # C-a . (dumptermcap) Write out a ".termcap" file.
  415. #
  416. # C-a ? (help) Show key bindings.
  417. #
  418. # C-a \ (quit) Kill all windows and terminate screen.
  419. #
  420. # C-a : (colon) Enter command line mode.
  421. #
  422. # C-a [
  423. # C-a C-[
  424. # C-a esc (copy) Enter copy/scrollback mode.
  425. #
  426. # C-a C-]
  427. # C-a ] (paste .) Write the contents of the paste buffer to the stdin queue of the current window.
  428. #
  429. # C-a {
  430. # C-a } (history) Copy and paste a previous (command) line.
  431. #
  432. # C-a > (writebuf) Write paste buffer to a file.
  433. #
  434. # C-a < (readbuf) Reads the screen-exchange file into the paste buffer.
  435. #
  436. # C-a = (removebuf) Removes the file used by C-a < and C-a >.
  437. #
  438. # C-a , (license) Shows where screen comes from, where it went to and why you can use it.
  439. #
  440. # C-a _ (silence) Start/stop monitoring the current window for inactivity.
  441. #
  442. # C-a | (split -v) Split the current region vertically into two new ones.
  443. #
  444. # C-a * (displays) Show a listing of all currently attached displays.
  445. #
  446. #
  447. #
Add Comment
Please, Sign In to add comment