1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

Merge branch 'master' into surface

This commit is contained in:
Joe Groocock 2018-03-31 11:09:42 +01:00
commit e7baaf0a80
13 changed files with 194 additions and 76 deletions

View File

@ -11,7 +11,7 @@ shadow-opacity = 0.65; # The translucency for shadows. (default .75)
# shadow-red = 0.0; # Red color value of shadow. (0.0 - 1.0, defaults to 0)
# shadow-green = 0.0; # Green color value of shadow. (0.0 - 1.0, defaults to 0)
# shadow-blue = 0.0; # Blue color value of shadow. (0.0 - 1.0, defaults to 0)
#shadow-exclude = [ "n:e:Notification" ]; # Exclude conditions for shadows.
shadow-exclude = [ "class_g = 'slop'" ]; # Exclude conditions for shadows.
shadow-ignore-shaped = false; # Avoid drawing shadow on all shaped windows
# (see also: --detect-rounded-corners)
@ -22,6 +22,9 @@ active-opacity = 1.0; # Default opacity for active windows. (0.0 - 1.0)
frame-opacity = 1.0; # Opacity of window titlebars and borders. (0.1 - 1.0)
inactive-opacity-override = true; # Let inactive opacity set by 'inactive-opacity' overrides
# value of _NET_WM_OPACITY. Bad choice.
opacity-rule = [
"0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
];
alpha-step = 0.06; # XRender backend: Step size for alpha pictures. Increasing
# it may result in less X resource usage,
# Yet f ading may look bad.
@ -51,10 +54,10 @@ backend = "glx" # Backend to use: "xrender" or "glx". GLX backend is typical
# much faster but depends on a sane driver.
mark-wmwin-focused = true; # Try to detect WM windows and mark them as active.
mark-ovredir-focused = true; # Mark all non-WM but override-redirect windows active (e.g. menus).
use-ewmh-active-win = true; # Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused
use-ewmh-active-win = true; # Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused
# instead of using FocusIn/Out events. Usually more reliable but
# depends on a EWMH-compliant WM.
detect-rounded-corners = false; # Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.
detect-rounded-corners = true; # Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.
detect-client-opacity = true; # Detect _NET_WM_OPACITY on client windows, useful for window
# managers not passing _NET_WM_OPACITY of client windows to frame windows.
refresh-rate = 0; # For --sw-opti: Specify refresh rate of the screen. 0 for auto.

View File

@ -1,32 +1,57 @@
[user]
name = Joe Groocock
email = frebib@gmail.com
email = me@frebib.net
signingkey = CFBB6A86
[core]
autocrlf = input
excludesfile = $HOME/.config/git/gitignore
pager = diff-so-fancy | less
[commit]
gpgsign = true
[color]
ui = auto
[push]
default = upstream
[pull]
rebase = true
[rebase]
autoStash = true
[log]
date = relative
[format]
pretty = format:%h %Cblue%ad%Creset %ae %Cgreen%s%Creset
[alias]
verbs = !git log --pretty=format:'%s' | cut -d \" \" -f 1 | sort | uniq -c | sort -nr
pushall = !git remote | xargs -L1 git push
[rebase]
autoStash = true
[push]
default = upstream
count = !echo $(pwd) && git rev-list HEAD --count
unpushed = !git log --oneline @{u}..HEAD
[advice]
statusHints = false
pushUpdateRejected = false
[pull]
rebase = true
[core]
autocrlf = input
excludesfile = /home/frebib/.config/git/gitignore
[sendemail]
from = Joe Groocock <me@frebib.net>
smtpserver = smtp.zoho.com
smtpuser = me@frebib.net
smtpencryption = ssl
smtpserverport = 465
suppresscc = self
[diff]
algorithm = patience
[sendemail]
from = Joe Groocock <frebib@gmail.com>
smtpserver = smtp.gmail.com
smtpuser = frebib@gmail.com
smtpencryption = tls
smtpserverport = 587
suppresscc = self
[interactive]
diffFilter = diff-so-fancy --patch-mode
[color]
ui = true
[color "diff"]
meta = cyan
frag = magenta
commit = yellow
old = red
new = green
whitespace = red 88 reverse
[color "diff-highlight"]
oldNormal = red
oldHighlight = red 88
newNormal = green
newHighlight = green 22
[diff-so-fancy]
changeHunkIndicators = false
# vim: noet

View File

@ -51,6 +51,12 @@ LOCIP=$(ip addr show $IF | perl -n -e "/$AF ([^\/]+).* scope global/ && print \$
#------------------------------------------------------------------------
case $BLOCK_BUTTON in
1) curl -s https://api.ipify.org;;
*) echo "$LOCIP";;
1) curl -s https://api.ipify.org;
break;;
2) curl -s https://api.ipify.org | tee >(xclip -i);
break;;
0|3) echo "$LOCIP" | tee >(xclip -i);
break;;
*) echo "$LOCIP"
break;;
esac

View File

@ -1,7 +1,7 @@
#!/bin/bash
set -e
for p in pacaur yaourt pacman; do
for p in trizen pacaur yaourt pacman; do
if $p --version &>/dev/null; then
PAC="$p"
break;
@ -13,7 +13,7 @@ if [ -z "$PAC" ]; then
fi
if [ "$BLOCK_BUTTON" == 1 ]; then
nohup i3-sensible-terminal -r i3blocks-update-term -e "sh -c '$PAC -Syu; pkill -RTMIN+5 i3blocks'" &>/dev/null &
nohup i3-sensible-terminal -r i3blocks-update-term -e "sh -c '$PAC -Syu || exec zsh; pkill -RTMIN+5 i3blocks'" &>/dev/null &
disown
fi

View File

@ -153,7 +153,8 @@ bindsym $mod+Shift+e exec rofi-emoji
bindsym --release Print exec imgur-screenshot
bindsym --release $mod+Print exec imgur-screenshot -f
bindsym $mod+Mod1+space exec --no-startup-id ~/.config/i3/cycleaudio.py && pkill -RTMIN+10 i3blocks
bindsym $mod+numbersign exec "termite -e 'sh -c xclip\ -o\ |\ gpg\ --decrypt\ 2>&1\ &&\ read'"
bindsym $mod+numbersign exec "termite -e 'sh -c xclip\ -o\ |\ gpg\ --decrypt\ 2>&1\ \;\ $SHELL'"
bindsym $mod+r exec "bash -c 'pwgen -nc 32 1 | tee >(xargs notify-send Generated\ password\:) | xclip -i'"
bindsym $mod+g exec "LINK=$(gist -PRpc); notify-send -c transfer \\"<a href=\\\\"$LINK\\\\">$LINK</a>\\""
# Media player controls

View File

@ -1,17 +1,18 @@
#!/bin/bash
option=$(echo " lock| logout| sleep| power off| reboot| windows" | rofi -sep "|" -dmenu -i -p "" -auto-select -hide-scrollbar -monitor 0 -width 8 -lines 6 -location 3 -tokenize false -matching normal | xargs)
option=$(echo " lock| logout| sleep| hibernate| power off| reboot| windows" | rofi -sep "|" -dmenu -i -p "" -auto-select -hide-scrollbar -monitor 0 -width 8 -lines 6 -location 3 -tokenize false -matching normal | xargs)
case $option in
lock) ./lock.sh;;
logout) i3-msg exit;;
sleep) systemctl suspend;;
hibernate) systemctl hibernate;;
power\ off) systemctl poweroff;;
reboot) systemctl reboot;;
windows)
windows=`efibootmgr | grep -Po -m1 'Boot\K(\d{4}).*Windows.*' | head -c4`
sudo efibootmgr -n $windows
systemctl reboot;;
sudo hibereboot;;
esac
exit 0

View File

@ -1,6 +1,6 @@
[options]
font = SauceCodePro 9.8
scrollback_lines = 100000
scrollback_lines = 1000000
cursor_blink = off
size_hints = true
@ -10,30 +10,34 @@ foreground = #ECEFF1
background = rgba(56, 60, 74, 0.95)
highlight = #5294E2
# black
# Colour order:
# black
# red
# green
# yellow
# blue
# magenta
# cyan
# white/gray
# Normal colours
color0 = #333638
# white
color15 = #eceff1
# gray
color7 = #8b9396
color8 = #475760
# red
color1 = #ff3f00
color9 = #ef5345
# green
color1 = #f41f1c
color2 = #8bc34a
color10 = #9ccc65
# yellow
color3 = #ffc107
color11 = #ffa000
# blue
color4 = #0266f4
color12 = #81b3f9
# magenta
color5 = #cc17cc
color13 = #a56ecc
# cyan
color6 = #10aeba
color7 = #8b9396
# Bright colours
color8 = #475760
color9 = #e53727
color10 = #9ccc65
color11 = #ffa000
color12 = #81b3f9
color13 = #a56ecc
color14 = #5ddae2
color15 = #eceff1
# vim: ft=dosini cms=#%s

View File

@ -2,5 +2,6 @@
/spell/
/swapfiles/
/viminfo
/viminf*.tmp
/vim-latex
/.netrwhist

View File

@ -32,10 +32,16 @@ set autoread
set showmatch
set scrolloff=6
set nojoinspaces
set updatetime=500 " reduce delay from 4s default
" Autosave settings
function! SaveIfExist()
if @% != "" && filereadable(@%) && !&readonly
write
endif
endfunction
set autowrite
autocmd InsertLeave * save
autocmd CursorHold,CursorHoldI,InsertLeave,FocusLost * call SaveIfExist()
" Search options
set hlsearch
@ -49,7 +55,13 @@ set guioptions=
" Whitespace highlight settings
set list
set listchars=eol:$,space:.,tab:>-,trail:~,extends:>,precedes:<
highlight SpecialKey ctermfg=7
highlight SpecialKey ctermfg=8
if exists('+colorcolumn')
highlight ColorColumn ctermbg=8
autocmd filetype c,h,cpp,hpp set colorcolumn=81
autocmd filetype c,h,cpp,hpp match ErrorMsg '\%>80v.\+'
endif
" set the runtime path to include Vundle and initialize
@ -60,14 +72,20 @@ call vundle#rc('~/.config/vim/bundle')
Plugin 'VundleVim/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'scrooloose/syntastic'
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-sensible'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-rhubarb'
Plugin 'tpope/vim-abolish'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-repeat'
Plugin 'tpope/vim-commentary'
Plugin 'majutsushi/tagbar'
Plugin 'airblade/vim-gitgutter'
Plugin 'ryanoasis/vim-devicons'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'chr4/nginx.vim'
Plugin 'PotatoesMaster/i3-vim-syntax'
Plugin 'lervag/vimtex'
Plugin 'JamshedVesuna/vim-markdown-preview'
@ -79,6 +97,15 @@ let g:use_dvorak = 1
" YouCompleteMe config
let g:ycm_confirm_extra_conf = 0
if !exists('g:ycm_semantic_triggers')
let g:ycm_semantic_triggers = {}
endif
let g:ycm_semantic_triggers.tex = g:vimtex#re#youcompleteme
"let g:vimtex_view_method='zathura'
let g:tex_flavor='latex'
autocmd FileType tex silent VimtexCompile
autocmd FileType tex setlocal spell
autocmd FileType tex TagbarOpen
" Vim-Airline config
let g:Powerline_symbols = 'fancy'
@ -92,12 +119,30 @@ let vim_markdown_preview_browser='Chromium'
let vim_markdown_preview_use_xdg_open=1
let vim_markdown_preview_github=1
" Syntastic configuration
let g:syntastic_enable_highlighting = 1
let g:syntastic_enable_signs=1
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" Tagbar configuration
let g:tagbar_width = 50
let g:tagbar_compact = 1
let g:tagbar_show_linenumbers = 1
let g:tagbar_singleclick = 1
let g:tagbar_autopreview = 1
" Disable mouse
set mouse=nicr
nnoremap <LeftMouse> <nop>
nnoremap <RightMouse> <nop>
" Remap completion
inoremap <C-Space> <C-x><C-o>
inoremap <C-@> <C-Space>
let mapleader="\<space>"
" Unbind arrow keys
for prefix in ['n', 'v']
@ -106,6 +151,10 @@ for prefix in ['n', 'v']
endfor
endfor
" Source: https://github.com/ChrisLane/dotfiles/blob/1f5efd44e1b78224568645eaec2e6e243959c0a9/.vimrc#L66
" Remove whitespace at end of lines with F5
:nnoremap <silent> <F5> :let _s=@/ <Bar> :%s/\s\+$//e <Bar> :let @/=_s <Bar> :nohl <Bar> :unlet _s <CR>
" Dvorak Hackery
" Source: https://github.com/sporkbox/vimrc/blob/master/vimrc
if (exists("g:use_dvorak") && g:use_dvorak == 1)
@ -186,13 +235,12 @@ endif
" Save aliases.
noremap <Leader>q :wq<CR>
com W w
com Q q
com Wq wq
com WQ wq
com! W w
com! Q q
com! Wq wq
com! WQ wq
" Write with sudo
cmap w!! w !sudo tee > /dev/null %
autocmd FileType markdown setlocal ts=2 sts=2 sw=2 et
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 et
autocmd FileType tex silent VimtexCompile

