Update dotfiles

This commit is contained in:
2018-08-10 17:23:37 +02:00
parent 8783616f54
commit d51aa282db
7 changed files with 273 additions and 12 deletions

View File

@@ -15,6 +15,7 @@
fe = "fetch --all --prune" fe = "fetch --all --prune"
co = "checkout" co = "checkout"
cm = "commit --message"
ci = "commit" ci = "commit"
st = "status" st = "status"
br = "branch" br = "branch"
@@ -24,6 +25,7 @@
rba = "rebase --abort" rba = "rebase --abort"
df = "diff" df = "diff"
gr = "! git graph" gr = "! git graph"
ap = "add --patch"
k = "!gitk --all" k = "!gitk --all"
@@ -66,7 +68,7 @@
detachedHead = false detachedHead = false
[commit] [commit]
gpgSign = true gpgSign = true
; cleanup = default cleanup = strip
status = true status = true
[status] [status]
relativePaths = false relativePaths = false

View File

@@ -1,5 +1,3 @@
# vim:set foldmethod=indent:
# vim:set foldignore=:
# This file has been auto-generated by i3-config-wizard(1). # This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like. # It will not be overwritten, so edit it as you like.
# #
@@ -196,13 +194,20 @@ assign [class="^Keepassx$"] $workspace8
bindsym $mod+Shift+Return exec $calc bindsym $mod+Shift+Return exec $calc
bindsym F1 exec --no-startup-id ~/.i3/scripts/shutdown-menu bindsym F1 exec --no-startup-id ~/.i3/scripts/shutdown-menu
bindsym F2 exec --no-startup-id ~/.i3/scripts/screenmenu
bindsym $mod+F1 exec --no-startup-id ~/.i3/scripts/i3exit lock bindsym $mod+F1 exec --no-startup-id ~/.i3/scripts/i3exit lock
bindsym $mod+F2 exec --no-startup-id screencfg ~/.screencfg/all.yml ; exec --no-startup-id ~/.autostart/30_keyboard.sh
bindsym $mod+F3 exec --no-startup-id screencfg ~/.screencfg/laptop.yml ; exec --no-startup-id ~/.autostart/30_keyboard.sh
bindsym $mod+F4 exec --no-startup-id ~/.i3/scripts/i3exit suspend
bindsym $mod+Home exec --no-startup-id ~/.i3/scripts/shutdown-menu bindsym $mod+Home exec --no-startup-id ~/.i3/scripts/shutdown-menu
bindsym $mod+Shift+v exec --no-startup-id redshift-toggle bindsym $mod+Shift+v exec --no-startup-id redshift-toggle
bindsync $mod+Shift+$scratchpad move scratchpad bindsym $mod+Shift+$scratchpad move scratchpad
bindsync $mod+$scratchpad scratchpad show bindsym $mod+$scratchpad scratchpad show
# bindsym $mod+$swap workspace $workspace1; move container to workspace $workspace10; workspace $workspace10; move container to workspace $workspace1; workspace $workspace1;
################################################################################ ################################################################################
### MODES ###################################################################### ### MODES ######################################################################

View File

@@ -23,15 +23,18 @@ order += volume_status
order += spotify order += spotify
order += "wifi" order += "wifi"
order += online_status order += online_status
order += "battery_level 0" order += "battery_level all"
order += "clock" order += "clock"
battery_level 0 { battery_level all {
format = " {icon} {percent}% " battery_id = "all"
format = " {icon} {percent}% {time_remaining} "
measurement_mode = "sys"
charging_character = "" charging_character = ""
blocks = "" blocks = ""
notification = true notification = true
hide_when_full = false hide_when_full = false
hide_seconds = true
notify_low_level = true notify_low_level = true
threshold_full = 95 threshold_full = 95
} }

View File

@@ -26,6 +26,9 @@ packages:
sudo: sudo:
fedora: ["sudo"] fedora: ["sudo"]
ubuntu: ["sudo"] ubuntu: ["sudo"]
apt:
fedora: []
ubuntu: ["apt-file"]
xorg: xorg:
fedora: fedora:
- '@base-x' - '@base-x'
@@ -56,7 +59,7 @@ packages:
ubuntu: ["fonts-inconsolata"] ubuntu: ["fonts-inconsolata"]
taskwarrior: taskwarrior:
fedora: ["task", "tasksh"] fedora: ["task", "tasksh"]
ubuntu: ["task"] ubuntu: ["taskwarrior"]
git: git:
fedora: ["git", "gitk"] fedora: ["git", "gitk"]
ubuntu: ["git", "git-extras", "gitk"] ubuntu: ["git", "git-extras", "gitk"]
@@ -101,7 +104,7 @@ packages:
ubuntu: ["pinta"] ubuntu: ["pinta"]
py3status: py3status:
fedora: ["py3status", "python3-pytz", "python3-tzlocal"] fedora: ["py3status", "python3-pytz", "python3-tzlocal"]
ubuntu: ["python3-arrow", "python3-tzlocal"] ubuntu: ["py3status", "python3-arrow", "python3-tzlocal"]
pass: pass:
fedora: ["pass"] fedora: ["pass"]
ubuntu: ["pass"] ubuntu: ["pass"]
@@ -173,55 +176,82 @@ packages:
ubuntu: ["shutter"] ubuntu: ["shutter"]
nmap: nmap:
fedora: ["nmap"] fedora: ["nmap"]
ubuntu: ["nmap"]
openvpn: openvpn:
fedora: ["openvpn"] fedora: ["openvpn"]
ubuntu: ["openvpn"]
curl: curl:
fedora: ["curl"] fedora: ["curl"]
ubuntu: ["curl"]
wget: wget:
fedora: ["wget"] fedora: ["wget"]
ubuntu: ["wget"]
tree: tree:
fedora: ["tree"] fedora: ["tree"]
ubuntu: ["tree"]
which: which:
fedora: ["which"] fedora: ["which"]
ubuntu: []
zip: zip:
fedora: ["zip"] fedora: ["zip"]
ubuntu: ["zip", "unzip"]
traceroute: traceroute:
fedora: ["traceroute"] fedora: ["traceroute"]
ubuntu: ["traceroute"]
tcpdump: tcpdump:
fedora: ["tcpdump"] fedora: ["tcpdump"]
ubuntu: ["tcpdump"]
tar: tar:
fedora: ["tar"] fedora: ["tar"]
ubuntu: ["tar"]
rsync: rsync:
fedora: ["rsync"] fedora: ["rsync"]
ubuntu: ["rsync"]
nmap: nmap:
fedora: ["nmap"] fedora: ["nmap"]
ubuntu: ["nmap"]
net-tools: net-tools:
fedora: ["net-tools"] fedora: ["net-tools"]
ubuntu: ["net-tools"]
ntfs: ntfs:
fedora: ["ntfs-3g", "ntfsprogs"] fedora: ["ntfs-3g", "ntfsprogs"]
ubuntu: ["ntfs-3g"]
lsof: lsof:
fedora: ["lsof"] fedora: ["lsof"]
ubuntu: ["lsof"]
iptables: iptables:
fedora: ["iptables"] fedora: ["iptables"]
ubuntu: ["iptables"]
gpg: gpg:
fedora: ["gnupg2"] fedora: ["gnupg2"]
ubuntu: ["gnupg2"]
networkmanager: networkmanager:
fedora: ["NetworkManager", "NetworkManager-wifi"] fedora: ["NetworkManager", "NetworkManager-wifi"]
ubuntu: ["network-manager", "network-manager-openvpn", "network-manager-openconnect"]
pulseaudio: pulseaudio:
fedora: ["pulseaudio", "pulseaudio-utils"] fedora: ["pulseaudio", "pulseaudio-utils"]
ubuntu: ["pulseaudio", "pulseaudio-utils"]
iw: iw:
fedora: ["iw"] fedora: ["iw"]
ubuntu: ["iw"]
cowsay: cowsay:
fedora: ["cowsay"] fedora: ["cowsay"]
ubuntu: ["cowsay"]
ruby: ruby:
fedora: ["ruby", "ruby-devel", "rubygem-bundler"] fedora: ["ruby", "ruby-devel", "rubygem-bundler"]
ubuntu: ["ruby", "ruby-dev", "ruby-bundler"]
lxc: lxc:
fedora: ["lxc"] fedora: ["lxc"]
ubuntu: ["lxc"]
acpi: acpi:
fedora: ["acpi"] fedora: ["acpi"]
ubuntu: ["acpid"]
npm: npm:
fedora: ["npm"] fedora: ["npm"]
ubuntu: ["npm"]
xdg: xdg:
fedora: ["xdg-utils"] fedora: ["xdg-utils"]
ubuntu: ["xdg-utils"]
docs: docs:
fedora: ["man-pages"] fedora: ["man-pages"]
ubuntu: ["manpages"]

