1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | # █▓▒░ tmux
# by xero <http://xero.nu>
# http://git.io/.files
# change prefix to backtick
unbind C-b
set-option -g prefix `
bind ` send-prefix
# shell
set -g default-command /usr/bin/zsh
set -g default-shell /usr/bin/zsh
# start with window 1 (instead of 0)
set -g base-index 1
# start with pane 1
set -g pane-base-index 1
# screen mode
set -g default-terminal "screen-256color"
# source config file
bind r source-file ~/.tmux.conf
# history
set -g history-limit 4096
# allow terminal scrolling
set-option -g terminal-overrides 'xterm*:smcup@:rmcup@'
# vim style copy paste mode
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind-key -t vi-copy 'v' begin-selection
bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard'
# use vi mode
setw -g mode-keys vi
set -g status-keys vi
setw -g utf8 on
# pleb mode
#set -g mouse-utf8 on
#set -g mouse on
# splitting
unbind %
bind h split-window -h
unbind '"'
bind v split-window -v
# window switching
# urxvt tab like window switching (-n: no prior escape seq)
bind-key -n S-left prev
bind-key -n S-right next
bind-key -n C-left swap-window -t -1
bind-key -n C-right swap-window -t +1
# colon :
bind : command-prompt
# panes
set -g pane-border-fg colour0
set -g pane-active-border-fg colour0
#set -g pane-active-border-attr blink
# status line
set -g status-utf8 on
set -g status-justify left
set -g status-bg colour0
set -g status-fg colour66
set -g status-interval 2
# messaging
set -g message-fg colour0
set -g message-bg colour66
set -g message-command-fg colour66
set -g message-command-bg colour1
# window mode
setw -g mode-bg colour66
setw -g mode-fg colour0
# resizing
setw -g aggressive-resize on
# window status
set-option -g status-position bottom
setw -g window-status-format "#[bg=colour241,fg=colour0,noreverse]█▓░ #W "
setw -g window-status-current-format "#[bg=colour66,fg=colour0,noreverse]█▓░ #W "
# info on right
set -g status-right-length 100
set -g status-right '#(~/bin/status)'
# info on left (no session display)
set -g status-left ''
# loud or quiet?
set-option -g visual-activity on
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none
# tmux clock
set -g clock-mode-colour colour66
# some key-binding changes
bind x kill-pane
bind X next-layout
bind Z previous-layout
# toggle status bar visibility
bind t set status
|
x
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | #!/bin/sh
# █▓▒░ tmux status
# by xero <http://xero.nu>
# http://git.io/.files
FULL=▓
EMPTY=░
EOL=▒
SIZE=7
C0="#000000"
C1="#222222"
C2="#1C596E"
C3="#B3291C"
C4="#3A3A3A"
C5="#efefef"
C6="#878787"
C7="#8787af"
draw()
{
perc=$1
SIZE=$2
inc=$(( perc * SIZE / 100 ))
out=
thiscolor=
for v in `seq 0 $(( SIZE - 1 ))`; do
test "$v" -le "$inc" \
&& out="${out}#[fg=$C1]${FULL}" \
|| out="${out}#[fg=$C1]${EMPTY}"
done
echo $out
}
temp()
{
t=$(sensors | awk '/Core\ 0/ {gsub(/\+/,"",$3); gsub(/\..+/,"",$3) ; print $3}')
tc=$C0
case 1 in
$((t <= 50)))
tc=$C2
;;
$((t >= 75)))
tc=$C3
;;
esac
echo "#[fg=$tc]$t°c"
}
bat()
{
BATPATH=/sys/class/power_supply/BAT1
STATUS=$BATPATH/status
BAT_FULL=$BATPATH/charge_full
BAT_NOW=$BATPATH/charge_now
bf=$(cat $BAT_FULL)
bn=$(cat $BAT_NOW)
stat=$(cat $STATUS)
case $stat in
Full)
st="="
;;
Discharging)
st="-"
;;
Charging)
st="+"
;;
esac
echo $st$(( 100 * $bn / $bf ))"%"
}
cpu()
{
CPU_USE=$(grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage}')
printf "%.0f" $CPU_USE
}
ram()
{
free | awk '/Mem:/ {print int($3/$2 * 100.0)}'
}
clock()
{
mtime=$(date +'%H:%M')
myear=$(date +'%Y-%m-')
mday=$(date +'%d')
echo "#[fg=$C5]#[bg=$C4] $mtime #[fg=$C6]$myear#[fg=$C5]$mday #[fg=$C6]$EOL"
}
front()
{
echo "#[bg=$C7]#[fg=$C1]▓░"
}
CPU_INFO=`cpu`
RAM_INFO=`ram`
echo `front` `bat` `draw $RAM_INFO 4` `temp` `draw $CPU_INFO 7` `clock`
|
x
Notes
tmux theme with custom status bar featuring cpu and memory use gantt graphs.
make sure set -g status-right '(~/bin/status)'
points to the location of the status.sh script and is executable.
penguin said about 7 years ago
so what if the (~/bin/status) is the location of the status.sh script? Is that a bad idea - would it ve better to have it some other place?
I’m so fed up with all these poweline and arrows and then I found this - it’s pure genoius :)
Well done
(big fan of your work btw')