From a70b3ea0a2e178d5817a5159c85b8186b525edc1 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Wed, 22 Nov 2017 03:27:43 +0300 Subject: [PATCH] Separate .screenrc for each machine. Common settings moved to common.screenrc. --- screen/README.md | 18 +++---------- screen/{.screenrc => common.screenrc} | 38 +++++++++------------------ screen/desktop.screenrc | 17 ++++++++++++ screen/laptop-xiaomi-air-13.screenrc | 18 +++++++++++++ 4 files changed, 50 insertions(+), 41 deletions(-) rename screen/{.screenrc => common.screenrc} (51%) create mode 100644 screen/desktop.screenrc create mode 100644 screen/laptop-xiaomi-air-13.screenrc diff --git a/screen/README.md b/screen/README.md index 5d410b5..3050f74 100644 --- a/screen/README.md +++ b/screen/README.md @@ -1,22 +1,10 @@ # GNU Screen configuration -```bash -cd ~/.dotfiles/screen -``` +## Install -1. Create symbolic link for main config file: +Create symbolic link for main config file: ```bash -ln -s .screenrc ~/.screenrc -``` - -2. Create symbolic links for [backtick](https://www.gnu.org/software/screen/manual/html_node/Backtick.html) scripts for each machine. - -```bash -# Choose desired backtick scripts for each (1-3) slot and create symbolic links # Suppose your current machine is 'desktop' -cd backticks -ln -s hwtemp-desktop.sh 1.sh -ln -s loadavg.sh 2.sh -ln -s memory.sh 3.sh +ln -s ~/.dotfiles/screen/desktop.screenrc ~/.screenrc ``` diff --git a/screen/.screenrc b/screen/common.screenrc similarity index 51% rename from screen/.screenrc rename to screen/common.screenrc index 1516a2a..55115c4 100644 --- a/screen/.screenrc +++ b/screen/common.screenrc @@ -1,38 +1,24 @@ -screen -t bash4 -screen -t sudo1 sudo -i -screen -t sudo2 sudo -i -#screen -t bash7 -#screen -t bash8 -#screen -t bash9 - -# Selecting first window -select 0 +altscreen on +term screen-256color # Huge scrollback defscrollback 16000 -altscreen on -term screen-256color +# Binding window switching to "<" and ">" keys bind ',' prev bind '.' next -hardstatus alwayslastline - -# Backtick commands to output in the hardstatus -backtick 1 5 5 sh -c '~/.dotfiles/screen/backticks/1.sh' -backtick 2 10 10 sh -c '~/.dotfiles/screen/backticks/2.sh' -backtick 3 10 10 sh -c '~/.dotfiles/screen/backticks/3.sh' -backtick 4 10 10 sh -c '~/.dotfiles/screen/backticks/4.sh' - -# http://www.gnu.org/software/screen/manual/html_node/String-Escapes.html -# -# %H : hostname -# %= : expand to fill all space (used here to make remaining content flush right) -# %` : print output of 'backtick' command (defined elsewhere in .screenrc) -hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][ %1` ][ %2` ][ %3` ][ %4` ][%{B} %d-%m-%Y %{W}%c %{g}]' - # 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" + +hardstatus alwayslastline + +# http://www.gnu.org/software/screen/manual/html_node/String-Escapes.html +# +# %H : hostname +# %= : expand to fill all space (used here to make remaining content flush right) +# %` : print output of 'backtick' command (defined elsewhere in .screenrc) +#hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][ %1` ][ %2` ][ %3` ][ %4` ][%{B} %d-%m-%Y %{W}%c %{g}]' \ No newline at end of file diff --git a/screen/desktop.screenrc b/screen/desktop.screenrc new file mode 100644 index 0000000..15e5eac --- /dev/null +++ b/screen/desktop.screenrc @@ -0,0 +1,17 @@ +# Including common settings +source ~/.dotfiles/screen/common.screenrc + +# Creating default windows +screen -t bash4 +screen -t sudo1 sudo -i +screen -t sudo2 sudo -i + +# Selecting first window +select 0 + +# Backtick commands to output in the hardstatus +backtick 1 5 5 sh -c '~/.dotfiles/screen/backticks/hwtemp-desktop.sh' +backtick 2 10 10 sh -c '~/.dotfiles/screen/backticks/loadavg.sh' +backtick 3 10 10 sh -c '~/.dotfiles/screen/backticks/memory.sh' + +hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][ %1` ][ %2` ][ %3` ][%{B} %d-%m-%Y %{W}%c %{g}]' \ No newline at end of file diff --git a/screen/laptop-xiaomi-air-13.screenrc b/screen/laptop-xiaomi-air-13.screenrc new file mode 100644 index 0000000..387e343 --- /dev/null +++ b/screen/laptop-xiaomi-air-13.screenrc @@ -0,0 +1,18 @@ +# Including common settings +source ~/.dotfiles/screen/common.screenrc + +# Creating default windows +screen -t bash4 +screen -t sudo1 sudo -i +screen -t sudo2 sudo -i + +# Selecting first window +select 0 + +# Backtick commands to output in the hardstatus +backtick 1 5 5 sh -c '~/.dotfiles/screen/backticks/hwtemp-laptop-xiaomi.sh' +backtick 2 10 10 sh -c '~/.dotfiles/screen/backticks/loadavg.sh' +backtick 3 10 10 sh -c '~/.dotfiles/screen/backticks/memory.sh' +backtick 4 10 10 sh -c '~/.dotfiles/screen/backticks/battery-laptop-xiaomi.sh' + +hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][ %1` ][ %2` ][ %3` ][ %4` ][%{B} %d-%m-%Y %{W}%c %{g}]' \ No newline at end of file