This commit is contained in:
2015-09-25 16:25:48 +02:00
parent ba7f2a2841
commit a989389495
7 changed files with 206 additions and 64 deletions

View File

@@ -1,5 +1,5 @@
[user] [user]
name = Hannes Körber name = Hannes Koerber
email = hannes.koerber@gmail.com email = hannes.koerber@gmail.com
[alias] [alias]
untrack = "rm --cached" untrack = "rm --cached"
@@ -21,6 +21,8 @@
logl = log --graph --decorate --pretty=oneline --abbrev-commit --all logl = log --graph --decorate --pretty=oneline --abbrev-commit --all
pushall = "!sh -c 'for r in $(git remote) ; do echo \"[$r] \" ; git push $r $1; done' -"
[core] [core]
editor = vim editor = vim
pager = less pager = less

View File

@@ -19,7 +19,7 @@
set $mod Mod4 set $mod Mod4
# The default terminal # The default terminal
set $terminal ~/bin/start-urxvtc.sh set $terminal urxvt
#-e bash -c "tmux -q has-session && exec tmux attach-session -d || exec tmux new-session -n$USER -s$USER@$HOSTNAME" #-e bash -c "tmux -q has-session && exec tmux attach-session -d || exec tmux new-session -n$USER -s$USER@$HOSTNAME"
# Path to the exit script # Path to the exit script
@@ -200,16 +200,16 @@
# Pressing right will grow the windows width. # Pressing right will grow the windows width.
# Pressing up will shrink the windows height. # Pressing up will shrink the windows height.
# Pressing down will grow the windows height. # Pressing down will grow the windows height.
bindsym $left resize shrink width 10 px or 10 ppt bindsym $left resize shrink width 5 px or 5 ppt
bindsym $down resize grow height 10 px or 10 ppt bindsym $down resize grow height 5 px or 5 ppt
bindsym $up resize shrink height 10 px or 10 ppt bindsym $up resize shrink height 5 px or 5 ppt
bindsym $right resize grow width 10 px or 10 ppt bindsym $right resize grow width 5 px or 5 ppt
# same bindings, but for the arrow keys # same bindings, but for the arrow keys
bindsym 113 resize shrink width 10 px or 10 ppt bindsym 113 resize shrink width 5 px or 5 ppt
bindsym 116 resize grow height 10 px or 10 ppt bindsym 116 resize grow height 5 px or 5 ppt
bindsym 111 resize shrink height 10 px or 10 ppt bindsym 111 resize shrink height 5 px or 5 ppt
bindsym 114 resize grow width 10 px or 10 ppt bindsym 114 resize grow width 5 px or 5 ppt
# back to normal: Enter or Escape # back to normal: Enter or Escape
bindsym Return mode "default" bindsym Return mode "default"
@@ -245,14 +245,14 @@
# Do show borders at the screen edges # Do show borders at the screen edges
hide_edge_borders none hide_edge_borders none
focus_follows_mouse no focus_follows_mouse yes
# Only map a popup in fullscreen mode if it belongs to the fullscreen window # Only map a popup in fullscreen mode if it belongs to the fullscreen window
# <smart|ignore|leave_fullscreen> # <smart|ignore|leave_fullscreen>
popup_during_fullscreen leave_fullscreen popup_during_fullscreen leave_fullscreen
# Do not always wrap but change to a container on the same level instead # Do not always wrap but change to a container on the same level instead
force_focus_wrapping yes force_focus_wrapping no
force_xinerama no force_xinerama no
@@ -309,6 +309,7 @@ client.urgent #2f343a #900000 #ffffff #900000
for_window [class="^Thunderbird$"] border none for_window [class="^Thunderbird$"] border none
for_window [instance="^shutdown-menu$"] border normal for_window [instance="^shutdown-menu$"] border normal
for_window [class="^VirtualBox$" ] border normal for_window [class="^VirtualBox$" ] border normal
for_window [class="^Virt-manager$" ] border normal
#assign [class="^Thunderbird"] $workspace9 #assign [class="^Thunderbird"] $workspace9
assign [class="^Firefox$" ] $workspace1 assign [class="^Firefox$" ] $workspace1
@@ -320,6 +321,58 @@ client.urgent #2f343a #900000 #ffffff #900000
assign [class="^Zim$" ] $workspace8 assign [class="^Zim$" ] $workspace8
assign [class="^Thunderbird$" ] $workspace9 assign [class="^Thunderbird$" ] $workspace9
assign [class="^Skype$"] $workspace10 assign [class="^Skype$"] $workspace10
assign [class="^Mumble"] $workspace10
assign [class="^Deluge$"] $workspace5
# bind some keys
bindsym XF86Sleep exec --no-startup-id $path_i3exit suspend
bindsym XF86AudioMute exec --no-startup-id amixer set Master toggle
bindsym XF86AudioRaiseVolume exec --no-startup-id bash $HOME/.i3/scripts/pa-volume.bash set-vol +5 ; exec --no-startup-id "bash $HOME/.i3/scripts/update-status.bash"
bindsym XF86AudioLowerVolume exec --no-startup-id bash $HOME/.i3/scripts/pa-volume.bash set-vol -5 ; exec --no-startup-id "bash $HOME/.i3/scripts/update-status.bash"
# keys seemingly switched
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -dec 5 ; exec --no-startup-id "bash $HOME/.i3/scripts/update-status.bash"
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -inc 5 ; exec --no-startup-id "bash $HOME/.i3/scripts/update-status.bash"
bindsym XF86AudioPlay exec --no-startup-id mpc toggle
bindsym XF86AudioPrev exec --no-startup-id mpc prev
bindsym XF86AudioNext exec --no-startup-id mpc next
# font for window titles. ISO 10646 = Unicode
font pango:DejaVu Sans Mono 11
bindsym $mod+o exec --no-startup-id "bash -c '~/dev/projects/xautorandr/xautorandr ; kill -SIGUSR2 $(cat $HOME/.var/run/wallchanger.pid)'"
bindsym $mod+p exec --no-startup-id "bash -c 'kill -SIGUSR1 $(cat $HOME/.var/run/wallchanger.pid)'"
# start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
# always show at the top of the screen
mode dock
position top
tray_output primary
# show workspace buttons
workspace_buttons yes
id bar-0
font pango:DejaVu Sans, Icons 11
colors {
background #000000
statusline #ffffff
separator #e16b40
focused_workspace #e16b40 #000000 #ffffff
active_workspace #000000 #5f676a #ffffff
inactive_workspace #000000 #000000 #dddddd
urgent_workspace #D00000 #D00000 #000000
}
i3bar_command i3bar
status_command bash ~/.i3/scripts/i3bar_wrapper.bash ~/.i3/conky/statusbar.conkyrc
}

