mirror of
https://bitbucket.org/skobkin/dotfiles.git
synced 2024-12-21 23:22:06 +00:00
.screenrc with per-machine customizable backtick scripts. hwtemp-desktop.sh backtick for ASRock X399 Taichi CPUTIN, loadavg.sh backtick for fixed load average backtick and memory.sh for new memory usage backtick.
This commit is contained in:
parent
5583f05550
commit
8a507afb11
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/.idea/
|
1
screen/.gitignore
vendored
Normal file
1
screen/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/backticks/?.sh
|
|
@ -9,7 +9,7 @@ screen -t sudo2 sudo -i
|
|||
select 0
|
||||
|
||||
# Huge scrollback
|
||||
defscrollback 4000
|
||||
defscrollback 16000
|
||||
|
||||
altscreen on
|
||||
term screen-256color
|
||||
|
@ -19,15 +19,16 @@ bind '.' next
|
|||
hardstatus alwayslastline
|
||||
|
||||
# Backtick commands to output in the hardstatus
|
||||
backtick 1 5 5 sh -c 'sensors | fgrep -i "core " | tr "\n" " " | sed -e "s/Core\ [0-9]\:[ ]\++//g;s/ ([^)]*)//g;s/ $//"'
|
||||
backtick 2 10 10 sh -c 'uptime | awk "{print \$8 \$9 \$10}" | sed -e "s/,/ /g"'
|
||||
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'
|
||||
|
||||
# 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}][ %2` ][ %1` ][%{B} %d-%m-%Y %{W}%c %{g}]'
|
||||
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}]'
|
||||
|
||||
# use hjkl keys to resize regions
|
||||
#bind -c rsz h eval "resize -h -5" "command -c rsz"
|
||||
|
|
22
screen/README.md
Normal file
22
screen/README.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
# GNU Screen configuration
|
||||
|
||||
```bash
|
||||
cd ~/.dotfiles/screen
|
||||
```
|
||||
|
||||
1. 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
|
||||
```
|
5
screen/backticks/hwtemp-desktop.sh
Executable file
5
screen/backticks/hwtemp-desktop.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
# Core i7-4820k
|
||||
#sensors | fgrep -i "core " | tr "\n" " " | sed -e "s/Core\ [0-9]\:[ ]\++//g;s/ ([^)]*)//g;s/ $//"
|
||||
# Threadripper 1950X (via motherboard sensors, not die)
|
||||
sensors | fgrep 'CPUTIN' | awk '{print $2}'
|
2
screen/backticks/loadavg.sh
Executable file
2
screen/backticks/loadavg.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
cat /proc/loadavg | awk '{print $1, $2, $3}'
|
2
screen/backticks/memory.sh
Executable file
2
screen/backticks/memory.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
free -h | fgrep -i 'mem:' | awk '{print $3, "/", $2}'
|
Loading…
Reference in a new issue