add readme

parent 29bfea1e
set-option -g default-shell /usr/local/bin/zsh
#set-option -g default-command "which reattach-to-user-namespace > /dev/null && reattach-to-user-namespace -l /usr/local/bin/zsh"
#set -g default-command "reattach-to-user-namespace -l /usr/local/bin/zsh"
#set-option -g default-command "which reattach-to-user-namespace > /dev/null && reattach-to-user-namespace -l $SHELL"
# setting default termtype to screen 256
ZSH=`which zsh`
set-option -g default-shell $ZSH
set-option -g default-command "which reattach-to-user-namespace > /dev/null && reattach-to-user-namespace -l $ZSH"
set -g default-terminal "screen-256color"
setw -g automatic-rename off
# Change prefix key to Ctrl+a
unbind C-b
set -g prefix C-a
......@@ -23,7 +21,7 @@ setw -g mode-mouse on
# key bindings for splitting
unbind %
#bind | split-window -h
# Horizontal
# Horizontal
bind v split-window -h -c "#{pane_current_path}"
unbind '"'
#bind - split-window -v
......@@ -66,20 +64,27 @@ set -g message-bg colour235
# set -g status-right '#(/usr/local/bin/battery -t)'
# set -g status-left '📅 #(gcalcli --nostarted --calendar "" agenda --nocolor | cut -d " " -f 4- | head -2 | tail -1 | sed "s/^ *//g" | sed "s/ / /g" | cut -c1-19)'
# set -g status-left '📅 #[fg=color187,bright]#(gcalcli --nostarted --calendar "" agenda --nocolor | cut -d " " -f 4- | head -2 | tail -1 | sed "s/^ *//g" | sed "s/ / /g" | cut -c1-50)'
#set -g status-left '📅 #[fg=color187,bright]#(gcalcli --nostarted --calendar "" agenda --nocolor | cut -d " " -f 4- | head -2 | tail -1 | sed "s/^ *//g" | sed "s/ / /g" | cut -c1-50)'
#(whoami)@#H
#set -g status-left '#(/usr/local/bin/battery -t -p)#[fg=colour187,bold]%H:%M | %d/%m/%Y 📅'
set -g status-left '#(/usr/local/bin/battery -t -p) #(whoami)@#H #[fg=colour187,bold] %d/%m/%Y %H:%M'
#set -g status-right "#(~/.tmuxDir/getProc.sh) "
# #[fg=colour187,bold] (%H:%M) %d-%b-%y'
# set -g status-right '#[fg=blue,bold]#H#[default] #[fg=blue,bold][CPU=#(getCpuUsage.sh) MEM=#(getMemUsage.sh)]#[default]'
# #[fg=colour187,bold]%d/%m/%Y
# set -g status-right '#[fg=colour187,bold] %d/%m/%Y | %H:%M #(rainbarf --remaining --rgb)'
set -g status-right "#[fg=colour190] #(~/.tmuxDir/getProc.sh)"
##(~/.tmuxDir/getCPU.sh)
#set-option -g status-right '#(/usr/local/bin/tmux-cpu #[fg=:color]:percent#[default]") %H:%M %d-%b-%y'
##(~/.tmuxDir/getCPU.sh)
# #(tmux-mem-cpu-load --interval 2 --colors)#[default]
# ⌛ #[fg=colour190,bold]%H:%M #[fg=colour187,bold] #(/usr/local/bin/battery -t)
# ⌛ #[fg=colour190,bold]%H:%M #[fg=colour187,bold] #(/usr/local/bin/battery -t)
set -g status-left '#(~/.tmuxDir/getProc.sh)'
set -g status-right "#(~/.tmuxDir/itunes_status.sh) #[fg=#57575e]│ #[fg=white]%d/%m/%Y %H:%M "
#------------------------------
set-option -g status-position top
set-option -g status-position top
set-option -g status on
set-option -g status-interval 5
setw -g c0-change-trigger 10
......@@ -92,7 +97,7 @@ set-option -g status-right-length 350
# Notifying if other windows has activities
set -g visual-activity on
setw -g monitor-activity on
setw -g window-status-activity-attr bold,blink,underscore
setw -g window-status-activity-attr bold #,blink,underscore
# window options
set -g mouse-select-pane on
......@@ -108,19 +113,14 @@ bind-key -n C-M-u resize-pane -U 1
bind-key -n C-M-d resize-pane -D 1
bind-key -n C-M-l resize-pane -L 1
bind-key -n C-M-r resize-pane -R 1
# bind-key -n M-right select-pane -t:.+
# bind-key -n M-left select-pane -t:.-
# bind-key -n M-down select-pane -t:.+
# bind-key -n M-up select-pane -t:.-
#bind-key -n M-space resize-pane -Z
# To copy:
# bind-key -n -t emacs-copy M-w copy-pipe "xclip -i -sel p -f | xclip -i -sel c "
bind-key -t emacs-copy y copy-pipe "reattach-to-user-namespace pbcopy"
unbind -t emacs-copy Enter
bind-key -t emacs-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
#bind-key -t emacs-copy y copy-pipe "reattach-to-user-namespace pbcopy"
#unbind -t emacs-copy Enter
#bind-key -t emacs-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# # To paste:
# bind-key -n C-y run "xclip -o | tmux load-buffer - ; tmux paste-buffer"
......@@ -179,7 +179,11 @@ bind-key -t emacs-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# bind-key -t emacs-copy C-Down scroll-down
set -g default-command "reattach-to-user-namespace -l /usr/local/bin/zsh"
set -g window-status-format '#I:#(pwd="#{pane_current_path}"; echo ${pwd####*/})#F'
set -g window-status-current-format '#I:#(pwd="#{pane_current_path}"; echo ${pwd####*/})#F'
set-option -g status-interval 1
\ No newline at end of file
#set -g window-status-format '#I:#F'
#set -g window-status-current-format '#I:#(pwd="#{pane_current_path}"; echo ${pwd####*/})#F'
setw -g window-status-format "#I:#W"
#setw -g window-status-current-format " #F#I:#W#F "
# don't rename windows automatically
set-option -g allow-rename off
set-option -g status-interval 5
#!/bin/bash
top -l 1 | head -n 4 | tail -n 1
#|awk '{printf "CPU%3d%% |", $3}'
#!/bin/bash
top -l 1 | head -n 3 | tail -1
#vm_stat | awk 'BEGIN{FS="[:]+"}{if(NR<7&&NR>1)sum+=$2; if(NR==2||NR==4||NR==5)free+=$2} END{printf "%3d%%\n",100*((sum - free)/sum)}'
#!/bin/bash
#ps -eo pcpu,ucomm,pmem | sort -k 1 -nr | head -1 | awk '{printf "%20.10s | cpu %3d% |", $2, $1}'
ps -eo pcpu,ucomm,rss,pmem,etime | sort -k 1 -nr | head -1 | awk \
'{
if ($1>90) color="#[bright fg=colour160]";
else if ($1>80) color="#[bright fg=colour220]";
else if ($1>70) color="#[bright fg=colour219]";
else if ($1>60) color="#[bright fg=colour218]";
else if ($1>50) color="#[bright fg=colour217]";
else if ($1>40) color="#[bright fg=colour216]";
else if ($1>30) color="#[bright fg=colour215]";
else if ($1>20) color="#[bright fg=colour214]";
else if ($1>10) color="#[bright fg=colour213]";
else color="#[nobright fg=:colour]"
if ($1>30)
printf "%1.9s %4dM %.1f %s%3d%\n", $2, $3/1024,$4, color, $1
}'
#ps -eo pcpu,ucomm,pmem | sort -k 1 -nr | head -1 | awk '{printf "%20.10s | cpu %3d% | mem %4.1f ", $2, $1, $3}'
#top -o cpu -l 2 -n 5 -stats command,cpu -U $(logname) | tail -n 6 | head -2 | tail -1 | awk '{print $1,$2"%"}'
# ,pmem
#!/usr/bin/env bash
ITUNES_TRACK=$(osascript <<EOF
if appIsRunning("iTunes") then
tell app "iTunes" to get the name of the current track
end if
on appIsRunning(appName)
tell app "System Events" to (name of processes) contains appName
end appIsRunning
EOF)
if [[ ! -z "$ITUNES_TRACK" ]]; then
ITUNES_ARTIST=$(osascript <<EOF
if appIsRunning("iTunes") then
tell app "iTunes" to get the artist of the current track
end if
on appIsRunning(appName)
tell app "System Events" to (name of processes) contains appName
end appIsRunning
EOF)
TRACK_LEN=${#ITUNES_TRACK}
if [[ "$TRACK_LEN" -gt 30 ]]; then
ITUNES_TRACK=`echo "$ITUNES_TRACK" | cut -c -30`
ITUNES_TRACK+=...
fi
ARTIST_LEN=${#ITUNES_ARTIST}
if [[ "$ARTIST_LEN" -gt 20 ]]; then
ITUNES_ARTIST=`echo "$ITUNES_ARTIST" | cut -c -20`
ITUNES_ARTIST+=...
fi
echo '#[fg=#99a4bc]♫#[fg=#b4b4b9]' "$ITUNES_TRACK" '#[fg=#787882]-#[fg=#b4b4b9]' "$ITUNES_ARTIST"
exit
else
echo "#[fg=#787882]No music playing"
fi
# Configuration of tmux
1. Clone project and copy files to HOME
```
mkdir tmp_tmux
git clone https://gitlab.version.fz-juelich.de/chraibi1/tmux.git tmp_tmux
cp -r tmp/tmux/* ~
rm -r tmp_tmux
tmux
```
# Keystrokes
- `Ctrl-a` r: refresh tmux after changing `.tmux.conf`
- `Ctrl-a` ,: change name of the window
- `Ctrl-a` v: split vertically
- `Ctrl-a` h: split horizontally
- `Ctrl-[`: enter text-mode to navigate the window (`q` to exit)
- `Ctrl-x`: close windows (answer question with y)
- `Ctrl-x`: close windows (answer question with y)
## Copy text
- `Ctrl-space`
- move with arrows to mark text
- `Alt-w`: copy
- `Ctrl-y`: paste
## Search
- Enter text mode with `Ctrl-[`
- `Ctrl-s`: start searching forwards
- `Ctrl-r`: start searching backwards
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment