Separate <machine-name>.screenrc for each machine. Common settings moved to common.screenrc.

This commit is contained in:
Alexey Skobkin 2017-11-22 03:27:43 +03:00
parent bc90321e35
commit a70b3ea0a2
4 changed files with 50 additions and 41 deletions

View file

@ -1,22 +1,10 @@
# GNU Screen configuration # GNU Screen configuration
```bash ## Install
cd ~/.dotfiles/screen
```
1. Create symbolic link for main config file: Create symbolic link for main config file:
```bash ```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' # Suppose your current machine is 'desktop'
cd backticks ln -s ~/.dotfiles/screen/desktop.screenrc ~/.screenrc
ln -s hwtemp-desktop.sh 1.sh
ln -s loadavg.sh 2.sh
ln -s memory.sh 3.sh
``` ```

View file

@ -1,38 +1,24 @@
screen -t bash4 altscreen on
screen -t sudo1 sudo -i term screen-256color
screen -t sudo2 sudo -i
#screen -t bash7
#screen -t bash8
#screen -t bash9
# Selecting first window
select 0
# Huge scrollback # Huge scrollback
defscrollback 16000 defscrollback 16000
altscreen on # Binding window switching to "<" and ">" keys
term screen-256color
bind ',' prev bind ',' prev
bind '.' next 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 # use hjkl keys to resize regions
#bind -c rsz h eval "resize -h -5" "command -c rsz" #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 j eval "resize -v -5" "command -c rsz"
#bind -c rsz k 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" #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}]'

17
screen/desktop.screenrc Normal file
View file

@ -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}]'

View file

@ -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}]'