View File

@@ -51,6 +51,7 @@ Plug 'ElmCast/elm-vim'
Plug 'avh4/elm-format' Plug 'avh4/elm-format'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'hashivim/vim-terraform'
call plug#end() call plug#end()
filetype plugin indent on filetype plugin indent on
@@ -280,3 +281,5 @@ set completeopt-=preview
let g:ycm_add_preview_to_completeopt = 0 let g:ycm_add_preview_to_completeopt = 0
let g:instant_markdown_autostart = 0 let g:instant_markdown_autostart = 0
let g:terraform_align = 1

View File

@@ -5,7 +5,7 @@ URxvt.scrollBar: false
URxvt.font: xft:Inconsolata:size=10 URxvt.font: xft:Inconsolata:size=10
URxvt.letterSpace: -1 URxvt.letterSpace: -1
URxvt.perl-ext-common: default,matcher,selection-to-clipboard URxvt.perl-ext: default,matcher,selection-to-clipboard,font-size,resize-font
URxvt.url-launcher: /usr/bin/xdg-open URxvt.url-launcher: /usr/bin/xdg-open
URxvt.matcher.button: 1 URxvt.matcher.button: 1
URxvt.saveLines: 10000 URxvt.saveLines: 10000
@@ -21,6 +21,14 @@ URxvt.secondaryScreen: 1
URxvt.secondaryScroll: 0 URxvt.secondaryScroll: 0
URxvt.secondaryWheel: 1 URxvt.secondaryWheel: 1
URxvt.keysym.C-Up: font-size:increase
URxvt.keysym.C-Down: font-size:decrease
URxvt.keysym.C-S-Up: font-size:incglobal
URxvt.keysym.C-S-Down: font-size:decglobal
URxvt.keysym.C-equal: font-size:reset
URxvt.keysym.C-slash: font-size:show
URxvt.fading: 15 URxvt.fading: 15
! special ! special

View File