View File

@@ -1,8 +1,6 @@
new-session -A -s 's-1'
set -g default-terminal 'screen-256color' set -g default-terminal 'screen-256color'
set -g utf8 on set-option -g utf8 on
set -g status-utf8 on set -g status-utf8 on
set -g default-command "${SHELL}" set -g default-command "${SHELL}"
@@ -68,7 +66,8 @@ set-window-option -g automatic-rename-format '#{pane_current_command}'
set-window-option -g window-status-separator ' ' set-window-option -g window-status-separator ' '
set -g status-right '' ##[fg=colour226]#(uptime | cut -d ',' -f 2-)' #set -g status-right '' ##[fg=colour226]#(uptime | cut -d ',' -f 2-)'
set -g status-right ''
set -g message-fg white set -g message-fg white
set -g message-bg black set -g message-bg black
@@ -78,14 +77,16 @@ set -g pane-border-fg white
set -g pane-active-border-fg red set -g pane-active-border-fg red
#set -g status-style 'bg=black,fg=white,none' #set -g status-style 'bg=black,fg=white,none'
set -g status-left ' #[bg=#E5F200,fg=#000000] #{session_name} #[bg=default] #[bg=#90FF00,fg=#000000] #{host} #[bg=default] ' if-shell 'test -z "$SSH_CONNECTION"' 'set -g status-left " #[bg=#E5F200,fg=#000000] #{session_name} #[bg=default] #[bg=#90FF00,fg=#000000] #{host} #[bg=default] "' 'set -g status-left " #[bg=#00A0FF,fg=#000000] !remote! #[bg=default] #[bg=#E5F200,fg=#000000] #{session_name} #[bg=default] #[bg=#90FF00,fg=#000000] #{host} #[bg=default] " ; set -g status-right " #[bg=#00A0FF,fg=#000000] !remote! #[bg=default] "'
set -g status-left-length 100 set -g status-left-length 100
# vertical = | in this case # vertical = | in this case
unbind % unbind %
unbind '"' unbind '"'
bind-key s split-window -v bind-key s split-window -v -c "#{pane_current_path}"
bind-key v split-window -h bind-key v split-window -h -c "#{pane_current_path}"
bind-key c new-window -c "#{pane_current_path}"
bind-key -n S-down new-window bind-key -n S-down new-window
bind-key -n S-left prev bind-key -n S-left prev

