Misc changes

This commit is contained in:
Austen Adler 2017-04-30 13:14:50 -04:00
parent 103c45d635
commit cb838ded70
6 changed files with 85 additions and 30 deletions

View File

@ -1,9 +1,9 @@
[user]
name = Austen Adler
email = stonewareslord@gmail.com
signingkey = CCDFE3F1
#signingkey = CCDFE3F1
[commit]
gpgsign=true
#gpgsign=true
[alias]
i = "!git br&&git st"
# coa = "!for i in $(git branch -a|cut -b3-|grep remotes|sed -e 's/remotes\///'|cut -d/ -f1 --complement|cut -d\ -f1);do git checkout $i;done"
@ -11,7 +11,8 @@
pus = push --all
co = checkout
ci = commit -m
aci = "!git add --all;git commit -m"
aci = commit -am
aaci = "!git add --all;git commit -m"
setup = "!git init;git commit --allow-empty -m 'Initial commit'"
a = add
aa = add --all

View File

@ -6,6 +6,7 @@ set $x_switch workspace
for_window [class=ownCloud] floating disable
assign [class=Firefox] 2
assign [class=google-chrome] 2
assign [class=Google-chrome] 2
assign [class=midori4] 2
assign [class=Chromium-browser] 2
@ -106,7 +107,7 @@ bindsym $mod+shift+u focus child
bindsym --release $mod+n exec "~/.i3/run.sh paste"
# Exit/restart i3
bindsym $mod+q restart
bindsym $mod+shift+q exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
bindsym $mod+shift+q exec "i3-nagbar -m 'Shutdown/Restart/Logout' -t warning -b Shutdown 'sudo /sbin/poweroff' -b Restart 'sudo /sbin/shutdown -r now' -b Logout 'i3-msg exit' -b Sleep 'slock&until echo mem|sudo tee /sys/power/state>/dev/null;do sleep 1;done;sleep 4;nmcli radio wifi off;sleep 3;nmcli radio wifi on'"
# Wallpaper
bindsym $mod+shift+w exec "~/.i3/run.sh wall"
@ -137,6 +138,7 @@ client.urgent $rd $rd $tx
bar {
#height 12
status_command i3status --config ~/.i3/i3status.conf
#status_command ~/.i3/status.sh
font -*-*-*-*-*-*-8-*-*-*-*-*-*-*
tray_output primary
mode dock
@ -181,7 +183,7 @@ exec --no-startup-id xmodmap ~/.xmodmap
exec --no-startup-id compton
# Spawn a terminal
#TODO: Currently the terminal will spawn in the current workspace
exec --no-startup-id i3-msg 'workspace 1; exec /usr/bin/urxvt'
exec --no-startup-id /usr/bin/urxvt
# Orange tint
exec --no-startup-id /usr/bin/redshift -l 36.3:-80.3 -t 4000:2000
# Sync x11 clipboards

View File

@ -70,6 +70,22 @@ fi
if [ "$1" = "paste" ]; then
DISPLAY=:0.0 xdotool type --clearmodifiers --file <(xsel)
fi
if [ "$1" = "ping" ]; then
shift
# Return code
local RET=0
# nc has some intense divergence. netcat6 has no -z, but netcat has no -x
# -w3: 3 second timeout
# -4 : ipv4 only
# check if nc has -z
if nc -h |& grep -q -- -z; then
nc -w 1 -z4 "$1" "$2" >& /dev/null && RET=1
# check if nc has --transfer (-x)
elif nc -h |& grep -q -- --transfer; then
nc -w 1 -4 "$1" "$2" -x </dev/null >& /dev/null && RET=1
fi
echo $RET
fi
if [ "$1" = "ip" ]; then
shift
local RET=0

View File

@ -3,7 +3,8 @@
!URxvt.boldFont: -*-*-*-*-*-*-*-*-*-*-*-*-*-*
!URxvt.font: xft:Fixed:style=SemiCondensed:size=10
!URxvt.font: xft:Inconsolata:size=12
URxvt.font: xft:Terminus:size=14
!URxvt.font: xft:Terminus:size=12
URxvt.font: xft:Neep:size=13
!URxvt.font: xft:Courier New:size=12
!URxvt.faceName: -*-*-*-*-*-*-10-*-*-*-*-*-*-*
!URxvt.font: xft:Fixed:style=SemiCondensed:size=16
@ -43,6 +44,24 @@ VT100*Translations: #override \
URxvt*keysym.Home: \033[1~
URxvt*keysym.End: \033[4~
URxvt.VT100*translations: #override Shift <Btn1Up>: exec-formatted("firefox", PRIMARY)
!*.foreground: #F8F8F2
!*.background: #282A36
!*.color0: #000000
!*.color8: #4D4D4D
!*.color1: #FF5555
!*.color9: #FF6E67
!*.color2: #50FA7B
!*.color10: #5AF78E
!*.color3: #F1FA8C
!*.color11: #F4F99D
!*.color4: #CAA9FA
!*.color12: #CAA9FA
!*.color5: #FF79C6
!*.color13: #FF92D0
!*.color6: #8BE9FD
!*.color14: #9AEDFE
!*.color7: #BFBFBF
!*.color15: #E6E6E6
URxvt.foreground: #ffffff
URxvt.background: #121212
URxvt.cursorColor: #ffffff

View File

@ -53,7 +53,8 @@ sv () {
if [[ "$1" == "sshd" ]] || [[ "$1" == "ssh" ]]; then
echo "Checking sshd config..."
sudo sshd -t && echo "Config good. Continuing" || (echo "Aborting due to bad ssh config";return 1)
elif [[ "$command" == "r" ]]; then
fi
if [[ "$command" == "r" ]]; then
echo "Restarting $1"
sudo service "$1" restart
elif [[ "$command" == "s" ]]; then
@ -90,13 +91,14 @@ dedir(){
# Make a uuid to avoid name conflicts
# Ex: dediring sage when sage/sage fails because sage/sage is moved to .
# but since sage/ exists, it can't be moved
name=$(uuidgen)
local name=$(uuidgen)
# Move the directory to the uuid
=mv -n "$1" "$name" || return 1
# Move all files, use (N) in case there is no * or .* matches
=mv -n "$name"/{.,}*(N) . || return 2
=rmdir "$name" || return 3
}
# Run multitail on logs
mt(){
if [[ -z "$1" ]]; then
echo "Opts:\nm xe gitea dm syncthing g" >&2
@ -169,6 +171,8 @@ update-tool() {
read RESP
done
}
alias apush="adb push -p"
alias apull="adb pull -p"
alias cleaner="sudo ~/run.sh 'perl-cleaner --reallyall' 'python-updater' 'haskell-updater -- --usepkg=n'"
alias jsonpretty='python -m json.tool'
alias nmrestart='nmcli radio wifi off;nmcli radio wifi on'
@ -321,6 +325,7 @@ alias -g nifyd=" > /dev/null 2>&1 & disown"
alias -g L="2>&1|less"
if ex rg; then
alias -g G='|& rg'
alias rg='rg -i'
# I'm so sorry ggreer
alias ag=rg
elif ex ag; then
@ -392,9 +397,6 @@ grename() {
bp(){
echo '\a'
}
apush(){
adb push $* & pv -d $!
}
ltar(){
tar -cf - $@|pv -WcN tar|xz|pv -WcN lzma
#tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest
@ -579,24 +581,32 @@ k(){
elif [ -f "$@" ] ; then
#Extract if it's extractable
case $1 in
*.tar.xz) pv $1|tar -xJf - ;;
*.txz) pv $1|tar -xJf - ;;
*.tar.bz2) pv $1|tar -xjf - ;;
*.tar.gz) pv $1|tar -xzf - ;;
*.tar) pv $1|tar -xf - ;;
*.tbz) pv $1|tar -xjf - ;;
*.tbz2) pv $1|tar -xjf - ;;
*.tgz) pv $1|tar -xzf - ;;
*.lzma) pv $1|tar --lzma -xf - ;;
*.xz) pv $1|tar -xJf - ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*.lrz) lrzuntar $1 ;;
*) vim $1
# Images
*.png|*.jpg|*.gif) feh "$1" ;;
# Documents
*.pdf|*.ps) okular "$1" ;;
*.odt|*.doc|*.docx) libreoffice "$1" ;;
*.odp|*.ppt|*.pptx) libreoffice "$1" ;;
*.ods|*.xls|*.xlsx) libreoffice "$1" ;;
# Compressed files
*.tar.xz) pv "$1"|tar -xJf - ;;
*.txz) pv "$1"|tar -xJf - ;;
*.tar.bz2) pv "$1"|tar -xjf - ;;
*.tar.gz) pv "$1"|tar -xzf - ;;
*.tar) pv "$1"|tar -xf - ;;
*.tbz) pv "$1"|tar -xjf - ;;
*.tbz2) pv "$1"|tar -xjf - ;;
*.tgz) pv "$1"|tar -xzf - ;;
*.lzma) pv "$1"|tar --lzma -xf - ;;
*.xz) pv "$1"|tar -xJf - ;;
*.bz2) bunzip2 "$1" ;;
*.rar) unrar x "$1" ;;
*.gz) gunzip "$1" ;;
*.zip) unzip "$1" ;;
*.Z) uncompress "$1" ;;
*.7z) 7z x "$1" ;;
*.lrz) lrzuntar "$1" ;;
*) vim "$1"
esac
else
#Edit with vim

