.bashrc: Watch
This commit is contained in:
17
.bashrc.kuba
17
.bashrc.kuba
@@ -106,6 +106,23 @@ Calls $cmd [...]"
|
||||
$cmd $@
|
||||
}
|
||||
|
||||
watch_modify() {
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "Usage watch_modify FILE CMD ARGS...
|
||||
|
||||
Run CMD ARGS... when file FILE is updated
|
||||
"
|
||||
return
|
||||
fi
|
||||
|
||||
file="$1"
|
||||
base="$(basename "$file")"
|
||||
dir="$(dirname "$file")"
|
||||
inotifywait -r -m -e modify "$dir" | while read file_path file_event file_name; do
|
||||
[ "$base" == "$file_name" ] && echo ${@:2} && ${@:2}
|
||||
done
|
||||
}
|
||||
|
||||
# Source git prompt
|
||||
source_existing ~/scripts/git-prompt.sh
|
||||
source_existing ~/.bash_prompt.kuba
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# Prefix
|
||||
unbind C-b
|
||||
set-option -g prefix C-a
|
||||
bind-key C-a send-prefix
|
||||
set -g mouse on
|
||||
|
||||
# Mouse and colors
|
||||
set -g mouse on
|
||||
set -g default-terminal "screen-256color"
|
||||
|
||||
# pane movement
|
||||
|
||||
Reference in New Issue
Block a user