View File

@@ -1,3 +1,5 @@
" vim: set filetype=vim
" 01 important " 01 important
" 02 moving around, searching and patterns " 02 moving around, searching and patterns
" 03 tags " 03 tags
@@ -68,6 +70,12 @@ Plugin 'tpope/vim-fugitive'
" python specific stuff " python specific stuff
Plugin 'klen/python-mode' Plugin 'klen/python-mode'
Plugin 'nblock/vim-dokuwiki'
Plugin 'saltstack/salt-vim'
Plugin 'lepture/vim-jinja'
" incremental visual mode " incremental visual mode
"Plugin 'terryma/vim-expand-region' "Plugin 'terryma/vim-expand-region'
" "
@@ -87,6 +95,8 @@ Plugin 'kien/ctrlp.vim'
" "
"Plugin 'flazz/vim-colorschemes' "Plugin 'flazz/vim-colorschemes'
Plugin 'reedes/vim-pencil'
call vundle#end() call vundle#end()
filetype plugin indent on filetype plugin indent on
@@ -98,7 +108,7 @@ let g:pymode_trim_whitespaces = 1
let g:pymode_lint_on_write = 0 let g:pymode_lint_on_write = 0
let g:pymode_lint_unmodified = 0 let g:pymode_lint_unmodified = 0
let g:pymode_lint_on_fly = 0 let g:pymode_lint_on_fly = 0
let g:pymoe_rope = 0 let g:pymode_rope = 0
let g:pymode_rope_completion = 0 let g:pymode_rope_completion = 0
"let g:pymode_rope_completion_on_dot = 1 "let g:pymode_rope_completion_on_dot = 1
let g:pymode_rope_goto_definition_cmd = "new" let g:pymode_rope_goto_definition_cmd = "new"
@@ -119,6 +129,8 @@ colorscheme monokai
let g:airline_theme='powerlineish' let g:airline_theme='powerlineish'
let g:airline_left_sep='' let g:airline_left_sep=''
let g:airline_right_sep='' let g:airline_right_sep=''
let g:airline_section_x = '%{PencilMode()}'
let g:pencil#mode_indicators = {'hard': 'H', 'auto': 'A', 'soft': 'S', 'off': '',}
"let g:airline_section_z='' "let g:airline_section_z=''
" enable tabline at the top showing all buffers " enable tabline at the top showing all buffers
@@ -140,7 +152,7 @@ set esckeys " enable cursor keys in insert mode
set ttimeoutlen=50 set ttimeoutlen=50
set modeline " respect modelines in files set modeline " respect modelines in files
set modelines=4 set modelines=5
set laststatus=2 " always show a status line set laststatus=2 " always show a status line

View File