View File

@ -13,6 +13,7 @@ command! WW %!sudo tee > /dev/null %
let g:indent_guides_auto_colors = 0
"Required for CSC216, not needed for current classes
"autocmd FileType java set shiftwidth=3 tabstop=3 softtabstop=3 expandtab
"au FileType twig let b:AutoPairs['%']='%'
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=darkgrey ctermbg=darkgrey
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=grey ctermbg=grey
filetype plugin on
@ -136,6 +137,7 @@ let g:tex_flavor='latex'
set ttimeout
set ttimeoutlen=0
set notimeout
set conceallevel=0
" }
" Misc {
set tabstop=2 shiftwidth=2 expandtab
@ -182,6 +184,8 @@ let g:tex_flavor='latex'
syntax on
" }
"Polyglot conflicts with another latex editor
let g:polyglot_disabled = ['latex']
"Symfony
let g:symfony_app_console_caller="php"
let g:symfony_app_console_path="bin/console"
@ -303,6 +307,8 @@ endif
"256 color vim in terminal | https://github.com/godlygeek/csapprox
" }
" Syntax {
Plug 'https://austenwares.com/gitea/vim/vimtex'
"Latex | https://github.com/lervag/vimtex
Plug 'https://austenwares.com/gitea/vim/vim-polyglot'
"Many languages | https://github.com/sheerun/vim-polyglot
Plug 'https://austenwares.com/gitea/vim/vim-vimperator'
@ -325,7 +331,8 @@ endif
" "Edit files remotely | https://github.com/zenbro/mirror.vim
" }
" Staging {
Plug 'https://austenwares.com/gitea/vim/vim-symfony'
"Plug 'https://austenwares.com/gitea/vim/vim-symfony'
"Plug 'dracula/vim'
"Plug 'idanarye/vim-vebugger'
"Debugger | https://github.com/idanarye/vim-vebugger