-
-
Save blue-hexagon/cfe74e7c0938ae4faed06e106a481cf8 to your computer and use it in GitHub Desktop.
A killer GNU Screen Config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###################################################### | |
# To make screen available at login, append (no quotations ofc) 'screen -R' in ~/.profile | |
# | |
# RESOURCES | |
# Prerequisite: https://xaizek.github.io/2015-11-08/switching-from-tmux-to-gnu-screen/ | |
# --Contains all the necessary terminology for understanding screen. | |
# Hardstatus options: https://debian-administration.org/article/560/An_introduction_to_the_visual_features_of_GNU_Screen | |
# String escapes: https://www.gnu.org/software/screen/manual/html_node/String-Escapes.html#String-Escapes | |
# Great nesting example: https://andrewbrookins.com/tech/even-better-gnu-screen/ | |
# Nesting example: https://superuser.com/questions/132168/how-do-i-create-a-hierarchy-of-terminals-or-workspaces | |
# Dotfile examples: http://www.softpanorama.org/Utilities/Screen/screenrc_examples.shtml | |
# The Arch Wiki on GNU Screen: https://wiki.archlinux.org/index.php/GNU_Screen | |
# --Autostart with systemd | |
# Another Wiki entry on GNU Screen: http://www.noah.org/wiki/Screen_notes | |
# Official manual: https://www.gnu.org/software/screen/manual/screen.html | |
# Man pages: http://man7.org/linux/man-pages/man1/screen.1.html | |
# | |
#################################################### | |
# $Id: screenrc,v 1.15 2003/10/08 11:39:03 zal Exp $ | |
startup_message off | |
deflogin on | |
vbell on | |
vbell_msg "--Attention-- " | |
defscrollback 3000 #increase number for bigger scrollback | |
# navigating regions with Ctrl-arrows | |
bindkey "^[[1;5D" focus left | |
bindkey "^[[1;5C" focus right | |
bindkey "^[[1;5A" focus up | |
bindkey "^[[1;5B" focus down | |
# switch layouts with F3 (prev) and F4 (next) | |
bindkey "^[OR" layout prev | |
bindkey "^[OS" layout next | |
# switch windows with Ctrl+F3 (prev layout) and Ctrl+F4 (next) | |
bindkey "^[O1;5R" prev | |
bindkey "^[O1;5S" next | |
# F2 puts Screen into resize mode. Resize regions using hjkl keys. | |
bindkey "^[OQ" eval "command -c rsz" # enter resize mode | |
# use hjkl keys to resize regions | |
bind -c rsz h eval "resize -h -5" "command -c rsz" | |
bind -c rsz j eval "resize -v -5" "command -c rsz" | |
bind -c rsz k eval "resize -v +5" "command -c rsz" | |
bind -c rsz l eval "resize -h +5" "command -c rsz" | |
# quickly switch between regions using tab and arrows | |
bind -c rsz \t eval "focus" "command -c rsz" # Tab | |
bind -c rsz -k kl eval "focus left" "command -c rsz" # Left | |
bind -c rsz -k kr eval "focus right" "command -c rsz" # Right | |
bind -c rsz -k ku eval "focus up" "command -c rsz" # Up | |
bind -c rsz -k kd eval "focus down" "command -c rsz" # Down | |
# misc | |
bind K kill | |
escape ' | |
# TERMINAL SETTINGS | |
termcapinfo xterm*|linux*|rxvt*|Eterm* OP | |
termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l' | |
termcapinfo xterm|xterms|xs|rxvt ti@:te@ | |
termcapinfo xterm*|rxvt*|kterm*|Eterm* hs:ts=\E]0;:fs=\007:ds=\E]0;\007 | |
termcapinfo vt100 dl=5\E[M | |
hardstatus on | |
hardstatus alwayslastline '%{= G}[ %{G}%H %{g}][%= %{= w}%?%-Lw%?%{= R}%n*%f %t%?%{= R}(%u)%?%{= w}%+Lw%?%= %{= g}][ %{y}Load: %l %{g}][%{B}%Y-%m-%d %{W}%c:%s %{g}]' | |
rendition so = 3 | |
caption string "%{= dd}" | |
#non block; keep ssh alive if ssh-connection is "flaky" | |
defnonblock 5 | |
nonblock on | |
# STARTUP SCREENS | |
screen -t Shell 1 bash #default windows | |
screen -t Weechat 2 ttyload | |
screen -t Sysmon 3 top | |
screen -t Netmon 4 bmon | |
screen -t CoinMarketCap 5 watch -n900 -x -c -t ./coinbash.sh --top 50 -w | |
screen -t RSS 6 nrss | |
#bind c screen 1 # window numbering starts at 1 not 0 | |
bind 0 select 10 | |
layout autosave on | |
layout new Weechat | |
select 2 | |
layout new Cryptocurrencies | |
select 5 | |
layout new RSS | |
select 6 | |
layout new Monitor | |
select 3 | |
split -v | |
resize -v +7 | |
focus right | |
select 2 | |
layout attach Weechat | |
layout select Weechat | |
#Set a screensaver or the like | |
blankerprg "/usr/bin/cmatrix -b -f -C blue -d 100" | |
idle 30 blanker | |
#experimental | |
windowlist string "%4n %h%=%f" | |
# Finally! Shift-pg up or down to view scrollback buffer | |
# | |
bindkey "^[[5;2~" eval "copy" "stuff ^u" | |
bindkey -m "^[[5;2~" stuff ^u | |
bindkey -m "^[[6;2~" stuff ^d | |
termcapinfo xterm* ti@:te@ #usage of scrollback-bar on termnial #experimental | |
shell "/bin/bash" | |
attrcolor b ".I" | |
defbce on | |
# easier scroll by PgUp and PgDown | |
#bindkey "^[[5~" eval 'copy' 'stuff ^b' # PgUp | Enter copy/scrollback mode and page up | |
#bindkey "^[[6~" eval 'copy' 'stuff ^f' # PgDown | Enter copy/scrollback mode and page down | |
#test out later | |
#altscreen on | |
#alt status bar | |
#hardstatus alwayslastline "%{b kw}%H %{r}%1` %{w}| %{g}%c %{w}| %{y}%d.%m.%Y %{w}| %{g}%l %{w}| %{-b kw}%u %-Lw%{= rW}%50> %n%f %t %{-}%+Lw%<" | |
#hardstatus alwayslastline "%{b kw}%H %{r}%1` %{w}| %l |%{-b kw}%u %-Lw%{= rW}%50> %n%f %t %{-}%+Lw%<%=%C%a| %M-%d-%Y" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not finished yet