@@ -1,9 +1,10 @@
#!/bin/bash #!/bin/bash
export LOGDIR="$HOME/.var/log/" export LOGDIR="$HOME/.var/log"
export RUNDIR="$HOME/.var/run" export RUNDIR="$HOME/.var/run"
[[ ! -d "LOGDIR" ]] && mkdir -p "$LOGDIR" [[ ! -d "LOGDIR" ]] && mkdir -p "$LOGDIR"
[[ ! -d "RUNDIR" ]] && mkdir -p "$RUNDIR"
LOGFILE="$LOGDIR/xinitrc.log" LOGFILE="$LOGDIR/xinitrc.log"
@@ -26,20 +27,8 @@ fi
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8
start_wm() { start_wm() {
log "generating i3 config" log "starting i3"
I3_LOG="$LOGDIR/i3/i3.log" exec i3 -c "$HOME/.i3/config" >> "$LOGDIR/i3/i3.log"
I3_LOGOLD="${I3_LOG}.old"
# simple logrotate so we can still get info about the last session
if [[ -f "$I3_LOG" ]] ; then
log "moving old i3 log at $I3_LOG to $I3_LOGOLD"
mv -f "$I3_LOG" "$I3_LOGOLD"
fi
[[ ! -d "$(dirname $I3_LOG)" ]] && mkdir -p "$(dirname $I3_LOG)"
SESSION_CONF=$(bash "$HOME/.i3/scripts/genconfig.bash")
log "generated, starting i3"
exec i3 -c "$SESSION_CONF" >> "$LOGDIR/i3/i3.log"
} }
@@ -47,10 +36,10 @@ start_wm() {
keyboard_layout=de keyboard_layout=de
keyboard_variant=nodeadkeys keyboard_variant=nodeadkeys
keyboard_repeat_delay=150 keyboard_repeat_delay=150
keyboard_repeat_speed=30 keyboard_repeat_speed=50
# path and options for the wallpaper changer script # path and options for the wallpaper changer script
path_wallchanger="$HOME/development/projects/wallchanger/wallchanger" path_wallchanger="$HOME/dev/projects/wallchanger/wallchanger"
wallchanger_pidfile="$RUNDIR/wallchanger.pid" wallchanger_pidfile="$RUNDIR/wallchanger.pid"
wallpaper_directory="$HOME/pictures/wallpaper/misc" wallpaper_directory="$HOME/pictures/wallpaper/misc"
wallpaper_logfile="$LOGDIR/wallpaper.log" wallpaper_logfile="$LOGDIR/wallpaper.log"
@@ -80,11 +69,11 @@ pasystray & &>> $LOGFILE
log "starting dropboxd" log "starting dropboxd"
nice -n 10 ionice -c 3 dropboxd & &>> $LOGFILE nice -n 10 ionice -c 3 dropboxd & &>> $LOGFILE
log "starting conky clock on desktop" #log "starting conky clock on desktop"
{ #{
sleep 1 # sleep 1
conky -c "$HOME/.conky/clock.conkyrc" # conky -c "$HOME/.conky/clock.conkyrc"
} & &>> $LOGFILE #} & &>> $LOGFILE
# start the wallpaper changer # start the wallpaper changer
log "starting $path_wallchanger" log "starting $path_wallchanger"
@@ -115,10 +104,16 @@ xcompmgr & &>> $LOGFILE
log "starting network tray application" log "starting network tray application"
nm-applet & &>> $LOGFILE nm-applet & &>> $LOGFILE
log "starting seafile"
seafile-applet & &>> $LOGFILE
# disable auto screen disable # disable auto screen disable
xset -dpms & &>> $LOGFILE xset -dpms & &>> $LOGFILE
xset s off & &>> $LOGFILE xset s off & &>> $LOGFILE
xrandr --output eDP1 --primary
# execute the host-specific .xinitrc-addition # execute the host-specific .xinitrc-addition
hostfile="$HOME/.xinitrc.d/$(hostname --short).xinitrc" hostfile="$HOME/.xinitrc.d/$(hostname --short).xinitrc"
log "looking for host specific xinitrc addition at $hostfile" log "looking for host specific xinitrc addition at $hostfile"
@@ -136,4 +131,9 @@ else
log "~/.Xresources not found" log "~/.Xresources not found"
fi fi
synclient VertEdgeScroll=0
synclient VertTwoFingerScroll=1
synclient MaxSpeed=2.2
synclient AccelFactor=0.08
start_wm start_wm

View File

@@ -1,10 +1,28 @@
# exec startx breaks some logind fuckery, without exec it works # exec startx breaks some logind fuckery, without exec it works
#tmux start-server & #tmux start-server &
eval $(ssh-agent -s) _path=("$HOME/bin"
"/usr/local/sbin"
"/usr/local/bin"
"/usr/sbin"
"/usr/bin"
"/sbin"
"/bin"
"/usr/games")
PATH=""
for part in ${_path} ; do
PATH="$PATH:${part}"
done
PATH="${PATH#:}"
export PATH
export EDITOR="vim" export EDITOR="vim"
export VISUAL="vim" export VISUAL="vim"
export PATH="$HOME/bin:$PATH"
export BROWSER="firefox" export BROWSER="firefox"
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx if [[ -z "$SSH_CONNECTION" ]] ; then
eval $(ssh-agent -s)
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx
fi

View File

@@ -140,7 +140,14 @@ alias wow="git status"
alias v="vim" alias v="vim"
alias g="git" alias g="git"
alias t="tmux"
alias c="cd"
alias l="ls"
alias calc='python3 -ic "from math import *; import cmath"'
# show non-printable characters by default
alias cat="cat -v"
# rebase the current branch onto WTF ARE YOU DOING YOU ARE DRUNNK TO GO BED # rebase the current branch onto WTF ARE YOU DOING YOU ARE DRUNNK TO GO BED
##alias rebase="git rebase -i $(git branch --contains HEAD | grep -v '\*.*' | head -1)" ##alias rebase="git rebase -i $(git branch --contains HEAD | grep -v '\*.*' | head -1)"
@@ -148,6 +155,10 @@ alias g="git"
### FUNCTIONS ### FUNCTIONS
_remote() {
[[ -n "$SSH_CONNECTION" ]]
}
slideshow() { slideshow() {
delay=$1 delay=$1
[[ -z "$delay" ]] && { echo "wrong usage" ; return 1 ; } [[ -z "$delay" ]] && { echo "wrong usage" ; return 1 ; }
@@ -217,8 +228,10 @@ ruler() {
done done
} }
if ! (ssh-add -l | grep -q 'id_rsa') ; then if ! _remote ; then
ssh-add if ! (ssh-add -l | grep -q 'id_rsa') ; then
ssh-add
fi
fi fi
addext() { addext() {
@@ -261,7 +274,7 @@ serve() {
} }
manpdf() { manpdf() {
[[ -z "$1" ]] && { echo >&2 "$(man)" ; exit 1 ; } [[ -z "$1" ]] && { printf '%s' >&2 "$(man)" ; return ; }
man -t "$1" | ps2pdf - - | zathura - man -t "$1" | ps2pdf - - | zathura -
} }
@@ -306,21 +319,16 @@ zstyle ':vcs_info:git*' formats "%{${fg[cyan]}%}[%{${fg[green]}%}%s%{${fg[cyan]}
setprompt() { setprompt() {
setopt prompt_subst setopt prompt_subst
if [[ -n "$SSH_CLIENT" ]]; then topstr="%{$fg[green]%}%n@%m%{$fg[white]%} ─ %{%B$fg[yellow]%}%~${vcs_info_msg_0_}%{%b%} %{$fg[white]%}"
SSHINFO="[ssh] " botstr="%B${PINFO}%#%b "
else
SSHINFO="" if _remote ; then
topstr="%{$fg[red]%}[remote]%{$fg[white]%} ${topstr}"
fi fi
# if git status ; then PROMPT="%{$fg[white]%}┌─ ${topstr}
# GITINFO=" <git repo>" └─ ${botstr}"
# else RPROMPT="%{$fg[cyan]%}%*%{$fg[white]%} ─ [%?]"
# GITINFO=""
# fi
PROMPT="%{$fg[white]%}┌─ %{$fg[green]%}%n@%M%{$fg[white]%} ─ %{$fg[cyan]%}%*%{$fg[white]%} ─ %{%B$fg[yellow]%}%~${vcs_info_msg_0_}%{%b%}
%{$fg[white]%}└─ %B${PINFO}%#%b "
RPROMPT=""
} }
setprompt setprompt
@@ -328,3 +336,51 @@ setprompt
gensshport() { gensshport() {
echo $(( $(od -v -An -N4 -tu4 < /dev/urandom) % (2**16-2**10) + 2**10 )) echo $(( $(od -v -An -N4 -tu4 < /dev/urandom) % (2**16-2**10) + 2**10 ))
} }
#ssh() {
# if [[ -n "$TMUX" ]] ; then
# echo "$0 $@" > "$HOME/.var/run/tmux.$(tmux display-message -p '#S').cmd"
# tmux detach-client >/dev/null 2>&1
# else
# command ssh "$@"
# fi
#}
tmux_after() {
cmdfile="$HOME/.var/run/tmux.$1.cmd"
if [[ -e "$cmdfile" ]] ; then
command $(<"$cmdfile")
rm "$cmdfile"
if tmux has-session -t "$1" ; then
tmux_wrap attach-session -t "$1"
fi
fi
exit
}
tmux_wrap() {
tmux "$1" "$2" "$3"
tmux_after "$3"
}
# desired behavior is like this:
# if a shell is started, it automatically attaches to the lowest "s-x" session that has
# no attached clients
return
[[ -n "$TMUX" ]] && return
for (( id=1 ;; id++ )) ; do
sessionname="s-${id}"
if tmux has-session -t "${sessionname}" ; then
if [[ -z "$(tmux list-clients -t "${sessionname}")" ]] ; then
tmux_wrap attach-session -t "${sessionname}"
else
continue
fi
else
tmux_wrap new-session -s "${sessionname}"
fi
done