View File

@ -4,7 +4,12 @@ export LC_NUMERIC=en_GB
export CONFIG_DIR="$HOME/.config"
export XDG_CONFIG_HOME="$CONFIG_DIR"
export DOTFILES="$CONFIG_DIR/dotfiles"
case "$(basename "$(readlink -f /proc/$$/exe)")" in
zsh) thisfile="$(readlink -f "${(%):-%N}")";;
bash) thisfile="$(readlink -f "${BASH_SOURCE[0]}")";;
*) thisfile="$(find /proc/$$/fd/ | xargs readlink -f | grep .profile | head -n1)";;
esac
export DOTFILES="$(dirname "${thisfile:-$CONFIG_DIR/dotfiles}")"
export PATH="${PATH}:$DOTFILES/scripts:$HOME/.local/share/surface-scripts"
export XDG_CURRENT_DESKTOP="GNOME" # Fixes xdg-open
@ -15,13 +20,32 @@ export VIMINIT=":so $MYVIMRC"
export EDITOR="vim"
export VISUAL="vim"
export LESS="-RNI"
export PAGER="less $LESS"
export MANPAGER="less -+N"
export TERMINAL="termite"
export BROWSER="chromium"
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
export QT_QPA_PLATFORMTHEME=gtk2
export GOPATH="$HOME/.cache/go"
exists() { which $@ 0<&- 1>/dev/null 2>/dev/null; }
export LESS="-RI"
export PAGER="less $LESS"
if exists tput; then
export LESS_TERMCAP_mb=$(tput bold; tput setaf 2) # green
export LESS_TERMCAP_md=$(tput bold; tput setaf 6) # cyan
export LESS_TERMCAP_me=$(tput sgr0)
export LESS_TERMCAP_so=$(tput bold; tput setaf 4) # blue
export LESS_TERMCAP_se=$(tput rmso; tput sgr0)
export LESS_TERMCAP_us=$(tput smul; tput bold; tput setaf 7) # white
export LESS_TERMCAP_ue=$(tput rmul; tput sgr0)
export LESS_TERMCAP_mr=$(tput rev)
export LESS_TERMCAP_mh=$(tput dim)
export LESS_TERMCAP_ZN=$(tput ssubm)
export LESS_TERMCAP_ZV=$(tput rsubm)
export LESS_TERMCAP_ZO=$(tput ssupm)
export LESS_TERMCAP_ZW=$(tput rsupm)
fi
# Source secret keys and values into environment
if [ -f "$CONFIG_DIR/secrets" ]; then
@ -31,18 +55,18 @@ if [ -f "$CONFIG_DIR/secrets" ]; then
fi
# Merge system clipboards
if [ -n "$DISPLAY" ] && which autocutsel >/dev/null 2>&1; then
if [ -n "$DISPLAY" ] && exists autocutsel && ! pidof autocutsel 1>/dev/null; then
autocutsel -fork
autocutsel -selection PRIMARY -fork
fi
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && which dbus-launch >/dev/null 2>&1; then
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && exists dbus-launch; then
eval $(dbus-launch --sh-syntax --exit-with-session)
dbus-update-activation-environment --systemd DISPLAY
fi
# Start the gnome-keyring if it's installed
if which gnome-keyring-daemon >/dev/null 2>&1; then
if exists gnome-keyring-daemon; then
export $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gnupg)
fi

9
.zshrc
View File