@@ -8,7 +8,6 @@ alias tml="tmux list-sessions"
alias tma="tmux ls 2>/dev/null && tmux attach-session || tmux" alias tma="tmux ls 2>/dev/null && tmux attach-session || tmux"
alias tmn="tmux new-session -A -s" alias tmn="tmux new-session -A -s"
alias clip="xclip -selection clipboard"
alias clipc="xclip -selection primary" alias clipc="xclip -selection primary"
alias clipo="xclip -out -selection clipboard" alias clipo="xclip -out -selection clipboard"
@@ -73,3 +72,214 @@ alias gpush='git push origin $(currentbranch)'
alias pass=mypass alias pass=mypass
alias issh="ssh -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null" alias issh="ssh -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null"
alias gfix='git commit --amend --no-edit'
alias gfixa='git commit --amend --no-edit --all '
alias gfixp='git commit --amend --no-edit --patch'
alias issh="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
alias newpw="pwgen --secure 25 1"
gitmaster() {
git stash push -m gitmaster-$(date -uIseconds) -u || return 1
_branch=$(git rev-parse --abbrev-ref HEAD)
git fe || return 1
git checkout master || return 1
git merge origin/master || return 1
git checkout $_branch
git stash pop
}
_remote() {
[[ -n "$SSH_CONNECTION" ]]
}
cd() {
builtin cd "$@" && ls
}
mount() {
if [[ $# == 0 ]] ; then
command mount | column -t
else
command mount "$@"
fi
}
extr()
{
if [[ -f "$1" ]] ; then
case "$1" in
*.tar.bz2 ) tar xvjf "$1" ;;
*.tar.gz ) tar xvzf "$1" ;;
*.tar.xz ) tar xvJf "$1" ;;
*.bz2 ) bunzip2 "$1" ;;
*.rar ) unrar x "$1" ;;
*.gz ) gunzip "$1" ;;
*.tar ) tar xvf "$1" ;;
*.tbz2 ) tar xvjf "$1" ;;
*.tgz ) tar xvzf "$1" ;;
*.zip ) unzip "$1" ;;
*.Z ) uncompress "$1" ;;
*.7z ) 7z x "$1" ;;
*)
echo "$1 cannot be extracted via $0"
;;
esac
else
echo "$1 is not a valid file"
fi
}
ruler() {
for s in '....^....|' '1234567890'; do
w=${#s}
str=$(for (( i=1; $i<=$(( ($COLUMNS + $w) / $w )) ; i=$i+1 )); do echo -n $s; done )
str=$(echo $str | cut -c -$COLUMNS)
echo $str
done
}
addext() {
[[ -z "$1" ]] || [[ -z "$2" ]] && { echo "Usage: $0 <file> <extension>" ; return }
mv "$1" "$1$2"
}
rmext() {
[[ -e "$1" ]] && mv -i "$1" "${1%.*}"
}
ckwww() {
ping -c 3 www.google.com
}
httpcode() {
curl http://httpcode.info/$1
}
bak() {
if ! [[ "$1" ]] ; then
printf '%s\n' "usage: $0 FILE"
return 1
fi
if ! [[ -e "$1" ]] ; then
printf '%s\n' "\"$1\" not found"
return 1
fi
name="$1.$(date +%Y%m%d%H%M%S.bak)"
if [[ -e "${name}" ]] ; then
printf '%s\n' "Backup file \"$name\" already exists"
return 1
fi
cp --archive --verbose --no-clobber "$1" "${name}"
}
fstab() {
# yeah
expand /etc/fstab | grep -v '^#' | grep -P '^.+$' | tr -s ' ' | tr ' ' '|' | cat <(grep -P '<.+>' /etc/fstab | cut -f 2- -d ' ' | sed 's/>[^<]*</>|</g') - | column -ts '|'
}
serve() {
python3 -m http.server 8800
}
manpdf() {
[[ -z "$1" ]] && { printf '%s' >&2 "$(man)" ; return ; }
man -t "$1" | ps2pdf - - | zathura -
}
myip4() {
curl "http://ipv4.icanhazip.com"
}
myip6() {
curl "http://ipv6.icanhazip.com" 2>/dev/null || echo "no ip6"
}
diffdir() {
[[ "$1" ]] && [[ "$2" ]] || { echo "$0 <dir1> <dir2>" ; return 1 ; }
diff <(cd "$1" && find -type f -exec md5sum {} \;) <(cd "$2" && find -type f -exec md5sum {} \;)
}
diffdir2() {
[[ "$1" ]] && [[ "$2" ]] || { echo "$0 <dir1> <dir2>" ; return 1 ; }
comm -13 <(cd "$1" && find -type f | sort -g) <(cd "$2" && find -type f | sort -g)
}
bm() {
case "$1" in
dev)
cd "$HOME/development/projects"
;;
dot)
cd "$HOME/dotfiles"
;;
*)
echo "unknown target"
;;
esac
}
man() {
env LESS_TERMCAP_mb=$'\E[01;31m' \
LESS_TERMCAP_md=$'\E[01;38;5;74m' \
LESS_TERMCAP_me=$'\E[0m' \
LESS_TERMCAP_se=$'\E[0m' \
LESS_TERMCAP_so=$'\E[38;5;246m' \
LESS_TERMCAP_ue=$'\E[0m' \
LESS_TERMCAP_us=$'\E[04;38;5;146m' \
man "$@"
}
embiggen() {
enscript --no-header --media=A4 --landscape --font="DejaVuSansMono30" -o - | ps2pdf - | zathura -
}
resolvecd() {
cd "$(readlink -f $(pwd))"
}
ssht () {
ssh -t $@ "tmux a || tmux";
}
t() {
if [[ "$1" ]] ; then
tmux new-session -A -s "$1"
else
tmux attach-session
fi
}
b() {
bookmarks=${DOTFILES}/bookmarks
bookmark="$1"
if ! [[ "${bookmark}" ]] ; then
printf 'Need a bookmark' >&2
return 1
fi
if ! [[ -r "${bookmark}" ]] ; then
printf 'Invalid bookmark %s' "${bookmark}" >&2
return 1
fi
target="$(head -1 ${bookmark})"
if ! [[ -e "${target}" ]] ; then
printf 'Traget not found: %s' "${target}" >&2
fi
cd "$(eval ${target})"
}
sb() {
echo $(( $1 * $(cat /sys/class/backlight/intel_backlight/max_brightness) / 100)) | sudo tee /sys/class/backlight/intel_backlight/brightness
}
clip() {
tee >(xclip -selection clipboard) | tee >(xclip -selection primary)
}
gb() {
while [[ ! -e ./.git ]] ; do
cd ..
done
}