From 17758000afee5cc959ddb7e65ed813a53a9d2448 Mon Sep 17 00:00:00 2001 From: Jannik ZANDER Date: Wed, 8 Aug 2018 17:42:35 +0200 Subject: [PATCH] Revert "Git config cleanup" This reverts commit 46a28777d555ccba3600300f27ae83cb717823ab. --- .bash_aliases | 176 ++++++------- .bash_completion | 22 +- .bashrc | 126 ++++----- .config/git/attributes | 36 +-- .config/git/ignore | 128 ++++----- .config/i3/config | 502 +++++++++++++++++------------------ .config/mimeapps.list | 496 +++++++++++++++++------------------ .config/ranger/rc.conf | 46 ++-- .config/ranger/scope.sh | 222 ++++++++-------- .config/user-dirs.dirs | 32 +-- .cshrc | 24 +- .gitignore | 2 +- .gitmodules | 0 .inputrc | 128 ++++----- .mutt/keybindings | 106 ++++---- .mutt/muttrc | 124 ++++----- .mutt/signature | 10 +- .profile | 78 +++--- .ssh/config | 32 +-- .tmux.conf | 204 +++++++-------- README.md | 26 +- bin/build-akmod.sh | 10 +- bin/build-luajit.sh | 6 +- bin/build-vim.sh | 36 +-- bin/caps-hjkl-or-esc.ahk | 62 ++--- bin/edit_with_vim.bat | 18 +- bin/git-diffall.sh | 552 +++++++++++++++++++-------------------- bin/githome-clone.sh | 34 +-- 28 files changed, 1619 insertions(+), 1619 deletions(-) delete mode 100644 .gitmodules diff --git a/.bash_aliases b/.bash_aliases index 7f12687..22a583c 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -1,88 +1,88 @@ -# enable color support of ls and also add handy aliases -lsflags="-hF" - -if [ -x "$(which dircolors 2>/dev/null)" ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - lsflags="$lsflags -I NTUSER.\* -I ntuser.\*" - colorflag="--color=auto" - alias grep='grep --color=auto' - alias egrep='egrep --color=auto' - alias fgrep='fgrep --color=auto' -else # OSX version of ls - export CLICOLOR=1 - colorflag="-G" -fi - -alias ls="ls $colorflag $lsflags" -alias ll='ls -l' -alias la='ls -A' -alias l='ls -CF' -alias l1='ls -1' -alias l.='ls -d .[a-z]*' - -alias less='less -m -N -g -i -J --underline-special --SILENT -X' -alias more='less' - -# Secure settings -alias rm='rm -i' -alias cp='cp -i' -alias mv='mv -i' -alias ln='ln -i' -alias md='mkdir -p' -alias rd='rmdir' -alias :q=exit - -# reboot / halt / poweroff -alias reboot='sudo /sbin/reboot' -alias poweroff='sudo /sbin/poweroff' -alias halt='sudo /sbin/halt' -alias shutdown='sudo /sbin/shutdown' -alias apt-get='sudo apt-get' -alias update='sudo apt-get update && sudo apt-get upgrade' - -# My shortcuts -alias c='clear' -alias h='history' -alias 'h?'="history | grep -i" -alias e='ranger-cd' -alias o='rifle' -alias vi='vim' -alias top='atop' -alias open='xdg-open &>/dev/null' -alias info='info --vi-keys' -alias ag='ag --path-to-ignore=$HOME/.ignore --skip-vcs-ignores' -alias rg='rg --path-separator="//"' -alias githome='git --git-dir=$HOME/.githome --work-tree=$HOME' -alias dit='githome' -alias sudo='sudo ' -alias vlc='vlc *.avi' -alias wget='wget -c' - -# Reboot my home Linksys WAG160N / WAG54 / WAG320 / WAG120N Router / Gateway from *nix. -alias rebootlinksys="curl -u 'admin:my-super-password' 'http://192.168.1.100/setup.cgi?todo=reboot'" - -if [ ! -x "$(which tree 2>/dev/null)" ] -then - alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" -fi - -# Get week number -alias week='date +%V' - -# Make directory named todays date -alias mkdate='mkdir "$(date +'%Y%m%d')"' - -# Stopwatch -alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' - -# Automatically change the directory in bash after closing ranger -function ranger-cd -{ - tempfile="$(mktemp -t tmp.XXXXXX)" - ranger --choosedir="$tempfile" "${@:-$(pwd)}" - test -f "$tempfile" && - if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then - cd -- "$(cat "$tempfile")" - fi - rm -f -- "$tempfile" -} +# enable color support of ls and also add handy aliases +lsflags="-hF" + +if [ -x "$(which dircolors 2>/dev/null)" ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + lsflags="$lsflags -I NTUSER.\* -I ntuser.\*" + colorflag="--color=auto" + alias grep='grep --color=auto' + alias egrep='egrep --color=auto' + alias fgrep='fgrep --color=auto' +else # OSX version of ls + export CLICOLOR=1 + colorflag="-G" +fi + +alias ls="ls $colorflag $lsflags" +alias ll='ls -l' +alias la='ls -A' +alias l='ls -CF' +alias l1='ls -1' +alias l.='ls -d .[a-z]*' + +alias less='less -m -N -g -i -J --underline-special --SILENT -X' +alias more='less' + +# Secure settings +alias rm='rm -i' +alias cp='cp -i' +alias mv='mv -i' +alias ln='ln -i' +alias md='mkdir -p' +alias rd='rmdir' +alias :q=exit + +# reboot / halt / poweroff +alias reboot='sudo /sbin/reboot' +alias poweroff='sudo /sbin/poweroff' +alias halt='sudo /sbin/halt' +alias shutdown='sudo /sbin/shutdown' +alias apt-get='sudo apt-get' +alias update='sudo apt-get update && sudo apt-get upgrade' + +# My shortcuts +alias c='clear' +alias h='history' +alias 'h?'="history | grep -i" +alias e='ranger-cd' +alias o='rifle' +alias vi='vim' +alias top='atop' +alias open='xdg-open &>/dev/null' +alias info='info --vi-keys' +alias ag='ag --path-to-ignore=$HOME/.ignore --skip-vcs-ignores' +alias rg='rg --path-separator="//"' +alias githome='git --git-dir=$HOME/.githome --work-tree=$HOME' +alias dit='githome' +alias sudo='sudo ' +alias vlc='vlc *.avi' +alias wget='wget -c' + +# Reboot my home Linksys WAG160N / WAG54 / WAG320 / WAG120N Router / Gateway from *nix. +alias rebootlinksys="curl -u 'admin:my-super-password' 'http://192.168.1.100/setup.cgi?todo=reboot'" + +if [ ! -x "$(which tree 2>/dev/null)" ] +then + alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" +fi + +# Get week number +alias week='date +%V' + +# Make directory named todays date +alias mkdate='mkdir "$(date +'%Y%m%d')"' + +# Stopwatch +alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' + +# Automatically change the directory in bash after closing ranger +function ranger-cd +{ + tempfile="$(mktemp -t tmp.XXXXXX)" + ranger --choosedir="$tempfile" "${@:-$(pwd)}" + test -f "$tempfile" && + if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then + cd -- "$(cat "$tempfile")" + fi + rm -f -- "$tempfile" +} diff --git a/.bash_completion b/.bash_completion index fa49fb4..3db4680 100644 --- a/.bash_completion +++ b/.bash_completion @@ -1,11 +1,11 @@ -# Add tab completion for `githome` by marking it as an alias for `git` -_completion_loader git 2> /dev/null -if type _git &>/dev/null; then - complete -o "default" -o "nospace" -F _git githome; - complete -o "default" -o "nospace" -F _git dit; -fi; - -# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards -if [ -e ~/.ssh/config ]; then - complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2 | tr ' ' '\n')" scp sftp ssh; -fi; +# Add tab completion for `githome` by marking it as an alias for `git` +_completion_loader git 2> /dev/null +if type _git &>/dev/null; then + complete -o "default" -o "nospace" -F _git githome; + complete -o "default" -o "nospace" -F _git dit; +fi; + +# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards +if [ -e ~/.ssh/config ]; then + complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2 | tr ' ' '\n')" scp sftp ssh; +fi; diff --git a/.bashrc b/.bashrc index 4f58663..5f0fe02 100644 --- a/.bashrc +++ b/.bashrc @@ -1,63 +1,63 @@ -# .bashrc is for configuring the interactive Bash usage, like Bash aliases, setting favorite editor, setting Bash prompt, etc. - -# If not running interactively, don't do anything -[[ -z "$PS1" ]] && return - -cd ~ - -# options -#set -x # debug -set -o vi -shopt -s autocd -shopt -s cdspell -shopt -s checkwinsize -shopt -s cmdhist -shopt -s dotglob -shopt -s globstar -shopt -s histappend -shopt -s histreedit -shopt -s histverify -shopt -s no_empty_cmd_completion -shopt -s nocaseglob - -# prompt -PS1='\[\033]0;${USERNAME}@${HOSTNAME}:${PWD}\007\]' # terminal title - -if [[ -z "$MSYS2_PS1" ]]; then - PS1="$PS1"'${debian_chroot:+($debian_chroot)}' # debian -fi - -PS1="$PS1"'\[\033[01;32m\]' # change color -PS1="$PS1"'\u@\h' # user@host -PS1="$PS1"'\[\033[00m\]' # change color -PS1="$PS1"':' # : -PS1="$PS1"'\[\033[01;34m\]' # change color -PS1="$PS1"'\w' # current working directory -PS1="$PS1"'\[\033[31m\]' # change color -PS1="$PS1"'$(__git_ps1 "(%s)")' # bash function (no spaces) -PS1="$PS1"'\[\033[00m\]' # change color -PS1="$PS1"'\$ ' # prompt - -GIT_PS1_SHOWDIRTYSTATE=1 -GIT_PS1_SHOWUNTRACKEDFILES=1 -GIT_PS1_SHOWSTASHSTATE=1 -GIT_PS1_SHOWUPSTREAM='auto' -GIT_PS1_HIDE_IF_PWD_IGNORED=1 - -PROMPT_COMMAND="history -a; $PROMPT_COMMAND" - -# history -HISTCONTROL=ignoreboth:erasedups -HISTTIMEFORMAT="[%F %T] " -HISTFILESIZE= -HISTSIZE= -HISTFILE=~/.bash_history.local - -# completion, aliases, and local settings -[ -f ~/.bash_aliases ] && . ~/.bash_aliases; -[ -f ~/.bash_completion ] && . ~/.bash_completion; -[ -f ~/.bashrc.local ] && . ~/.bashrc.local - -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion +# .bashrc is for configuring the interactive Bash usage, like Bash aliases, setting favorite editor, setting Bash prompt, etc. + +# If not running interactively, don't do anything +[[ -z "$PS1" ]] && return + +cd ~ + +# options +#set -x # debug +set -o vi +shopt -s autocd +shopt -s cdspell +shopt -s checkwinsize +shopt -s cmdhist +shopt -s dotglob +shopt -s globstar +shopt -s histappend +shopt -s histreedit +shopt -s histverify +shopt -s no_empty_cmd_completion +shopt -s nocaseglob + +# prompt +PS1='\[\033]0;${USERNAME}@${HOSTNAME}:${PWD}\007\]' # terminal title + +if [[ -z "$MSYS2_PS1" ]]; then + PS1="$PS1"'${debian_chroot:+($debian_chroot)}' # debian +fi + +PS1="$PS1"'\[\033[01;32m\]' # change color +PS1="$PS1"'\u@\h' # user@host +PS1="$PS1"'\[\033[00m\]' # change color +PS1="$PS1"':' # : +PS1="$PS1"'\[\033[01;34m\]' # change color +PS1="$PS1"'\w' # current working directory +PS1="$PS1"'\[\033[31m\]' # change color +PS1="$PS1"'$(__git_ps1 "(%s)")' # bash function (no spaces) +PS1="$PS1"'\[\033[00m\]' # change color +PS1="$PS1"'\$ ' # prompt + +GIT_PS1_SHOWDIRTYSTATE=1 +GIT_PS1_SHOWUNTRACKEDFILES=1 +GIT_PS1_SHOWSTASHSTATE=1 +GIT_PS1_SHOWUPSTREAM='auto' +GIT_PS1_HIDE_IF_PWD_IGNORED=1 + +PROMPT_COMMAND="history -a; $PROMPT_COMMAND" + +# history +HISTCONTROL=ignoreboth:erasedups +HISTTIMEFORMAT="[%F %T] " +HISTFILESIZE= +HISTSIZE= +HISTFILE=~/.bash_history.local + +# completion, aliases, and local settings +[ -f ~/.bash_aliases ] && . ~/.bash_aliases; +[ -f ~/.bash_completion ] && . ~/.bash_completion; +[ -f ~/.bashrc.local ] && . ~/.bashrc.local + +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion diff --git a/.config/git/attributes b/.config/git/attributes index 0034fed..db895c5 100644 --- a/.config/git/attributes +++ b/.config/git/attributes @@ -1,18 +1,18 @@ -# Default -#* text=auto - -# Text files that should be normalized (CRLF => LF) -#*.c text -#*.h text - -# Text files with fixed EOL=LF -#*.sh text eol=LF - -# Text files with fixed EOL=CRLF$ -#*.bat text eol=CRLF -#*.ahk text eol=crlf -#*.vcproj text eol=crlf - -# Binary files -#*.reg binary -#*.exe binary +# Default +#* text=auto + +# Text files that should be normalized (CRLF => LF) +#*.c text +#*.h text + +# Text files with fixed EOL=LF +#*.sh text eol=LF + +# Text files with fixed EOL=CRLF$ +#*.bat text eol=CRLF +#*.ahk text eol=crlf +#*.vcproj text eol=crlf + +# Binary files +#*.reg binary +#*.exe binary diff --git a/.config/git/ignore b/.config/git/ignore index 0d306af..5221ad5 100644 --- a/.config/git/ignore +++ b/.config/git/ignore @@ -1,64 +1,64 @@ -# Ignore tags created by etags, ctags, gtags (GNU global) and cscope -TAGS -.TAGS -!TAGS/ -tags -.tags -!tags/ -gtags.files -GTAGS -GRTAGS -GPATH -cscope.files -cscope.out -cscope.in.out -cscope.po.out - -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - - -# OSX -*.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -__pycache__ +# Ignore tags created by etags, ctags, gtags (GNU global) and cscope +TAGS +.TAGS +!TAGS/ +tags +.tags +!tags/ +gtags.files +GTAGS +GRTAGS +GPATH +cscope.files +cscope.out +cscope.in.out +cscope.po.out + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + + +# OSX +*.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +__pycache__ diff --git a/.config/i3/config b/.config/i3/config index 45bd466..897258a 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -1,251 +1,251 @@ -# i3 config file (v4) -# -# Please see https://i3wm.org/docs/userguide.html for a complete reference! -# -# Mod=Windows/Command key (left of spacebar) -set $mod Mod4 - -# Multimedia keys -bindsym $mod+c exec dwmkey dwm_key_c -bindsym $mod+plus exec dwmkey dwm_key_plus -bindsym $mod+minus exec dwmkey dwm_key_minus -bindsym $mod+Next exec dwmkey music_next -bindsym $mod+Prior exec dwmkey music_previous -bindsym $mod+Shift+s exec dwmkey dwm_key_minus -bindsym $mod+Shift+d exec dwmkey dwm_key_plus - -# Font for window titles. Will also be used by the bar unless a different font -# is used in the bar {} block below. -# This font is widely installed, provides lots of unicode glyphs, right-to-left -# text rendering and scalability on retina/hidpi displays (thanks to pango). -font pango:DejaVu Sans Mono 10 - -# Use Mouse+$mod to drag floating windows to their wanted position -floating_modifier $mod - -# start a terminal -bindsym $mod+Return exec i3-sensible-terminal - -# kill focused window -# -# Use vim delete (vim vixen settings more than vim) -bindsym $mod+d kill - -# start dmenu (a program launcher) -# -# Make it the same as vim command mode -#bindsym $mod+semicolon exec dmenu_run -#bindsym $mod+semicolon exec --no-startup-id i3-dmenu-desktop -bindsym $mod+semicolon exec --no-startup-id rofi -show run -#bindsym $mod+semicolon exec echo -n | dmenu -b | xargs i3 - -# use these keys for focus, movement, and resize directions -# -# Make it the same as vim -set $left h -set $down j -set $up k -set $right l - -# change focus -bindsym $mod+$left focus left -bindsym $mod+$down focus down -bindsym $mod+$up focus up -bindsym $mod+$right focus right - -# move focused window -bindsym $mod+Shift+$left move left -bindsym $mod+Shift+$down move down -bindsym $mod+Shift+$up move up -bindsym $mod+Shift+$right move right - -bindsym Mod1+Ctrl+Shift+h move workspace to output left -bindsym Mod1+Ctrl+Shift+k move workspace to output up -bindsym Mod1+Ctrl+Shift+j move workspace to output down -bindsym Mod1+Ctrl+Shift+l move workspace to output right - -bindsym Mod1+Shift+h move container to output left -bindsym Mod1+Shift+k move container to output up -bindsym Mod1+Shift+j move container to output down -bindsym Mod1+Shift+l move container to output right - -# split in horizontal orientation -bindsym $mod+g split h - -# split in vertical orientation -bindsym $mod+v split v - -# enter fullscreen mode for the focused container -bindsym $mod+f fullscreen toggle - -# change container layout (stacked, tabbed, toggle split) -bindsym $mod+s layout stacking -bindsym $mod+w layout tabbed -bindsym $mod+e layout toggle split - -# toggle tiling / floating -bindsym $mod+Shift+space floating toggle - -# change focus between tiling / floating windows -bindsym $mod+space focus mode_toggle - -# focus the parent container -#bindsym $mod+a focus parent - -# focus the child container -#bindsym $mod+d focus child - -# switch to workspace -bindsym $mod+1 workspace 1 -bindsym $mod+2 workspace 2 -bindsym $mod+3 workspace 3 -bindsym $mod+4 workspace 4 -bindsym $mod+5 workspace 5 -bindsym $mod+6 workspace 6 -bindsym $mod+7 workspace 7 -bindsym $mod+8 workspace 8 -bindsym $mod+9 workspace 9 -bindsym $mod+0 workspace 10 - -# move focused container to workspace -bindsym $mod+Shift+1 move container to workspace 1 -bindsym $mod+Shift+2 move container to workspace 2 -bindsym $mod+Shift+3 move container to workspace 3 -bindsym $mod+Shift+4 move container to workspace 4 -bindsym $mod+Shift+5 move container to workspace 5 -bindsym $mod+Shift+6 move container to workspace 6 -bindsym $mod+Shift+7 move container to workspace 7 -bindsym $mod+Shift+8 move container to workspace 8 -bindsym $mod+Shift+9 move container to workspace 9 -bindsym $mod+Shift+0 move container to workspace 10 - -# reload the configuration file -bindsym $mod+Shift+c reload -# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) -bindsym $mod+Shift+r restart -# exit i3 (logs you out of your X session) -# bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'Do you really want to exit i3?' -b 'Yes, exit i3' 'gnome-session-quit --force --logout'" - -# resize window (you can also use the mouse for that) -mode "resize" { - # These bindings trigger as soon as you enter the resize mode - - # Pressing left will shrink the window’s width. - # Pressing right will grow the window’s width. - # Pressing up will shrink the window’s height. - # Pressing down will grow the window’s height. - bindsym $left resize shrink width 10 px or 10 ppt - bindsym $down resize grow height 10 px or 10 ppt - bindsym $up resize shrink height 10 px or 10 ppt - bindsym $right resize grow width 10 px or 10 ppt - - # back to normal: Enter or Escape - bindsym Escape mode "default" -} -bindsym $mod+r mode "resize" - -mode "command" { -# bindsym s move scratchpad; mode "default" -# bindsym b bar mode toggle; mode "default" - bindsym Escape mode "default" -# bindsym c exec echo -n | dmenu | xargs i3; mode "default" -# -# bindsym q exec pc location c3h; mode "default" -# bindsym w exec pc location wig; mode "default" -# bindsym e exec pc location fez; mode "default" -# bindsym r exec pc location turban; mode "default" -# -# bindsym p exec pomodoro query; mode "default" -# bindsym shift+p exec pomodoro off; mode "default" -# -# bindsym $mod+s layout stacking; mode "default" -# bindsym $mod+d layout default; mode "default" -# bindsym $mod+h layout splith; mode "default" -# bindsym $mod+v layout splitv; mode "default" -# bindsym $mod+t layout tabbed; mode "default" -# #bindsym $mod+v layout toggle split; mode "default" -# - bindsym d mode "display" -# - bindsym l mode "lockin" -} -bindsym $mod+x mode "command" - -mode "lockin" { -# bindsym $mod+F8 mode "default"; -# -# # multimedia keys should still work -# bindsym $mod+c exec dwmkey dwm_key_c -# bindsym $mod+plus exec dwmkey dwm_key_plus -# bindsym $mod+minus exec dwmkey dwm_key_minus -} - -mode "display" { -# bindsym d exec autodetect_screenlayout; mode "default" - bindsym h exec autodetect_screenlayout left; mode "default" - bindsym l exec autodetect_screenlayout right; mode "default" - bindsym j exec autodetect_screenlayout down; mode "default" - bindsym k exec autodetect_screenlayout up; mode "default" - bindsym Shift+h exec autodetect_screenlayout left left; mode "default" - bindsym Shift+l exec autodetect_screenlayout right left; mode "default" - bindsym Shift+j exec autodetect_screenlayout down left; mode "default" - bindsym Shift+k exec autodetect_screenlayout up left; mode "default" -# bindsym c exec .screenlayout/ccc.sh; mode "default" -# bindsym s exec .screenlayout/single.sh; exec sh ~/.fehbg; mode "default" -# bindsym Shift+s exec xrandr --output eDP-1 --off; mode "default" -# bindsym Shift+h exec .screenlayout/monitor-only.sh; mode "default" -# bindsym f exec .screenlayout/ftl.sh; mode "default" -# #bindsym w exec .screenlayout/work.sh; mode "default" -# bindsym w exec switch_wallpaper; mode "default" -# bindsym Shift+w exec unset_wallpaper; mode "default" -# bindsym h exec .screenlayout/home.sh; mode "default" -# bindsym Shift+r exec .screenlayout/rotated_right.sh; exec sh ~/.fehbg; mode "default" - bindsym Escape mode "default" -} - -mode "paste" { -# bindsym a mode "default"; exec xdotool keyup a && xdotool type --delay 2 "$(cat ~/sync/edge/aliases)" && xdotool key Return && i3-msg mode paste -# -# bindsym q mode "default" - bindsym Escape mode "default" -} - -# Start i3bar to display a workspace bar (plus the system information i3status -# finds out, if available) -bar { - status_command i3status -} - -#### Keep as much as possible from GNOME desktop - -# audio controls -bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 1 +5% -bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 1 -5% -bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 1 toggle - -# screen brightness controls -bindsym XF86MonBrightnessUp exec xbacklight -inc 10 -bindsym XF86MonBrightnessDown exec xbacklight -dec 10 - -# screenlock -bindsym Control+$mod+l exec gnome-screensaver-command -l - -# custom settings -exec --no-startup-id gnome-session # GNOME session -exec --no-startup-id gnome-settings-daemon # GNOME desktop settings -exec --no-startup-id gnome-screensaver # GNOME screensaver -exec --no-startup-id xautolock -time 10 -locker 'gnome-screensaver-command -l' - -# background image -#exec --no-startup-id feh --bg-center ~/Download/music.jpg - -####################################################################### -# automatically start i3-config-wizard to offer the user to create a -# keysym-based config which used their favorite modifier (alt or windows) -# -# i3-config-wizard will not launch if there already is a config file -# in ~/.i3/config. -# -# Please remove the following exec line: -####################################################################### -#exec i3-config-wizard +# i3 config file (v4) +# +# Please see https://i3wm.org/docs/userguide.html for a complete reference! +# +# Mod=Windows/Command key (left of spacebar) +set $mod Mod4 + +# Multimedia keys +bindsym $mod+c exec dwmkey dwm_key_c +bindsym $mod+plus exec dwmkey dwm_key_plus +bindsym $mod+minus exec dwmkey dwm_key_minus +bindsym $mod+Next exec dwmkey music_next +bindsym $mod+Prior exec dwmkey music_previous +bindsym $mod+Shift+s exec dwmkey dwm_key_minus +bindsym $mod+Shift+d exec dwmkey dwm_key_plus + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +# This font is widely installed, provides lots of unicode glyphs, right-to-left +# text rendering and scalability on retina/hidpi displays (thanks to pango). +font pango:DejaVu Sans Mono 10 + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# start a terminal +bindsym $mod+Return exec i3-sensible-terminal + +# kill focused window +# +# Use vim delete (vim vixen settings more than vim) +bindsym $mod+d kill + +# start dmenu (a program launcher) +# +# Make it the same as vim command mode +#bindsym $mod+semicolon exec dmenu_run +#bindsym $mod+semicolon exec --no-startup-id i3-dmenu-desktop +bindsym $mod+semicolon exec --no-startup-id rofi -show run +#bindsym $mod+semicolon exec echo -n | dmenu -b | xargs i3 + +# use these keys for focus, movement, and resize directions +# +# Make it the same as vim +set $left h +set $down j +set $up k +set $right l + +# change focus +bindsym $mod+$left focus left +bindsym $mod+$down focus down +bindsym $mod+$up focus up +bindsym $mod+$right focus right + +# move focused window +bindsym $mod+Shift+$left move left +bindsym $mod+Shift+$down move down +bindsym $mod+Shift+$up move up +bindsym $mod+Shift+$right move right + +bindsym Mod1+Ctrl+Shift+h move workspace to output left +bindsym Mod1+Ctrl+Shift+k move workspace to output up +bindsym Mod1+Ctrl+Shift+j move workspace to output down +bindsym Mod1+Ctrl+Shift+l move workspace to output right + +bindsym Mod1+Shift+h move container to output left +bindsym Mod1+Shift+k move container to output up +bindsym Mod1+Shift+j move container to output down +bindsym Mod1+Shift+l move container to output right + +# split in horizontal orientation +bindsym $mod+g split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +#bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +# switch to workspace +bindsym $mod+1 workspace 1 +bindsym $mod+2 workspace 2 +bindsym $mod+3 workspace 3 +bindsym $mod+4 workspace 4 +bindsym $mod+5 workspace 5 +bindsym $mod+6 workspace 6 +bindsym $mod+7 workspace 7 +bindsym $mod+8 workspace 8 +bindsym $mod+9 workspace 9 +bindsym $mod+0 workspace 10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace 1 +bindsym $mod+Shift+2 move container to workspace 2 +bindsym $mod+Shift+3 move container to workspace 3 +bindsym $mod+Shift+4 move container to workspace 4 +bindsym $mod+Shift+5 move container to workspace 5 +bindsym $mod+Shift+6 move container to workspace 6 +bindsym $mod+Shift+7 move container to workspace 7 +bindsym $mod+Shift+8 move container to workspace 8 +bindsym $mod+Shift+9 move container to workspace 9 +bindsym $mod+Shift+0 move container to workspace 10 + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +# bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'Do you really want to exit i3?' -b 'Yes, exit i3' 'gnome-session-quit --force --logout'" + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym $left resize shrink width 10 px or 10 ppt + bindsym $down resize grow height 10 px or 10 ppt + bindsym $up resize shrink height 10 px or 10 ppt + bindsym $right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + +mode "command" { +# bindsym s move scratchpad; mode "default" +# bindsym b bar mode toggle; mode "default" + bindsym Escape mode "default" +# bindsym c exec echo -n | dmenu | xargs i3; mode "default" +# +# bindsym q exec pc location c3h; mode "default" +# bindsym w exec pc location wig; mode "default" +# bindsym e exec pc location fez; mode "default" +# bindsym r exec pc location turban; mode "default" +# +# bindsym p exec pomodoro query; mode "default" +# bindsym shift+p exec pomodoro off; mode "default" +# +# bindsym $mod+s layout stacking; mode "default" +# bindsym $mod+d layout default; mode "default" +# bindsym $mod+h layout splith; mode "default" +# bindsym $mod+v layout splitv; mode "default" +# bindsym $mod+t layout tabbed; mode "default" +# #bindsym $mod+v layout toggle split; mode "default" +# + bindsym d mode "display" +# + bindsym l mode "lockin" +} +bindsym $mod+x mode "command" + +mode "lockin" { +# bindsym $mod+F8 mode "default"; +# +# # multimedia keys should still work +# bindsym $mod+c exec dwmkey dwm_key_c +# bindsym $mod+plus exec dwmkey dwm_key_plus +# bindsym $mod+minus exec dwmkey dwm_key_minus +} + +mode "display" { +# bindsym d exec autodetect_screenlayout; mode "default" + bindsym h exec autodetect_screenlayout left; mode "default" + bindsym l exec autodetect_screenlayout right; mode "default" + bindsym j exec autodetect_screenlayout down; mode "default" + bindsym k exec autodetect_screenlayout up; mode "default" + bindsym Shift+h exec autodetect_screenlayout left left; mode "default" + bindsym Shift+l exec autodetect_screenlayout right left; mode "default" + bindsym Shift+j exec autodetect_screenlayout down left; mode "default" + bindsym Shift+k exec autodetect_screenlayout up left; mode "default" +# bindsym c exec .screenlayout/ccc.sh; mode "default" +# bindsym s exec .screenlayout/single.sh; exec sh ~/.fehbg; mode "default" +# bindsym Shift+s exec xrandr --output eDP-1 --off; mode "default" +# bindsym Shift+h exec .screenlayout/monitor-only.sh; mode "default" +# bindsym f exec .screenlayout/ftl.sh; mode "default" +# #bindsym w exec .screenlayout/work.sh; mode "default" +# bindsym w exec switch_wallpaper; mode "default" +# bindsym Shift+w exec unset_wallpaper; mode "default" +# bindsym h exec .screenlayout/home.sh; mode "default" +# bindsym Shift+r exec .screenlayout/rotated_right.sh; exec sh ~/.fehbg; mode "default" + bindsym Escape mode "default" +} + +mode "paste" { +# bindsym a mode "default"; exec xdotool keyup a && xdotool type --delay 2 "$(cat ~/sync/edge/aliases)" && xdotool key Return && i3-msg mode paste +# +# bindsym q mode "default" + bindsym Escape mode "default" +} + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + status_command i3status +} + +#### Keep as much as possible from GNOME desktop + +# audio controls +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 1 +5% +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 1 -5% +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 1 toggle + +# screen brightness controls +bindsym XF86MonBrightnessUp exec xbacklight -inc 10 +bindsym XF86MonBrightnessDown exec xbacklight -dec 10 + +# screenlock +bindsym Control+$mod+l exec gnome-screensaver-command -l + +# custom settings +exec --no-startup-id gnome-session # GNOME session +exec --no-startup-id gnome-settings-daemon # GNOME desktop settings +exec --no-startup-id gnome-screensaver # GNOME screensaver +exec --no-startup-id xautolock -time 10 -locker 'gnome-screensaver-command -l' + +# background image +#exec --no-startup-id feh --bg-center ~/Download/music.jpg + +####################################################################### +# automatically start i3-config-wizard to offer the user to create a +# keysym-based config which used their favorite modifier (alt or windows) +# +# i3-config-wizard will not launch if there already is a config file +# in ~/.i3/config. +# +# Please remove the following exec line: +####################################################################### +#exec i3-config-wizard diff --git a/.config/mimeapps.list b/.config/mimeapps.list index db3227f..b0f58bf 100644 --- a/.config/mimeapps.list +++ b/.config/mimeapps.list @@ -1,248 +1,248 @@ -[Default Applications] -text/plain=vim.desktop -text/html=firefox.desktop -x-scheme-handler/http=firefox.desktop -x-scheme-handler/https=firefox.desktop -x-scheme-handler/about=brave.desktop -x-scheme-handler/unknown=brave.desktop -video/x-ogm+ogg=vlc.desktop -video/ogg=vlc.desktop -video/x-ogm=vlc.desktop -video/x-theora+ogg=vlc.desktop -video/x-theora=vlc.desktop -video/x-ms-asf=vlc.desktop -video/x-ms-asf-plugin=vlc.desktop -video/x-ms-asx=vlc.desktop -video/x-ms-wm=vlc.desktop -video/x-ms-wmv=vlc.desktop -video/x-ms-wmx=vlc.desktop -video/x-ms-wvx=vlc.desktop -video/x-msvideo=vlc.desktop -video/divx=vlc.desktop -video/msvideo=vlc.desktop -video/vnd.divx=vlc.desktop -video/avi=vlc.desktop -video/x-avi=vlc.desktop -video/vnd.rn-realvideo=vlc.desktop -video/mp2t=vlc.desktop -video/mpeg=vlc.desktop -video/mpeg-system=vlc.desktop -video/x-mpeg=vlc.desktop -video/x-mpeg2=vlc.desktop -video/x-mpeg-system=vlc.desktop -video/mp4=vlc.desktop -video/mp4v-es=vlc.desktop -video/x-m4v=vlc.desktop -video/quicktime=vlc.desktop -video/x-matroska=vlc.desktop -video/webm=vlc.desktop -video/3gp=vlc.desktop -video/3gpp=vlc.desktop -video/3gpp2=vlc.desktop -video/vnd.mpegurl=vlc.desktop -video/dv=vlc.desktop -video/x-anim=vlc.desktop -video/x-nsv=vlc.desktop -video/fli=vlc.desktop -video/flv=vlc.desktop -video/x-flc=vlc.desktop -video/x-fli=vlc.desktop -video/x-flv=vlc.desktop -audio/x-vorbis+ogg=vlc.desktop -audio/ogg=vlc.desktop -audio/vorbis=vlc.desktop -audio/x-vorbis=vlc.desktop -audio/x-speex=vlc.desktop -audio/opus=vlc.desktop -audio/flac=vlc.desktop -audio/x-flac=vlc.desktop -audio/x-ms-asf=vlc.desktop -audio/x-ms-asx=vlc.desktop -audio/x-ms-wax=vlc.desktop -audio/x-ms-wma=vlc.desktop -audio/x-pn-windows-acm=vlc.desktop -audio/vnd.rn-realaudio=vlc.desktop -audio/x-pn-realaudio=vlc.desktop -audio/x-pn-realaudio-plugin=vlc.desktop -audio/x-real-audio=vlc.desktop -audio/x-realaudio=vlc.desktop -audio/mpeg=vlc.desktop -audio/mpg=vlc.desktop -audio/mp1=vlc.desktop -audio/mp2=vlc.desktop -audio/mp3=vlc.desktop -audio/x-mp1=vlc.desktop -audio/x-mp2=vlc.desktop -audio/x-mp3=vlc.desktop -audio/x-mpeg=vlc.desktop -audio/x-mpg=vlc.desktop -audio/aac=vlc.desktop -audio/m4a=vlc.desktop -audio/mp4=vlc.desktop -audio/x-m4a=vlc.desktop -audio/x-aac=vlc.desktop -audio/x-matroska=vlc.desktop -audio/webm=vlc.desktop -audio/3gpp=vlc.desktop -audio/3gpp2=vlc.desktop -audio/AMR=vlc.desktop -audio/AMR-WB=vlc.desktop -audio/mpegurl=vlc.desktop -audio/x-mpegurl=vlc.desktop -audio/scpls=vlc.desktop -audio/x-scpls=vlc.desktop -audio/dv=vlc.desktop -audio/x-aiff=vlc.desktop -audio/x-pn-aiff=vlc.desktop -audio/wav=vlc.desktop -audio/x-pn-au=vlc.desktop -audio/x-pn-wav=vlc.desktop -audio/x-wav=vlc.desktop -audio/x-adpcm=vlc.desktop -audio/ac3=vlc.desktop -audio/eac3=vlc.desktop -audio/vnd.dts=vlc.desktop -audio/vnd.dts.hd=vlc.desktop -audio/vnd.dolby.heaac.1=vlc.desktop -audio/vnd.dolby.heaac.2=vlc.desktop -audio/vnd.dolby.mlp=vlc.desktop -audio/basic=vlc.desktop -audio/midi=vlc.desktop -audio/x-ape=vlc.desktop -audio/x-gsm=vlc.desktop -audio/x-musepack=vlc.desktop -audio/x-tta=vlc.desktop -audio/x-wavpack=vlc.desktop -audio/x-shorten=vlc.desktop -audio/x-it=vlc.desktop -audio/x-mod=vlc.desktop -audio/x-s3m=vlc.desktop -audio/x-xm=vlc.desktop -x-scheme-handler/ftp=firefox.desktop -x-scheme-handler/chrome=firefox.desktop -application/x-extension-htm=firefox.desktop -application/x-extension-html=firefox.desktop -application/x-extension-shtml=firefox.desktop -application/xhtml+xml=firefox.desktop -application/x-extension-xhtml=firefox.desktop -application/x-extension-xht=firefox.desktop - -[Added Associations] -video/ogg=vlc.desktop; -video/x-ogm=vlc.desktop; -video/x-theora+ogg=vlc.desktop; -video/x-theora=vlc.desktop; -video/x-ms-asf=vlc.desktop; -video/x-ms-asf-plugin=vlc.desktop; -video/x-ms-asx=vlc.desktop; -video/x-ms-wm=vlc.desktop; -video/x-ms-wmv=vlc.desktop; -video/x-ms-wmx=vlc.desktop; -video/x-ms-wvx=vlc.desktop; -video/x-msvideo=vlc.desktop; -video/divx=vlc.desktop; -video/msvideo=vlc.desktop; -video/vnd.divx=vlc.desktop; -video/avi=vlc.desktop; -video/x-avi=vlc.desktop; -video/vnd.rn-realvideo=vlc.desktop; -video/mp2t=vlc.desktop; -video/mpeg=vlc.desktop; -video/mpeg-system=vlc.desktop; -video/x-mpeg=vlc.desktop; -video/x-mpeg2=vlc.desktop; -video/x-mpeg-system=vlc.desktop; -video/mp4=vlc.desktop; -video/mp4v-es=vlc.desktop; -video/x-m4v=vlc.desktop; -video/quicktime=vlc.desktop; -video/x-matroska=vlc.desktop; -video/webm=vlc.desktop; -video/3gp=vlc.desktop; -video/3gpp=vlc.desktop; -video/3gpp2=vlc.desktop; -video/vnd.mpegurl=vlc.desktop; -video/dv=vlc.desktop; -video/x-anim=vlc.desktop; -video/x-nsv=vlc.desktop; -video/fli=vlc.desktop; -video/flv=vlc.desktop; -video/x-flc=vlc.desktop; -video/x-fli=vlc.desktop; -video/x-flv=vlc.desktop; -audio/ogg=vlc.desktop; -audio/vorbis=vlc.desktop; -audio/x-vorbis=vlc.desktop; -audio/x-speex=vlc.desktop; -audio/opus=vlc.desktop; -audio/flac=vlc.desktop; -audio/x-flac=vlc.desktop; -audio/x-ms-asf=vlc.desktop; -audio/x-ms-asx=vlc.desktop; -audio/x-ms-wax=vlc.desktop; -audio/x-ms-wma=vlc.desktop; -audio/x-pn-windows-acm=vlc.desktop; -audio/vnd.rn-realaudio=vlc.desktop; -audio/x-pn-realaudio=vlc.desktop; -audio/x-pn-realaudio-plugin=vlc.desktop; -audio/x-real-audio=vlc.desktop; -audio/x-realaudio=vlc.desktop; -audio/mpeg=vlc.desktop; -audio/mpg=vlc.desktop; -audio/mp1=vlc.desktop; -audio/mp2=vlc.desktop; -audio/mp3=vlc.desktop; -audio/x-mp1=vlc.desktop; -audio/x-mp2=vlc.desktop; -audio/x-mp3=vlc.desktop; -audio/x-mpeg=vlc.desktop; -audio/x-mpg=vlc.desktop; -audio/aac=vlc.desktop; -audio/m4a=vlc.desktop; -audio/mp4=vlc.desktop; -audio/x-m4a=vlc.desktop; -audio/x-aac=vlc.desktop; -audio/x-matroska=vlc.desktop; -audio/webm=vlc.desktop; -audio/3gpp=vlc.desktop; -audio/3gpp2=vlc.desktop; -audio/AMR=vlc.desktop; -audio/AMR-WB=vlc.desktop; -audio/mpegurl=vlc.desktop; -audio/x-mpegurl=vlc.desktop; -audio/scpls=vlc.desktop; -audio/x-scpls=vlc.desktop; -audio/dv=vlc.desktop; -audio/x-aiff=vlc.desktop; -audio/x-pn-aiff=vlc.desktop; -audio/wav=vlc.desktop; -audio/x-pn-au=vlc.desktop; -audio/x-pn-wav=vlc.desktop; -audio/x-wav=vlc.desktop; -audio/x-adpcm=vlc.desktop; -audio/ac3=vlc.desktop; -audio/eac3=vlc.desktop; -audio/vnd.dts=vlc.desktop; -audio/vnd.dts.hd=vlc.desktop; -audio/vnd.dolby.heaac.1=vlc.desktop; -audio/vnd.dolby.heaac.2=vlc.desktop; -audio/vnd.dolby.mlp=vlc.desktop; -audio/basic=vlc.desktop; -audio/midi=vlc.desktop; -audio/x-ape=vlc.desktop; -audio/x-gsm=vlc.desktop; -audio/x-musepack=vlc.desktop; -audio/x-tta=vlc.desktop; -audio/x-wavpack=vlc.desktop; -audio/x-shorten=vlc.desktop; -audio/x-it=vlc.desktop; -audio/x-mod=vlc.desktop; -audio/x-s3m=vlc.desktop; -audio/x-xm=vlc.desktop; -application/x-mimearchive=gvim.desktop; -x-scheme-handler/http=firefox.desktop; -x-scheme-handler/https=firefox.desktop; -text/html=firefox.desktop; -x-scheme-handler/sms=org.gnome.Shell.Extensions.GSConnect.desktop; -inode/directory=meld.desktop; -application/javascript=gvim.desktop; +[Default Applications] +text/plain=vim.desktop +text/html=firefox.desktop +x-scheme-handler/http=firefox.desktop +x-scheme-handler/https=firefox.desktop +x-scheme-handler/about=brave.desktop +x-scheme-handler/unknown=brave.desktop +video/x-ogm+ogg=vlc.desktop +video/ogg=vlc.desktop +video/x-ogm=vlc.desktop +video/x-theora+ogg=vlc.desktop +video/x-theora=vlc.desktop +video/x-ms-asf=vlc.desktop +video/x-ms-asf-plugin=vlc.desktop +video/x-ms-asx=vlc.desktop +video/x-ms-wm=vlc.desktop +video/x-ms-wmv=vlc.desktop +video/x-ms-wmx=vlc.desktop +video/x-ms-wvx=vlc.desktop +video/x-msvideo=vlc.desktop +video/divx=vlc.desktop +video/msvideo=vlc.desktop +video/vnd.divx=vlc.desktop +video/avi=vlc.desktop +video/x-avi=vlc.desktop +video/vnd.rn-realvideo=vlc.desktop +video/mp2t=vlc.desktop +video/mpeg=vlc.desktop +video/mpeg-system=vlc.desktop +video/x-mpeg=vlc.desktop +video/x-mpeg2=vlc.desktop +video/x-mpeg-system=vlc.desktop +video/mp4=vlc.desktop +video/mp4v-es=vlc.desktop +video/x-m4v=vlc.desktop +video/quicktime=vlc.desktop +video/x-matroska=vlc.desktop +video/webm=vlc.desktop +video/3gp=vlc.desktop +video/3gpp=vlc.desktop +video/3gpp2=vlc.desktop +video/vnd.mpegurl=vlc.desktop +video/dv=vlc.desktop +video/x-anim=vlc.desktop +video/x-nsv=vlc.desktop +video/fli=vlc.desktop +video/flv=vlc.desktop +video/x-flc=vlc.desktop +video/x-fli=vlc.desktop +video/x-flv=vlc.desktop +audio/x-vorbis+ogg=vlc.desktop +audio/ogg=vlc.desktop +audio/vorbis=vlc.desktop +audio/x-vorbis=vlc.desktop +audio/x-speex=vlc.desktop +audio/opus=vlc.desktop +audio/flac=vlc.desktop +audio/x-flac=vlc.desktop +audio/x-ms-asf=vlc.desktop +audio/x-ms-asx=vlc.desktop +audio/x-ms-wax=vlc.desktop +audio/x-ms-wma=vlc.desktop +audio/x-pn-windows-acm=vlc.desktop +audio/vnd.rn-realaudio=vlc.desktop +audio/x-pn-realaudio=vlc.desktop +audio/x-pn-realaudio-plugin=vlc.desktop +audio/x-real-audio=vlc.desktop +audio/x-realaudio=vlc.desktop +audio/mpeg=vlc.desktop +audio/mpg=vlc.desktop +audio/mp1=vlc.desktop +audio/mp2=vlc.desktop +audio/mp3=vlc.desktop +audio/x-mp1=vlc.desktop +audio/x-mp2=vlc.desktop +audio/x-mp3=vlc.desktop +audio/x-mpeg=vlc.desktop +audio/x-mpg=vlc.desktop +audio/aac=vlc.desktop +audio/m4a=vlc.desktop +audio/mp4=vlc.desktop +audio/x-m4a=vlc.desktop +audio/x-aac=vlc.desktop +audio/x-matroska=vlc.desktop +audio/webm=vlc.desktop +audio/3gpp=vlc.desktop +audio/3gpp2=vlc.desktop +audio/AMR=vlc.desktop +audio/AMR-WB=vlc.desktop +audio/mpegurl=vlc.desktop +audio/x-mpegurl=vlc.desktop +audio/scpls=vlc.desktop +audio/x-scpls=vlc.desktop +audio/dv=vlc.desktop +audio/x-aiff=vlc.desktop +audio/x-pn-aiff=vlc.desktop +audio/wav=vlc.desktop +audio/x-pn-au=vlc.desktop +audio/x-pn-wav=vlc.desktop +audio/x-wav=vlc.desktop +audio/x-adpcm=vlc.desktop +audio/ac3=vlc.desktop +audio/eac3=vlc.desktop +audio/vnd.dts=vlc.desktop +audio/vnd.dts.hd=vlc.desktop +audio/vnd.dolby.heaac.1=vlc.desktop +audio/vnd.dolby.heaac.2=vlc.desktop +audio/vnd.dolby.mlp=vlc.desktop +audio/basic=vlc.desktop +audio/midi=vlc.desktop +audio/x-ape=vlc.desktop +audio/x-gsm=vlc.desktop +audio/x-musepack=vlc.desktop +audio/x-tta=vlc.desktop +audio/x-wavpack=vlc.desktop +audio/x-shorten=vlc.desktop +audio/x-it=vlc.desktop +audio/x-mod=vlc.desktop +audio/x-s3m=vlc.desktop +audio/x-xm=vlc.desktop +x-scheme-handler/ftp=firefox.desktop +x-scheme-handler/chrome=firefox.desktop +application/x-extension-htm=firefox.desktop +application/x-extension-html=firefox.desktop +application/x-extension-shtml=firefox.desktop +application/xhtml+xml=firefox.desktop +application/x-extension-xhtml=firefox.desktop +application/x-extension-xht=firefox.desktop + +[Added Associations] +video/ogg=vlc.desktop; +video/x-ogm=vlc.desktop; +video/x-theora+ogg=vlc.desktop; +video/x-theora=vlc.desktop; +video/x-ms-asf=vlc.desktop; +video/x-ms-asf-plugin=vlc.desktop; +video/x-ms-asx=vlc.desktop; +video/x-ms-wm=vlc.desktop; +video/x-ms-wmv=vlc.desktop; +video/x-ms-wmx=vlc.desktop; +video/x-ms-wvx=vlc.desktop; +video/x-msvideo=vlc.desktop; +video/divx=vlc.desktop; +video/msvideo=vlc.desktop; +video/vnd.divx=vlc.desktop; +video/avi=vlc.desktop; +video/x-avi=vlc.desktop; +video/vnd.rn-realvideo=vlc.desktop; +video/mp2t=vlc.desktop; +video/mpeg=vlc.desktop; +video/mpeg-system=vlc.desktop; +video/x-mpeg=vlc.desktop; +video/x-mpeg2=vlc.desktop; +video/x-mpeg-system=vlc.desktop; +video/mp4=vlc.desktop; +video/mp4v-es=vlc.desktop; +video/x-m4v=vlc.desktop; +video/quicktime=vlc.desktop; +video/x-matroska=vlc.desktop; +video/webm=vlc.desktop; +video/3gp=vlc.desktop; +video/3gpp=vlc.desktop; +video/3gpp2=vlc.desktop; +video/vnd.mpegurl=vlc.desktop; +video/dv=vlc.desktop; +video/x-anim=vlc.desktop; +video/x-nsv=vlc.desktop; +video/fli=vlc.desktop; +video/flv=vlc.desktop; +video/x-flc=vlc.desktop; +video/x-fli=vlc.desktop; +video/x-flv=vlc.desktop; +audio/ogg=vlc.desktop; +audio/vorbis=vlc.desktop; +audio/x-vorbis=vlc.desktop; +audio/x-speex=vlc.desktop; +audio/opus=vlc.desktop; +audio/flac=vlc.desktop; +audio/x-flac=vlc.desktop; +audio/x-ms-asf=vlc.desktop; +audio/x-ms-asx=vlc.desktop; +audio/x-ms-wax=vlc.desktop; +audio/x-ms-wma=vlc.desktop; +audio/x-pn-windows-acm=vlc.desktop; +audio/vnd.rn-realaudio=vlc.desktop; +audio/x-pn-realaudio=vlc.desktop; +audio/x-pn-realaudio-plugin=vlc.desktop; +audio/x-real-audio=vlc.desktop; +audio/x-realaudio=vlc.desktop; +audio/mpeg=vlc.desktop; +audio/mpg=vlc.desktop; +audio/mp1=vlc.desktop; +audio/mp2=vlc.desktop; +audio/mp3=vlc.desktop; +audio/x-mp1=vlc.desktop; +audio/x-mp2=vlc.desktop; +audio/x-mp3=vlc.desktop; +audio/x-mpeg=vlc.desktop; +audio/x-mpg=vlc.desktop; +audio/aac=vlc.desktop; +audio/m4a=vlc.desktop; +audio/mp4=vlc.desktop; +audio/x-m4a=vlc.desktop; +audio/x-aac=vlc.desktop; +audio/x-matroska=vlc.desktop; +audio/webm=vlc.desktop; +audio/3gpp=vlc.desktop; +audio/3gpp2=vlc.desktop; +audio/AMR=vlc.desktop; +audio/AMR-WB=vlc.desktop; +audio/mpegurl=vlc.desktop; +audio/x-mpegurl=vlc.desktop; +audio/scpls=vlc.desktop; +audio/x-scpls=vlc.desktop; +audio/dv=vlc.desktop; +audio/x-aiff=vlc.desktop; +audio/x-pn-aiff=vlc.desktop; +audio/wav=vlc.desktop; +audio/x-pn-au=vlc.desktop; +audio/x-pn-wav=vlc.desktop; +audio/x-wav=vlc.desktop; +audio/x-adpcm=vlc.desktop; +audio/ac3=vlc.desktop; +audio/eac3=vlc.desktop; +audio/vnd.dts=vlc.desktop; +audio/vnd.dts.hd=vlc.desktop; +audio/vnd.dolby.heaac.1=vlc.desktop; +audio/vnd.dolby.heaac.2=vlc.desktop; +audio/vnd.dolby.mlp=vlc.desktop; +audio/basic=vlc.desktop; +audio/midi=vlc.desktop; +audio/x-ape=vlc.desktop; +audio/x-gsm=vlc.desktop; +audio/x-musepack=vlc.desktop; +audio/x-tta=vlc.desktop; +audio/x-wavpack=vlc.desktop; +audio/x-shorten=vlc.desktop; +audio/x-it=vlc.desktop; +audio/x-mod=vlc.desktop; +audio/x-s3m=vlc.desktop; +audio/x-xm=vlc.desktop; +application/x-mimearchive=gvim.desktop; +x-scheme-handler/http=firefox.desktop; +x-scheme-handler/https=firefox.desktop; +text/html=firefox.desktop; +x-scheme-handler/sms=org.gnome.Shell.Extensions.GSConnect.desktop; +inode/directory=meld.desktop; +application/javascript=gvim.desktop; diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf index 918b6c1..4ba8b5f 100644 --- a/.config/ranger/rc.conf +++ b/.config/ranger/rc.conf @@ -1,23 +1,23 @@ -# =================================================================== -# == Options -# =================================================================== - -# Show hidden files? You can toggle this by typing 'zh' -set show_hidden true - -# Which script is used to generate file previews? -# ranger ships with scope.sh, a script that calls external programs (see -# README.md for dependencies) to preview images, archives, etc. -set preview_script ~/.config/ranger/scope.sh - -# Use the external preview script or display simple plain text or image previews? -set use_preview_script true - -# State of the three backends git, hg, bzr. The possible states are -# disabled, local (only show local info), enabled (show local and remote -# information). -set vcs_backend_git enabled - -# Use one of the supported image preview protocols -set preview_images true - +# =================================================================== +# == Options +# =================================================================== + +# Show hidden files? You can toggle this by typing 'zh' +set show_hidden true + +# Which script is used to generate file previews? +# ranger ships with scope.sh, a script that calls external programs (see +# README.md for dependencies) to preview images, archives, etc. +set preview_script ~/.config/ranger/scope.sh + +# Use the external preview script or display simple plain text or image previews? +set use_preview_script true + +# State of the three backends git, hg, bzr. The possible states are +# disabled, local (only show local info), enabled (show local and remote +# information). +set vcs_backend_git enabled + +# Use one of the supported image preview protocols +set preview_images true + diff --git a/.config/ranger/scope.sh b/.config/ranger/scope.sh index 7ee3367..2ca3aab 100755 --- a/.config/ranger/scope.sh +++ b/.config/ranger/scope.sh @@ -1,111 +1,111 @@ -#!/usr/bin/env sh -# ranger supports enhanced previews. If the option "use_preview_script" -# is set to True and this file exists, this script will be called and its -# output is displayed in ranger. ANSI color codes are supported. - -# NOTES: This script is considered a configuration file. If you upgrade -# ranger, it will be left untouched. (You must update it yourself.) -# Also, ranger disables STDIN here, so interactive scripts won't work properly - -# Meanings of exit codes: -# code | meaning | action of ranger -# -----+------------+------------------------------------------- -# 0 | success | success. display stdout as preview -# 1 | no preview | failure. display no preview at all -# 2 | plain text | display the plain content of the file -# 3 | fix width | success. Don't reload when width changes -# 4 | fix height | success. Don't reload when height changes -# 5 | fix both | success. Don't ever reload -# 6 | image | success. display the image $cached points to as an image preview -# 7 | image | success. display the file directly as an image - -# Meaningful aliases for arguments: -path="$1" # Full path of the selected file -width="$2" # Width of the preview pane (number of fitting characters) -height="$3" # Height of the preview pane (number of fitting characters) -cached="$4" # Path that should be used to cache image previews -preview_images="$5" # "True" if image previews are enabled, "False" otherwise. - -maxln=200 # Stop after $maxln lines. Can be used like ls | head -n $maxln - -# Find out something about the file: -mimetype=$(file --mime-type -Lb "$path") -extension=$(/bin/echo "${path##*.}" | awk '{print tolower($0)}') - -# Functions: -# runs a command and saves its output into $output. Useful if you need -# the return value AND want to use the output in a pipe -try() { output=$(eval '"$@"'); } - -# writes the output of the previously used "try" command -dump() { /bin/echo "$output"; } - -# a common post-processing function used after most commands -trim() { head -n "$maxln"; } - -# wraps highlight to treat exit code 141 (killed by SIGPIPE) as success -safepipe() { "$@"; test $? = 0 -o $? = 141; } - -# Image previews, if enabled in ranger. -if [ "$preview_images" = "True" ]; then - case "$mimetype" in - # Image previews for SVG files, disabled by default. - ###image/svg+xml) - ### convert "$path" "$cached" && exit 6 || exit 1;; - # Image previews for image files. w3mimgdisplay will be called for all - # image files (unless overriden as above), but might fail for - # unsupported types. - image/*) - exit 7;; - # Image preview for video, disabled by default.: - ###video/*) - ### ffmpegthumbnailer -i "$path" -o "$cached" -s 0 && exit 6 || exit 1;; - esac -fi - -case "$extension" in - # Archive extensions: - a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\ - rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip) - try als "$path" && { dump | trim; exit 0; } - try acat "$path" && { dump | trim; exit 3; } - try bsdtar -lf "$path" && { dump | trim; exit 0; } - exit 1;; - rar) - # avoid password prompt by providing empty password - try unrar -p- lt "$path" && { dump | trim; exit 0; } || exit 1;; - 7z) - # avoid password prompt by providing empty password - try 7z -p l "$path" && { dump | trim; exit 0; } || exit 1;; - # PDF documents: - pdf) - try pdftotext -l 10 -nopgbrk -q "$path" - && \ - { dump | trim | fmt -s -w $width; exit 0; } || exit 1;; - # BitTorrent Files - torrent) - try transmission-show "$path" && { dump | trim; exit 5; } || exit 1;; - # ODT Files - odt|ods|odp|sxw) - try odt2txt "$path" && { dump | trim; exit 5; } || exit 1;; - # HTML Pages: - htm|html|xhtml) - try w3m -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } - ;; # fall back to highlight/cat if the text browsers fail -esac - -case "$mimetype" in - # Syntax highlight for text files: - text/* | */xml) - try safepipe less "$path" && { dump | trim; exit 5; } - exit 2;; - # Ascii-previews of images: - image/*) - img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;; - # Display information about media files: - video/* | audio/*) - exiftool "$path" && exit 5 - # Use sed to remove spaces so the output fits into the narrow window - try mediainfo "$path" && { dump | trim | sed 's/ \+:/: /;'; exit 5; } || exit 1;; -esac - -exit 1 +#!/usr/bin/env sh +# ranger supports enhanced previews. If the option "use_preview_script" +# is set to True and this file exists, this script will be called and its +# output is displayed in ranger. ANSI color codes are supported. + +# NOTES: This script is considered a configuration file. If you upgrade +# ranger, it will be left untouched. (You must update it yourself.) +# Also, ranger disables STDIN here, so interactive scripts won't work properly + +# Meanings of exit codes: +# code | meaning | action of ranger +# -----+------------+------------------------------------------- +# 0 | success | success. display stdout as preview +# 1 | no preview | failure. display no preview at all +# 2 | plain text | display the plain content of the file +# 3 | fix width | success. Don't reload when width changes +# 4 | fix height | success. Don't reload when height changes +# 5 | fix both | success. Don't ever reload +# 6 | image | success. display the image $cached points to as an image preview +# 7 | image | success. display the file directly as an image + +# Meaningful aliases for arguments: +path="$1" # Full path of the selected file +width="$2" # Width of the preview pane (number of fitting characters) +height="$3" # Height of the preview pane (number of fitting characters) +cached="$4" # Path that should be used to cache image previews +preview_images="$5" # "True" if image previews are enabled, "False" otherwise. + +maxln=200 # Stop after $maxln lines. Can be used like ls | head -n $maxln + +# Find out something about the file: +mimetype=$(file --mime-type -Lb "$path") +extension=$(/bin/echo "${path##*.}" | awk '{print tolower($0)}') + +# Functions: +# runs a command and saves its output into $output. Useful if you need +# the return value AND want to use the output in a pipe +try() { output=$(eval '"$@"'); } + +# writes the output of the previously used "try" command +dump() { /bin/echo "$output"; } + +# a common post-processing function used after most commands +trim() { head -n "$maxln"; } + +# wraps highlight to treat exit code 141 (killed by SIGPIPE) as success +safepipe() { "$@"; test $? = 0 -o $? = 141; } + +# Image previews, if enabled in ranger. +if [ "$preview_images" = "True" ]; then + case "$mimetype" in + # Image previews for SVG files, disabled by default. + ###image/svg+xml) + ### convert "$path" "$cached" && exit 6 || exit 1;; + # Image previews for image files. w3mimgdisplay will be called for all + # image files (unless overriden as above), but might fail for + # unsupported types. + image/*) + exit 7;; + # Image preview for video, disabled by default.: + ###video/*) + ### ffmpegthumbnailer -i "$path" -o "$cached" -s 0 && exit 6 || exit 1;; + esac +fi + +case "$extension" in + # Archive extensions: + a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\ + rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip) + try als "$path" && { dump | trim; exit 0; } + try acat "$path" && { dump | trim; exit 3; } + try bsdtar -lf "$path" && { dump | trim; exit 0; } + exit 1;; + rar) + # avoid password prompt by providing empty password + try unrar -p- lt "$path" && { dump | trim; exit 0; } || exit 1;; + 7z) + # avoid password prompt by providing empty password + try 7z -p l "$path" && { dump | trim; exit 0; } || exit 1;; + # PDF documents: + pdf) + try pdftotext -l 10 -nopgbrk -q "$path" - && \ + { dump | trim | fmt -s -w $width; exit 0; } || exit 1;; + # BitTorrent Files + torrent) + try transmission-show "$path" && { dump | trim; exit 5; } || exit 1;; + # ODT Files + odt|ods|odp|sxw) + try odt2txt "$path" && { dump | trim; exit 5; } || exit 1;; + # HTML Pages: + htm|html|xhtml) + try w3m -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } + ;; # fall back to highlight/cat if the text browsers fail +esac + +case "$mimetype" in + # Syntax highlight for text files: + text/* | */xml) + try safepipe less "$path" && { dump | trim; exit 5; } + exit 2;; + # Ascii-previews of images: + image/*) + img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;; + # Display information about media files: + video/* | audio/*) + exiftool "$path" && exit 5 + # Use sed to remove spaces so the output fits into the narrow window + try mediainfo "$path" && { dump | trim | sed 's/ \+:/: /;'; exit 5; } || exit 1;; +esac + +exit 1 diff --git a/.config/user-dirs.dirs b/.config/user-dirs.dirs index 4769f18..a83a878 100644 --- a/.config/user-dirs.dirs +++ b/.config/user-dirs.dirs @@ -1,16 +1,16 @@ -# This file is written by xdg-user-dirs-update -# If you want to change or add directories, just edit the line you're -# interested in. All local changes will be retained on the next run. -# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped -# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an -# absolute path. No other format is supported. -# -XDG_DESKTOP_DIR="$HOME/cloud/Desktop" -XDG_TEMPLATES_DIR="$HOME/cloud/Templates" -XDG_PUBLICSHARE_DIR="$HOME/cloud/Public" -XDG_DOCUMENTS_DIR="$HOME/cloud/Documents" -# too big to get synced -XDG_DOWNLOAD_DIR="$HOME/Download" -XDG_MUSIC_DIR="$HOME/Music" -XDG_PICTURES_DIR="$HOME/Pictures" -XDG_VIDEOS_DIR="$HOME/Videos" +# This file is written by xdg-user-dirs-update +# If you want to change or add directories, just edit the line you're +# interested in. All local changes will be retained on the next run. +# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped +# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an +# absolute path. No other format is supported. +# +XDG_DESKTOP_DIR="$HOME/cloud/Desktop" +XDG_TEMPLATES_DIR="$HOME/cloud/Templates" +XDG_PUBLICSHARE_DIR="$HOME/cloud/Public" +XDG_DOCUMENTS_DIR="$HOME/cloud/Documents" +# too big to get synced +XDG_DOWNLOAD_DIR="$HOME/Download" +XDG_MUSIC_DIR="$HOME/Music" +XDG_PICTURES_DIR="$HOME/Pictures" +XDG_VIDEOS_DIR="$HOME/Videos" diff --git a/.cshrc b/.cshrc index d62cb82..9a21b6d 100644 --- a/.cshrc +++ b/.cshrc @@ -1,12 +1,12 @@ -# .cshrc: executed by C shells on startup - -# If this is login or command shell then change to a sane shell -if ($SHELL != /bin/bash) then - setenv SHELL /bin/bash - if ($?command) then - exec /bin/bash -c "$command" - else - exec /bin/bash - endif -endif - +# .cshrc: executed by C shells on startup + +# If this is login or command shell then change to a sane shell +if ($SHELL != /bin/bash) then + setenv SHELL /bin/bash + if ($?command) then + exec /bin/bash -c "$command" + else + exec /bin/bash + endif +endif + diff --git a/.gitignore b/.gitignore index 06bda36..7f5d8da 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -.dit +.dit diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29..0000000 diff --git a/.inputrc b/.inputrc index d6649bd..2eeb802 100644 --- a/.inputrc +++ b/.inputrc @@ -1,64 +1,64 @@ -# Use vi keybindings for everything that uses readline. - -# Useful stuff for UTF-8 -set meta-flag on -set input-meta on -set output-meta on -set convert-meta off - -# Adds punctuation as word delimiters -set bind-tty-special-chars off - -# Completion Options -set completion-ignore-case on -set show-all-if-ambiguous on -set show-all-if-unmodified on -set mark-symlinked-directories on -set match-hidden-files off -set page-completions on -set completion-query-items 200 -set visible-stats on -set skip-completed-text on - -set editing-mode vi -set keymap vi - -set show-mode-in-prompt on -set vi-ins-mode-string + -set vi-cmd-mode-string - - -set keymap vi-command -"gg": beginning-of-history -"G": end-of-history -"j": history-search-forward -"k": history-search-backward - -$if Bash - # do history expansion when space entered - Space: magic-space -$endif - -set keymap vi-insert -"\e": vi-movement-mode -"jk": vi-movement-mode -Tab: complete -#Tab: menu-complete - -$if Python -$endif - -$if Gdb - "\e[15~": "continue\n" - "\e[21~": "next\n" - "\e[23~": "step\n" - "\eOQ": "nexti\n" - "\eOR": "stepi\n" -$endif - -$if mysql - "\C-xs": "show tables like '%%';\e[D\e[D\e[D" -$endif - -# Include system wide settings which is ignored -# by default if one has own .inputrc -$include ~/inputrc.local +# Use vi keybindings for everything that uses readline. + +# Useful stuff for UTF-8 +set meta-flag on +set input-meta on +set output-meta on +set convert-meta off + +# Adds punctuation as word delimiters +set bind-tty-special-chars off + +# Completion Options +set completion-ignore-case on +set show-all-if-ambiguous on +set show-all-if-unmodified on +set mark-symlinked-directories on +set match-hidden-files off +set page-completions on +set completion-query-items 200 +set visible-stats on +set skip-completed-text on + +set editing-mode vi +set keymap vi + +set show-mode-in-prompt on +set vi-ins-mode-string + +set vi-cmd-mode-string - + +set keymap vi-command +"gg": beginning-of-history +"G": end-of-history +"j": history-search-forward +"k": history-search-backward + +$if Bash + # do history expansion when space entered + Space: magic-space +$endif + +set keymap vi-insert +"\e": vi-movement-mode +"jk": vi-movement-mode +Tab: complete +#Tab: menu-complete + +$if Python +$endif + +$if Gdb + "\e[15~": "continue\n" + "\e[21~": "next\n" + "\e[23~": "step\n" + "\eOQ": "nexti\n" + "\eOR": "stepi\n" +$endif + +$if mysql + "\C-xs": "show tables like '%%';\e[D\e[D\e[D" +$endif + +# Include system wide settings which is ignored +# by default if one has own .inputrc +$include ~/inputrc.local diff --git a/.mutt/keybindings b/.mutt/keybindings index fa0a981..4f8c237 100644 --- a/.mutt/keybindings +++ b/.mutt/keybindings @@ -1,53 +1,53 @@ -bind generic,index Q exit -bind editor noop -bind editor complete-query - -bind browser gg top-page -bind browser G bottom-page -bind browser \Cb previous-page -bind browser \Cf next-page -bind browser A check-new -bind browser v view-file - -bind index ~ set-flag -bind index \Cv what-key -bind index H current-top -bind index M current-middle -bind index L current-bottom -bind index / search -bind index : enter-command -bind index i mail - -bind pager i edit -bind pager u mark-as-new -bind pager gg top -bind pager G bottom -bind pager j next-line -bind pager k previous-line - -bind index,attach gg first-entry -bind index,attach G last-entry - -bind index,pager L list-reply -# bind index,pager P print-message -bind index,pager R group-reply -bind index,pager \Cd half-down -bind index,pager \Cu half-up -bind index,pager \Cf next-page -bind index,pager \Cb previous-page -bind index,pager \Cn next-thread -bind index,pager \Cp previous-thread - -bind index,pager f forward-message -bind index,pager p previous-undeleted -bind index,pager N next-unread -bind index,pager P previous-unread - -bind index,pager X print-message - -macro index Z "mu find --clearlinks --format=links --linksdir=~/.mu/results " "mu find" -macro index S "~/.mu/results" "mu find results" - -macro attach s $HOME "Save to default directory for attachments" - -# vim: ft=muttrc +bind generic,index Q exit +bind editor noop +bind editor complete-query + +bind browser gg top-page +bind browser G bottom-page +bind browser \Cb previous-page +bind browser \Cf next-page +bind browser A check-new +bind browser v view-file + +bind index ~ set-flag +bind index \Cv what-key +bind index H current-top +bind index M current-middle +bind index L current-bottom +bind index / search +bind index : enter-command +bind index i mail + +bind pager i edit +bind pager u mark-as-new +bind pager gg top +bind pager G bottom +bind pager j next-line +bind pager k previous-line + +bind index,attach gg first-entry +bind index,attach G last-entry + +bind index,pager L list-reply +# bind index,pager P print-message +bind index,pager R group-reply +bind index,pager \Cd half-down +bind index,pager \Cu half-up +bind index,pager \Cf next-page +bind index,pager \Cb previous-page +bind index,pager \Cn next-thread +bind index,pager \Cp previous-thread + +bind index,pager f forward-message +bind index,pager p previous-undeleted +bind index,pager N next-unread +bind index,pager P previous-unread + +bind index,pager X print-message + +macro index Z "mu find --clearlinks --format=links --linksdir=~/.mu/results " "mu find" +macro index S "~/.mu/results" "mu find results" + +macro attach s $HOME "Save to default directory for attachments" + +# vim: ft=muttrc diff --git a/.mutt/muttrc b/.mutt/muttrc index 4c95203..82b861a 100644 --- a/.mutt/muttrc +++ b/.mutt/muttrc @@ -1,62 +1,62 @@ -set editor = "vim -c start" -set realname = "Jannik Zander" - -source ~/.mutt/accounts/gmail -#source ~/.mutt/muttgpg -source ~/.mutt/keybindings -#source ~/.mutt/colorscheme - -set mbox_type = Maildir -set mbox = "+[Gmail].All Mail" -set postponed = "+[Gmail].Drafts" -set mail_check = 0 - -# goobook -set sort_alias = alias -set reverse_alias = yes - -mailboxes +INBOX +UTHSCSA -alternative_order text/plain text/enriched text/html -auto_view text/html - -set print_command="muttdoc | pandoc --template=email.tex -V fullpage --latex-engine=xelatex --listings -o ~/email.pdf" - -ignore * -unignore from: subject to cc date x-mailer x-url user-agent -hdr_order date from to cc subject - -set header_cache = ~/.mutt/cache/headers -set message_cachedir = ~/.mutt/cache/bodies -set certificate_file = ~/.mutt/certificates -set mailcap_path = ~/.mutt/mailcap -set signature = ~/.mutt/signature - -set forward_edit = ask-yes -set forward_format = "Fwd: %s" -set include = yes -set mime_forward = yes -set mime_forward_rest = yes -set move = no -set print = yes -set quit = yes -set sig_dashes = no -set sort = 'threads' -set sort_aux = 'reverse-last-date-received' -set text_flowed = yes -set timeout = 1 - -set delete -set envelope_from -set fast_reply -set forward_quote -set reverse_name -set sig_on_top -set smart_wrap - -unset markers -unset wait_key -unset reply_self -unset confirmappend -unset move - -# vim: ft=muttrc +set editor = "vim -c start" +set realname = "Jannik Zander" + +source ~/.mutt/accounts/gmail +#source ~/.mutt/muttgpg +source ~/.mutt/keybindings +#source ~/.mutt/colorscheme + +set mbox_type = Maildir +set mbox = "+[Gmail].All Mail" +set postponed = "+[Gmail].Drafts" +set mail_check = 0 + +# goobook +set sort_alias = alias +set reverse_alias = yes + +mailboxes +INBOX +UTHSCSA +alternative_order text/plain text/enriched text/html +auto_view text/html + +set print_command="muttdoc | pandoc --template=email.tex -V fullpage --latex-engine=xelatex --listings -o ~/email.pdf" + +ignore * +unignore from: subject to cc date x-mailer x-url user-agent +hdr_order date from to cc subject + +set header_cache = ~/.mutt/cache/headers +set message_cachedir = ~/.mutt/cache/bodies +set certificate_file = ~/.mutt/certificates +set mailcap_path = ~/.mutt/mailcap +set signature = ~/.mutt/signature + +set forward_edit = ask-yes +set forward_format = "Fwd: %s" +set include = yes +set mime_forward = yes +set mime_forward_rest = yes +set move = no +set print = yes +set quit = yes +set sig_dashes = no +set sort = 'threads' +set sort_aux = 'reverse-last-date-received' +set text_flowed = yes +set timeout = 1 + +set delete +set envelope_from +set fast_reply +set forward_quote +set reverse_name +set sig_on_top +set smart_wrap + +unset markers +unset wait_key +unset reply_self +unset confirmappend +unset move + +# vim: ft=muttrc diff --git a/.mutt/signature b/.mutt/signature index 17ceed3..a4b8a61 100644 --- a/.mutt/signature +++ b/.mutt/signature @@ -1,5 +1,5 @@ - - -- Jannik Zander - - + + +- Jannik Zander + + diff --git a/.profile b/.profile index 0e04a8b..f82b46c 100644 --- a/.profile +++ b/.profile @@ -1,39 +1,39 @@ -# .profile is for things not specifically related to Bash, like environment variables PATH and others, and should be available anytime. - -# call shell specific settings -if [ ! "x${BASH_VERSION}" = "x" ]; then - [ -f ~/.bashrc ] && . ~/.bashrc -fi - -# set PATH to bin directory -export PATH=~/.local/bin:~/bin:$PATH - -# Set default programs -export SHELL='bash' -export EDITOR='vim' -export VISUAL='vim' -export PAGER='less' -export MANPAGER='less' - -# Prefer US language with SI units (Danish) -export LANG="en_DK.UTF-8" -export LANGUAGE="en_US.UTF-8" -export KEYMAP=us - -# Set XDG directories -if [ -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs ]; then - . ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs - export XDG_DESKTOP_DIR XDG_DOWNLOAD_DIR XDG_TEMPLATES_DIR XDG_PUBLICSHARE_DIR XDG_DOCUMENTS_DIR XDG_MUSIC_DIR XDG_PICTURES_DIR XDG_VIDEOS_DIR -fi - -# Enable syntax-highlighting in less. -if [[ -f /mingw64/bin/src-hilite-lesspipe.sh ]]; then - export LESSOPEN="| /mingw64/bin/src-hilite-lesspipe.sh %s" -elif [[ -f /usr/share/source-highlight/src-hilite-lesspipe.sh ]]; then - export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s" -fi -export LESS="-FiRSX --SILENT " - -# colored GCC warnings and errors -export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' - +# .profile is for things not specifically related to Bash, like environment variables PATH and others, and should be available anytime. + +# call shell specific settings +if [ ! "x${BASH_VERSION}" = "x" ]; then + [ -f ~/.bashrc ] && . ~/.bashrc +fi + +# set PATH to bin directory +export PATH=~/.local/bin:~/bin:$PATH + +# Set default programs +export SHELL='bash' +export EDITOR='vim' +export VISUAL='vim' +export PAGER='less' +export MANPAGER='less' + +# Prefer US language with SI units (Danish) +export LANG="en_DK.UTF-8" +export LANGUAGE="en_US.UTF-8" +export KEYMAP=us + +# Set XDG directories +if [ -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs ]; then + . ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs + export XDG_DESKTOP_DIR XDG_DOWNLOAD_DIR XDG_TEMPLATES_DIR XDG_PUBLICSHARE_DIR XDG_DOCUMENTS_DIR XDG_MUSIC_DIR XDG_PICTURES_DIR XDG_VIDEOS_DIR +fi + +# Enable syntax-highlighting in less. +if [[ -f /mingw64/bin/src-hilite-lesspipe.sh ]]; then + export LESSOPEN="| /mingw64/bin/src-hilite-lesspipe.sh %s" +elif [[ -f /usr/share/source-highlight/src-hilite-lesspipe.sh ]]; then + export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s" +fi +export LESS="-FiRSX --SILENT " + +# colored GCC warnings and errors +export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + diff --git a/.ssh/config b/.ssh/config index aa2d2f4..4dcc3d2 100644 --- a/.ssh/config +++ b/.ssh/config @@ -1,16 +1,16 @@ -# default for all - -# override as per host -Host jaza - HostName 192.168.1.100 - User jaz - IdentityFile ~/.ssh/jaza.key - -Host jaza.me - IdentityFile ~/.ssh/jaza.key - -Host bitbucket.grundfos.com - IdentityFile ~/.ssh/gf_rsa - - - +# default for all + +# override as per host +Host jaza + HostName 192.168.1.100 + User jaz + IdentityFile ~/.ssh/jaza.key + +Host jaza.me + IdentityFile ~/.ssh/jaza.key + +Host bitbucket.grundfos.com + IdentityFile ~/.ssh/gf_rsa + + + diff --git a/.tmux.conf b/.tmux.conf index ecbbbdc..4c56589 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -1,102 +1,102 @@ -# Setting the prefix from C-b to C-a -set -g prefix C-a -# Free the original Ctrl-b prefix keybinding -unbind C-b -#setting the delay between prefix and command -set -sg escape-time 1 -# Ensure that we can send Ctrl-A to other apps -bind C-a send-prefix -# Set the base index for windows to 1 instead of 0 -set -g base-index 1 -# Set the base index for panes to 1 instead of 0 -setw -g pane-base-index 1 - -# Set the default terminal mode to 256color mode -set -g default-terminal "screen-256color" -# enable activity alerts -setw -g monitor-activity on -set -g visual-activity on -# set the status line's colors -set -g status-fg white -set -g status-bg black -# set the color of the window list -setw -g window-status-fg cyan -setw -g window-status-bg default -setw -g window-status-attr dim -# set colors for the active window -setw -g window-status-current-fg white -setw -g window-status-current-bg red -setw -g window-status-current-attr bright -# pane colors -set -g pane-border-fg green -set -g pane-border-bg black -set -g pane-active-border-fg white -set -g pane-active-border-bg yellow -# Command / message line -set -g message-fg white -set -g message-bg black -set -g message-attr bright -# Status line left side -set -g status-left-length 40 -set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P" -set -g status-utf8 on -# Status line right side -# 15% | 28 Nov 18:15 -set -g status-right "#(~/battery Discharging) | #[fg=cyan]%d %b %R" -# Update the status bar every sixty seconds -set -g status-interval 60 -# Center the window list -set -g status-justify centre -set -g detach-on-destroy off -# Increase history-limit for scrolling (default is 2000) -set-option -g history-limit 15000 -# mouse support - set to on if you want to use the mouse -#setw -g mode-mouse on -#set -g mouse-select-pane on -#set -g mouse-resize-pane on -#set -g mouse-select-window on -#set -g mouse-utf8 on -# enable vi keys. -setw -g mode-keys vi -# Reload the file with Prefix r -bind r source-file ~/.tmux.conf \; display "Reloaded!" -# splitting panes -bind c neww -c "#{pane_current_path}" -bind | split-window -h -c "#{pane_current_path}" -bind - split-window -v -c "#{pane_current_path}" -# moving between panes -bind h select-pane -L -bind j select-pane -D -bind k select-pane -U -bind l select-pane -R -# Quick pane selection -bind -r C-h select-window -t :- -bind -r C-l select-window -t :+ -# Pane resizing -bind -r H resize-pane -L 5 -bind -r J resize-pane -D 5 -bind -r K resize-pane -U 5 -bind -r L resize-pane -R 5 -# Open panes in the same directory using the tmux-panes script -unbind v -unbind n -bind v send-keys " ~/tmux-panes -h" C-m -bind n send-keys " ~/tmux-panes -v" C-m -# Maximize and restore a pane -unbind Up -bind Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp -unbind Down -bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp -# Log output to a text file on demand -bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log" -# better binding for copy mode -bind v copy-mode -# Select/yank like vim -bind -t vi-copy 'v' begin-selection -bind -t vi-copy 'y' copy-selection -# open tree instead of session list -bind s run 'tmuxer choose-session' -bind-key -t vi-choice h tree-collapse -bind-key -t vi-choice l tree-expand -# local/private settings -source-file ~/.tmux_local.conf +# Setting the prefix from C-b to C-a +set -g prefix C-a +# Free the original Ctrl-b prefix keybinding +unbind C-b +#setting the delay between prefix and command +set -sg escape-time 1 +# Ensure that we can send Ctrl-A to other apps +bind C-a send-prefix +# Set the base index for windows to 1 instead of 0 +set -g base-index 1 +# Set the base index for panes to 1 instead of 0 +setw -g pane-base-index 1 + +# Set the default terminal mode to 256color mode +set -g default-terminal "screen-256color" +# enable activity alerts +setw -g monitor-activity on +set -g visual-activity on +# set the status line's colors +set -g status-fg white +set -g status-bg black +# set the color of the window list +setw -g window-status-fg cyan +setw -g window-status-bg default +setw -g window-status-attr dim +# set colors for the active window +setw -g window-status-current-fg white +setw -g window-status-current-bg red +setw -g window-status-current-attr bright +# pane colors +set -g pane-border-fg green +set -g pane-border-bg black +set -g pane-active-border-fg white +set -g pane-active-border-bg yellow +# Command / message line +set -g message-fg white +set -g message-bg black +set -g message-attr bright +# Status line left side +set -g status-left-length 40 +set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P" +set -g status-utf8 on +# Status line right side +# 15% | 28 Nov 18:15 +set -g status-right "#(~/battery Discharging) | #[fg=cyan]%d %b %R" +# Update the status bar every sixty seconds +set -g status-interval 60 +# Center the window list +set -g status-justify centre +set -g detach-on-destroy off +# Increase history-limit for scrolling (default is 2000) +set-option -g history-limit 15000 +# mouse support - set to on if you want to use the mouse +#setw -g mode-mouse on +#set -g mouse-select-pane on +#set -g mouse-resize-pane on +#set -g mouse-select-window on +#set -g mouse-utf8 on +# enable vi keys. +setw -g mode-keys vi +# Reload the file with Prefix r +bind r source-file ~/.tmux.conf \; display "Reloaded!" +# splitting panes +bind c neww -c "#{pane_current_path}" +bind | split-window -h -c "#{pane_current_path}" +bind - split-window -v -c "#{pane_current_path}" +# moving between panes +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R +# Quick pane selection +bind -r C-h select-window -t :- +bind -r C-l select-window -t :+ +# Pane resizing +bind -r H resize-pane -L 5 +bind -r J resize-pane -D 5 +bind -r K resize-pane -U 5 +bind -r L resize-pane -R 5 +# Open panes in the same directory using the tmux-panes script +unbind v +unbind n +bind v send-keys " ~/tmux-panes -h" C-m +bind n send-keys " ~/tmux-panes -v" C-m +# Maximize and restore a pane +unbind Up +bind Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp +unbind Down +bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp +# Log output to a text file on demand +bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log" +# better binding for copy mode +bind v copy-mode +# Select/yank like vim +bind -t vi-copy 'v' begin-selection +bind -t vi-copy 'y' copy-selection +# open tree instead of session list +bind s run 'tmuxer choose-session' +bind-key -t vi-choice h tree-collapse +bind-key -t vi-choice l tree-expand +# local/private settings +source-file ~/.tmux_local.conf diff --git a/README.md b/README.md index a253f26..4896219 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -# dotfiles - -1) First download 'dit-init.sh' - -> $ git archive --remote=git@jaza.me:jaz/dit.git master bin/dit-init.sh | tar -x --strip-components 1 - -2) Next execute it - -> $ ./dit-init.sh - -3) Now you can manage dotfiles with 'dit' (same as 'git') - -> $ dit +# dotfiles + +1) First download 'dit-init.sh' + +> $ git archive --remote=git@jaza.me:jaz/dit.git master bin/dit-init.sh | tar -x --strip-components 1 + +2) Next execute it + +> $ ./dit-init.sh + +3) Now you can manage dotfiles with 'dit' (same as 'git') + +> $ dit diff --git a/bin/build-akmod.sh b/bin/build-akmod.sh index c451db7..ddcec7d 100755 --- a/bin/build-akmod.sh +++ b/bin/build-akmod.sh @@ -1,5 +1,5 @@ -#!/bin/sh - -sudo dnf install kernel-$1 -sudo dnf install akmod-wl "kernel-devel-uname-r == $(uname -r)" -sudo akmods +#!/bin/sh + +sudo dnf install kernel-$1 +sudo dnf install akmod-wl "kernel-devel-uname-r == $(uname -r)" +sudo akmods diff --git a/bin/build-luajit.sh b/bin/build-luajit.sh index 2989278..5d635d9 100755 --- a/bin/build-luajit.sh +++ b/bin/build-luajit.sh @@ -1,3 +1,3 @@ -#!/bin/sh -make PREFIX=$PREFIX MULTILIB=lib -make install PREFIX=$PREFIX/apps/luajit MULTILIB=lib +#!/bin/sh +make PREFIX=$PREFIX MULTILIB=lib +make install PREFIX=$PREFIX/apps/luajit MULTILIB=lib diff --git a/bin/build-vim.sh b/bin/build-vim.sh index b0938cc..09274d0 100755 --- a/bin/build-vim.sh +++ b/bin/build-vim.sh @@ -1,18 +1,18 @@ -#!/bin/sh - -./configure \ ---prefix=$PREFIX \ ---with-features=huge \ ---with-compiledby="ejannza" \ ---enable-multibyte \ ---enable-gui=gtk2 \ ---enable-luainterp \ ---with-lua-prefix=$PREFIX --with-luajit \ ---enable-gpm \ ---enable-cscope \ ---enable-fontset \ ---enable-fail-if-missing - - -make -make install prefix=$PREFIX/apps/vim +#!/bin/sh + +./configure \ +--prefix=$PREFIX \ +--with-features=huge \ +--with-compiledby="ejannza" \ +--enable-multibyte \ +--enable-gui=gtk2 \ +--enable-luainterp \ +--with-lua-prefix=$PREFIX --with-luajit \ +--enable-gpm \ +--enable-cscope \ +--enable-fontset \ +--enable-fail-if-missing + + +make +make install prefix=$PREFIX/apps/vim diff --git a/bin/caps-hjkl-or-esc.ahk b/bin/caps-hjkl-or-esc.ahk index 407dfd1..550eba3 100644 --- a/bin/caps-hjkl-or-esc.ahk +++ b/bin/caps-hjkl-or-esc.ahk @@ -1,31 +1,31 @@ -#NoEnv -SendMode Input - -; Disable default CapsLock functionality -SetCapsLockState, AlwaysOff - -; Post Esc if pressed alone -CapsLock:: - - ; If you want to override CapsLock functionality for specific windows, etc. - ; Just define an OverrideCapsLock() function where you #include this script! - OverrideFunction := "OverrideCapsLock" - - ; Call the function dynamically to allow for silent failure. - if (Overridden := %OverrideFunction%()) { - Send {%Overridden%} - return - } - - KeyWait, CapsLock - if (A_PriorKey="CapsLock") - Send {Esc} -return - -; Map CapsLock modified hjkl movement -#If, GetKeyState("CapsLock", "P") -h::Left -j::Down -k::Up -l::Right -#If +#NoEnv +SendMode Input + +; Disable default CapsLock functionality +SetCapsLockState, AlwaysOff + +; Post Esc if pressed alone +CapsLock:: + + ; If you want to override CapsLock functionality for specific windows, etc. + ; Just define an OverrideCapsLock() function where you #include this script! + OverrideFunction := "OverrideCapsLock" + + ; Call the function dynamically to allow for silent failure. + if (Overridden := %OverrideFunction%()) { + Send {%Overridden%} + return + } + + KeyWait, CapsLock + if (A_PriorKey="CapsLock") + Send {Esc} +return + +; Map CapsLock modified hjkl movement +#If, GetKeyState("CapsLock", "P") +h::Left +j::Down +k::Up +l::Right +#If diff --git a/bin/edit_with_vim.bat b/bin/edit_with_vim.bat index d4b7586..e29534a 100644 --- a/bin/edit_with_vim.bat +++ b/bin/edit_with_vim.bat @@ -1,10 +1,10 @@ -@echo off -SET vim_path = %USERPROFILE%\apps\vim\vim73\gvim.exe -> edit_with_vim.reg ECHO REGEDIT4 ->> edit_with_vim.reg ECHO [HKEY_CLASSES_ROOT\*\shell\vim] ->> edit_with_vim.reg ECHO @="Edit with &Vim" ->> edit_with_vim.reg ECHO [HKEY_CLASSES_ROOT\*\shell\vim\command] -SET v_test=%USERPROFILE%\apps\vim\vim73\gvim.exe -Set v_replacement=\\ -SET v_result=%v_test:\=\\% +@echo off +SET vim_path = %USERPROFILE%\apps\vim\vim73\gvim.exe +> edit_with_vim.reg ECHO REGEDIT4 +>> edit_with_vim.reg ECHO [HKEY_CLASSES_ROOT\*\shell\vim] +>> edit_with_vim.reg ECHO @="Edit with &Vim" +>> edit_with_vim.reg ECHO [HKEY_CLASSES_ROOT\*\shell\vim\command] +SET v_test=%USERPROFILE%\apps\vim\vim73\gvim.exe +Set v_replacement=\\ +SET v_result=%v_test:\=\\% >> edit_with_vim.reg ECHO @="%v_result% \"%%1\"" \ No newline at end of file diff --git a/bin/git-diffall.sh b/bin/git-diffall.sh index 25fdda9..2ae11ea 100755 --- a/bin/git-diffall.sh +++ b/bin/git-diffall.sh @@ -1,277 +1,277 @@ -#!/bin/sh -# Copyright 2010 - 2012, Tim Henigan -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -# Perform a directory diff between commits in the repository using -# the external diff or merge tool specified in the user's config. - -USAGE='[--cached] [--copy-back] [-x|--extcmd=] {0,2} [-- *] - - --cached Compare to the index rather than the working tree. - - --copy-back Copy files back to the working tree when the diff - tool exits (in case they were modified by the - user). This option is only valid if the diff - compared with the working tree. - - -x= - --extcmd= Specify a custom command for viewing diffs. - git-diffall ignores the configured defaults and - runs $command $LOCAL $REMOTE when this option is - specified. Additionally, $BASE is set in the - environment. -' - -SUBDIRECTORY_OK=1 -. "$(git --exec-path)/git-sh-setup" - -TOOL_MODE=diff -. "$(git --exec-path)/git-mergetool--lib" - -merge_tool="$(get_merge_tool)" -if test -z "$merge_tool" -then - echo "Error: Either the 'diff.tool' or 'merge.tool' option must be set." - usage -fi - -start_dir=$(pwd) - -# All the file paths returned by the diff command are relative to the root -# of the working copy. So if the script is called from a subdirectory, it -# must switch to the root of working copy before trying to use those paths. -cdup=$(git rev-parse --show-cdup) && -cd "$cdup" || { - echo >&2 "Cannot chdir to $cdup, the toplevel of the working tree" - exit 1 -} - -# set up temp dir -tmp=$(perl -e 'use File::Temp qw(tempdir); - $t=tempdir("/tmp/git-diffall.XXXXX") or exit(1); - print $t') || exit 1 -#trap 'rm -rf "$tmp"' EXIT - -left= -right= -paths= -dashdash_seen= -compare_staged= -merge_base= -left_dir= -right_dir= -diff_tool= -copy_back= - -while test $# != 0 -do - case "$1" in - -h|--h|--he|--hel|--help) - usage - ;; - --cached) - compare_staged=1 - ;; - --copy-back) - copy_back=1 - ;; - -x|--e|--ex|--ext|--extc|--extcm|--extcmd) - if test $# = 1 - then - echo You must specify the tool for use with --extcmd - usage - else - diff_tool=$2 - shift - fi - ;; - --) - dashdash_seen=1 - ;; - -*) - echo Invalid option: "$1" - usage - ;; - *) - # could be commit, commit range or path limiter - case "$1" in - *...*) - left=${1%...*} - right=${1#*...} - merge_base=1 - ;; - *..*) - left=${1%..*} - right=${1#*..} - ;; - *) - if test -n "$dashdash_seen" - then - paths="$paths$1 " - elif test -z "$left" - then - left=$1 - elif test -z "$right" - then - right=$1 - else - paths="$paths$1 " - fi - ;; - esac - ;; - esac - shift -done - -# Determine the set of files which changed -if test -n "$left" && test -n "$right" -then - left_dir="cmt-$(git rev-parse --short $left)" - right_dir="cmt-$(git rev-parse --short $right)" - - if test -n "$compare_staged" - then - usage - elif test -n "$merge_base" - then - git diff --name-only "$left"..."$right" -- $paths >"$tmp/filelist" - else - git diff --name-only "$left" "$right" -- $paths >"$tmp/filelist" - fi -elif test -n "$left" -then - left_dir="cmt-$(git rev-parse --short $left)" - - if test -n "$compare_staged" - then - right_dir="staged" - git diff --name-only --cached "$left" -- $paths >"$tmp/filelist" - else - right_dir="working_tree" - git diff --name-only "$left" -- $paths >"$tmp/filelist" - fi -else - left_dir="HEAD" - - if test -n "$compare_staged" - then - right_dir="staged" - git diff --name-only --cached -- $paths >"$tmp/filelist" - else - right_dir="working_tree" - git diff --name-only -- $paths >"$tmp/filelist" - fi -fi - -# Exit immediately if there are no diffs -if test ! -s "$tmp/filelist" -then - exit 0 -fi - -if test -n "$copy_back" && test "$right_dir" != "working_tree" -then - echo "--copy-back is only valid when diff includes the working tree." - exit 1 -fi - -# Create the named tmp directories that will hold the files to be compared -mkdir -p "$tmp/$left_dir" "$tmp/$right_dir" - -# Populate the tmp/right_dir directory with the files to be compared -while read name -do - if test -n "$right" - then - ls_list=$(git ls-tree $right "$name") - if test -n "$ls_list" - then - mkdir -p "$tmp/$right_dir/$(dirname "$name")" - git show "$right":"$name" >"$tmp/$right_dir/$name" || true - fi - elif test -n "$compare_staged" - then - ls_list=$(git ls-files -- "$name") - if test -n "$ls_list" - then - mkdir -p "$tmp/$right_dir/$(dirname "$name")" - git show :"$name" >"$tmp/$right_dir/$name" - fi - else - if test -e "$name" - then - mkdir -p "$tmp/$right_dir/$(dirname "$name")" - cp "$name" "$tmp/$right_dir/$name" - fi - fi -done < "$tmp/filelist" - -# Populate the tmp/left_dir directory with the files to be compared -while read name -do - if test -n "$left" - then - ls_list=$(git ls-tree $left "$name") - if test -n "$ls_list" - then - mkdir -p "$tmp/$left_dir/$(dirname "$name")" - git show "$left":"$name" >"$tmp/$left_dir/$name" || true - fi - else - if test -n "$compare_staged" - then - ls_list=$(git ls-tree HEAD "$name") - if test -n "$ls_list" - then - mkdir -p "$tmp/$left_dir/$(dirname "$name")" - git show HEAD:"$name" >"$tmp/$left_dir/$name" - fi - else - mkdir -p "$tmp/$left_dir/$(dirname "$name")" - git show :"$name" >"$tmp/$left_dir/$name" - fi - fi -done < "$tmp/filelist" - -LOCAL="$tmp/$left_dir" -REMOTE="$tmp/$right_dir" - -if test -n "$diff_tool" -then - export BASE - eval $diff_tool '"$LOCAL"' '"$REMOTE"' -else - run_merge_tool "$merge_tool" false -fi - -# Copy files back to the working dir, if requested -if test -n "$copy_back" && test "$right_dir" = "working_tree" -then - cd "$start_dir" - git_top_dir=$(git rev-parse --show-toplevel) - find "$tmp/$right_dir" -type f | - while read file - do - cp "$file" "$git_top_dir/${file#$tmp/$right_dir/}" - done +#!/bin/sh +# Copyright 2010 - 2012, Tim Henigan +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +# Perform a directory diff between commits in the repository using +# the external diff or merge tool specified in the user's config. + +USAGE='[--cached] [--copy-back] [-x|--extcmd=] {0,2} [-- *] + + --cached Compare to the index rather than the working tree. + + --copy-back Copy files back to the working tree when the diff + tool exits (in case they were modified by the + user). This option is only valid if the diff + compared with the working tree. + + -x= + --extcmd= Specify a custom command for viewing diffs. + git-diffall ignores the configured defaults and + runs $command $LOCAL $REMOTE when this option is + specified. Additionally, $BASE is set in the + environment. +' + +SUBDIRECTORY_OK=1 +. "$(git --exec-path)/git-sh-setup" + +TOOL_MODE=diff +. "$(git --exec-path)/git-mergetool--lib" + +merge_tool="$(get_merge_tool)" +if test -z "$merge_tool" +then + echo "Error: Either the 'diff.tool' or 'merge.tool' option must be set." + usage +fi + +start_dir=$(pwd) + +# All the file paths returned by the diff command are relative to the root +# of the working copy. So if the script is called from a subdirectory, it +# must switch to the root of working copy before trying to use those paths. +cdup=$(git rev-parse --show-cdup) && +cd "$cdup" || { + echo >&2 "Cannot chdir to $cdup, the toplevel of the working tree" + exit 1 +} + +# set up temp dir +tmp=$(perl -e 'use File::Temp qw(tempdir); + $t=tempdir("/tmp/git-diffall.XXXXX") or exit(1); + print $t') || exit 1 +#trap 'rm -rf "$tmp"' EXIT + +left= +right= +paths= +dashdash_seen= +compare_staged= +merge_base= +left_dir= +right_dir= +diff_tool= +copy_back= + +while test $# != 0 +do + case "$1" in + -h|--h|--he|--hel|--help) + usage + ;; + --cached) + compare_staged=1 + ;; + --copy-back) + copy_back=1 + ;; + -x|--e|--ex|--ext|--extc|--extcm|--extcmd) + if test $# = 1 + then + echo You must specify the tool for use with --extcmd + usage + else + diff_tool=$2 + shift + fi + ;; + --) + dashdash_seen=1 + ;; + -*) + echo Invalid option: "$1" + usage + ;; + *) + # could be commit, commit range or path limiter + case "$1" in + *...*) + left=${1%...*} + right=${1#*...} + merge_base=1 + ;; + *..*) + left=${1%..*} + right=${1#*..} + ;; + *) + if test -n "$dashdash_seen" + then + paths="$paths$1 " + elif test -z "$left" + then + left=$1 + elif test -z "$right" + then + right=$1 + else + paths="$paths$1 " + fi + ;; + esac + ;; + esac + shift +done + +# Determine the set of files which changed +if test -n "$left" && test -n "$right" +then + left_dir="cmt-$(git rev-parse --short $left)" + right_dir="cmt-$(git rev-parse --short $right)" + + if test -n "$compare_staged" + then + usage + elif test -n "$merge_base" + then + git diff --name-only "$left"..."$right" -- $paths >"$tmp/filelist" + else + git diff --name-only "$left" "$right" -- $paths >"$tmp/filelist" + fi +elif test -n "$left" +then + left_dir="cmt-$(git rev-parse --short $left)" + + if test -n "$compare_staged" + then + right_dir="staged" + git diff --name-only --cached "$left" -- $paths >"$tmp/filelist" + else + right_dir="working_tree" + git diff --name-only "$left" -- $paths >"$tmp/filelist" + fi +else + left_dir="HEAD" + + if test -n "$compare_staged" + then + right_dir="staged" + git diff --name-only --cached -- $paths >"$tmp/filelist" + else + right_dir="working_tree" + git diff --name-only -- $paths >"$tmp/filelist" + fi +fi + +# Exit immediately if there are no diffs +if test ! -s "$tmp/filelist" +then + exit 0 +fi + +if test -n "$copy_back" && test "$right_dir" != "working_tree" +then + echo "--copy-back is only valid when diff includes the working tree." + exit 1 +fi + +# Create the named tmp directories that will hold the files to be compared +mkdir -p "$tmp/$left_dir" "$tmp/$right_dir" + +# Populate the tmp/right_dir directory with the files to be compared +while read name +do + if test -n "$right" + then + ls_list=$(git ls-tree $right "$name") + if test -n "$ls_list" + then + mkdir -p "$tmp/$right_dir/$(dirname "$name")" + git show "$right":"$name" >"$tmp/$right_dir/$name" || true + fi + elif test -n "$compare_staged" + then + ls_list=$(git ls-files -- "$name") + if test -n "$ls_list" + then + mkdir -p "$tmp/$right_dir/$(dirname "$name")" + git show :"$name" >"$tmp/$right_dir/$name" + fi + else + if test -e "$name" + then + mkdir -p "$tmp/$right_dir/$(dirname "$name")" + cp "$name" "$tmp/$right_dir/$name" + fi + fi +done < "$tmp/filelist" + +# Populate the tmp/left_dir directory with the files to be compared +while read name +do + if test -n "$left" + then + ls_list=$(git ls-tree $left "$name") + if test -n "$ls_list" + then + mkdir -p "$tmp/$left_dir/$(dirname "$name")" + git show "$left":"$name" >"$tmp/$left_dir/$name" || true + fi + else + if test -n "$compare_staged" + then + ls_list=$(git ls-tree HEAD "$name") + if test -n "$ls_list" + then + mkdir -p "$tmp/$left_dir/$(dirname "$name")" + git show HEAD:"$name" >"$tmp/$left_dir/$name" + fi + else + mkdir -p "$tmp/$left_dir/$(dirname "$name")" + git show :"$name" >"$tmp/$left_dir/$name" + fi + fi +done < "$tmp/filelist" + +LOCAL="$tmp/$left_dir" +REMOTE="$tmp/$right_dir" + +if test -n "$diff_tool" +then + export BASE + eval $diff_tool '"$LOCAL"' '"$REMOTE"' +else + run_merge_tool "$merge_tool" false +fi + +# Copy files back to the working dir, if requested +if test -n "$copy_back" && test "$right_dir" = "working_tree" +then + cd "$start_dir" + git_top_dir=$(git rev-parse --show-toplevel) + find "$tmp/$right_dir" -type f | + while read file + do + cp "$file" "$git_top_dir/${file#$tmp/$right_dir/}" + done fi \ No newline at end of file diff --git a/bin/githome-clone.sh b/bin/githome-clone.sh index 6524bf1..a3865cb 100644 --- a/bin/githome-clone.sh +++ b/bin/githome-clone.sh @@ -1,17 +1,17 @@ -#!/usr/bin/env bash - -git init --bare $HOME/.githome - -# Define githome function -function githome() -{ - git --git-dir=$HOME/.githome --work-tree=$HOME "$@" -} - -# Initial setup -githome config --local status.showUntrackedFiles no -githome remote add origin git@jaza.me:jaz/dotfiles.git -githome fetch -githome reset --hard origin/master -githome branch -u origin/master - +#!/usr/bin/env bash + +git init --bare $HOME/.githome + +# Define githome function +function githome() +{ + git --git-dir=$HOME/.githome --work-tree=$HOME "$@" +} + +# Initial setup +githome config --local status.showUntrackedFiles no +githome remote add origin git@jaza.me:jaz/dotfiles.git +githome fetch +githome reset --hard origin/master +githome branch -u origin/master + -- 2.43.0