@ -13,8 +13,10 @@ HISTFILE="$ZSH_DIR/histfile"
HISTSIZE=999999
SAVEHIST=999999
exists() { which $@ 0<&- 1>/dev/null 2>/dev/null; }
# Only set tty if running interactively
if tty -s; then
if exists tty && tty -s; then
# Resolve at shell runtime
export GPG_TTY="$(tty)"
fi
@ -23,13 +25,12 @@ fi
setopt sharehistory histignorealldups histignorespace histreduceblanks
setopt pathdirs autocd autopushd extendedglob alwaystoend dvorak
# Completion initialisation
autoload -U compinit ; compinit
autoload -U bashcompinit ; bashcompinit
# gopass completion
if gopass --help &>/dev/null; then
if exists gopass; then
source <(gopass completion bash)
fi
@ -44,7 +45,7 @@ zstyle ':compinstall' filename "$HOME/.zshrc"
# Load antigen & plugins
antigen_src="$ZSH_DIR/antigen.zsh"
if [ ! -f "$antigen_src" ]; then
if which curl &>/dev/null; then
if exists curl; then
getcmd='curl -L'
else
getcmd='wget -qO-'

25
aliases
View File

@ -14,6 +14,7 @@ alias l=ll
alias ll="ls -lFh --group-directories-first"
alias la="ls -lAFh --group-directories-first"
alias lt='ls -lAFh --sort=time'
alias lsz='ls -lAFh --sort=size'
alias al=la # No, I don't need the Mono Assembly Linker
alias md="mkdir -p"
@ -30,6 +31,7 @@ alias -g C="| wc -l"
alias -g S="| sort"
alias -g U="| uniq"
alias -g count="| wc -l"
alias -g NO="1> /dev/null"
alias -g NE="2> /dev/null"
alias -g NUL="&> /dev/null"
alias -g BG="&;disown"
@ -57,15 +59,16 @@ alias dd='dd status=progress'
alias env='env | sort'
alias ssh="ssh -tt"
alias grip='grip --user=frebib --pass=$GRIP_API_KEY'
which gopass &>/dev/null && alias pass='gopass'
alias acme.sh='$XDG_CONFIG_HOME/acme.sh/acme.sh --home $XDG_CONFIG_HOME/acme.sh --config-home $XDG_CONFIG_HOME/acme.sh --log $XDG_CONFIG_HOME/acme.sh/acme.sh.log'
alias acmesh='$XDG_CONFIG_HOME/acme.sh/acme.sh --home $XDG_CONFIG_HOME/acme.sh --config-home $XDG_CONFIG_HOME/acme.sh --log $XDG_CONFIG_HOME/acme.sh/acme.sh.log'
exists gopass && alias pass='gopass'
alias abuild='docker run -ti --rm \
-e USER \
-e PWD \
-e HOME \
-w $PWD \
-v $PWD:$PWD \
-v ~/.abuild:/home/$USER/.abuild \
-v ~/.config/git:/home/$USER/.config/git:ro \
-v ~/.gnupg:/home/$USER/.gnupg \
-v ~/.abuild:$HOME/.abuild \
frebib/alpine-sdk:edge abuild'
# System aliases
@ -89,20 +92,21 @@ alias -s gz="tar tf"
alias -s jar="java -jar"
alias -s git="git clone --recursive"
# Git Aliases
alias g=git
alias gignore='$EDITOR .gitignore'
alias gitc='$EDITOR ~/.config/git/config'
alias ggignore='$EDITOR ~/.config/git/gitignore'
alias gcl="git clone --recursive"
alias gco="git checkout"
alias gcom="git checkout master"
alias ga="git add"
alias gap="git -c interactive.diffFilter=\"git diff --color-words\" add -p"
alias gap="git add -p"
alias gaa="ga -A"
alias grm="git rm"
alias gc="git commit"
alias gcm="gc -m"
gcmst() { git stash -u -k && git commit -m "$1" && git stash pop; }
alias gca="git commit --amend"
alias gcan="git commit --amend --no-edit"
alias gcam="git commit --amend -m"
@ -125,14 +129,13 @@ alias glp="gl && gp"
gd() {
local commit=$1
if [ -z "$commit" ] || [ ${commit:0:1} != '@' ]; then
git diff --color-words $@
return
git diff $@
else
git diff --color-words "@~${commit:1}^!"
git diff "@~${commit:1}^!"
fi
}
alias gds="git diff --staged --color-words"
alias gsh="git show --color-words"
alias gds="git diff --staged"
alias gsh="git show"
alias glg="git log --stat --color"
alias glog="git log --oneline --decorate --color --graph"

View File

@ -34,6 +34,7 @@ URLS=(
'https://emojipedia.org/objects/'
'https://emojipedia.org/symbols/'
'https://emojipedia.org/flags/'
'https://emojipedia.org/modifiers/'
)