├── .Xdefaults ├── .config ├── vis │ ├── vis.log │ └── colors │ │ ├── blue │ │ └── neonwave ├── gsimplecal │ └── config ├── i3 │ ├── session │ ├── set_brightness.sh │ ├── spacefn.sh │ ├── unhide.sh │ ├── launchx.sh │ ├── musicwatcher.sh │ ├── kb-backlight.sh │ ├── restore_session_prompt.sh │ ├── google_search.sh │ ├── save_session.sh │ ├── run_and_record.sh │ ├── polybar-dev.sh │ ├── polybar.sh │ ├── lockscreen │ ├── autostart.sh │ ├── trivial_bar_script.sh │ ├── volume.sh │ ├── backlight.sh │ ├── kb-light.py │ └── musicwatcher.py ├── sway │ ├── lockscreen │ ├── barcmd.sh │ ├── idle │ │ ├── inhibitors │ │ │ ├── pulse.sh │ │ │ └── ac.sh │ │ ├── brightness │ │ ├── lock.sh │ │ ├── suspend.sh │ │ ├── outputs_off.sh │ │ ├── outputs_on.sh │ │ ├── brightness.c │ │ ├── brighten_screen.sh │ │ ├── run.sh │ │ └── dim_screen.sh │ ├── window_name.sh │ ├── refresh_window.sh │ ├── watchWindowName.sh │ ├── backlight.sh │ ├── active_outputs.py │ ├── autostart.sh │ ├── bar.json │ ├── startsway │ ├── move_workspaces.py │ ├── toggle_active_outputs.py │ └── musicwatcher.py ├── redshift.conf ├── sxhkd │ ├── rz │ └── global.sxhkdrc ├── polybar │ ├── songname.sh │ ├── gmusic.awk │ ├── gmusic.py │ └── config ├── bspwm │ └── bspwmrc ├── dunst │ └── dunstrc └── compton │ └── compton.conf ├── .vim ├── test │ ├── =fixture=.txt │ ├── fix[tu]re.txt │ ├── hunkUndoGitDiff.expected │ ├── hunkHunkOutsideNoopStageGitDiffStaged.expected │ ├── hunkHunkOutsideNoopUndoGitDiffStaged.expected │ ├── hunkStageSigns.expected │ ├── hunkUndoSigns.expected │ ├── noModifications.expected │ ├── keepModified.expected │ ├── hunkOutsideNoopStageSigns.expected │ ├── hunkOutsideNoopUndoSigns.expected │ ├── untrackedFileOutsideRepo.expected │ ├── untrackedFileWithinRepo.expected │ ├── keepAlt.expected │ ├── untrackedFileSquareBracketsWithinRepo.expected │ ├── cp932.txt │ ├── fixture.txt │ ├── keepOpMarks.expected │ ├── testNoModifications.vim │ ├── addLines.expected │ ├── testAddLines.vim │ ├── addLinesFish.expected │ ├── followSymlink.expected │ ├── modifyLines.expected │ ├── orphanedSigns.expected │ ├── removeLines.expected │ ├── signColumnAlways.expected │ ├── testModifyLines.vim │ ├── ambiguousFile.expected │ ├── testRemoveLines.vim │ ├── fileAddedToGit.expected │ ├── removeFirstLines.expected │ ├── testRemoveFirstLines.vim │ ├── testAddLinesFish.vim │ ├── testSignColumnAlways.vim │ ├── testOrphanedSigns.vim │ ├── filenameWithEquals.expected │ ├── filenameWithSquareBrackets.expected │ ├── testHunkUndo.vim │ ├── testHunkStage.vim │ ├── testUntrackedFileOutsideRepo.vim │ ├── hunkStageNearbySigns.expected │ ├── hunkUndoNearbySigns.expected │ ├── testKeepModified.vim │ ├── testEditAmbiguousFile.vim │ ├── hunkStageGitDiff.expected │ ├── hunkStageNearbyGitDiff.expected │ ├── hunkStageNearbyGitDiffStaged.expected │ ├── hunkUndoNearbyGitDiff.expected │ ├── testFollowSymlink.vim │ ├── testFilenameWithSquareBrackets.vim │ ├── testHunkUndoNearbyHunk.vim │ ├── testFilenameWithEquals.vim │ ├── testUntrackedFileWithinRepo.vim │ ├── testKeepAlt.vim │ ├── testHunkStageNearbyHunk.vim │ ├── testUntrackedFileSquareBracketsWithinRepo.vim │ ├── testFileAddedToGit.vim │ ├── testKeepOpMarks.vim │ ├── testHunkOutsideNoop.vim │ ├── test │ ├── README.markdown │ └── helper.vim ├── .gitignore ├── screenshot.png ├── screenshots │ ├── screen.png │ ├── screen2.png │ └── screen3.png ├── ftdetect │ ├── openscad.vim │ └── swift.vim ├── ftplugin │ └── swift.vim ├── plugin │ ├── airline-themes.vim │ └── swift.vim ├── example │ └── URL.swift ├── lib │ └── nerdtree │ │ ├── event.vim │ │ ├── notifier.vim │ │ └── flag_set.vim ├── autoload │ ├── airline │ │ ├── extensions │ │ │ ├── capslock.vim │ │ │ ├── commandt.vim │ │ │ ├── syntastic.vim │ │ │ ├── obsession.vim │ │ │ ├── ctrlspace.vim │ │ │ ├── unicode.vim │ │ │ ├── xkblayout.vim │ │ │ ├── unite.vim │ │ │ ├── vimagit.vim │ │ │ ├── undotree.vim │ │ │ ├── bufferline.vim │ │ │ ├── windowswap.vim │ │ │ ├── csv.vim │ │ │ ├── neomake.vim │ │ │ ├── virtualenv.vim │ │ │ ├── tmuxline.vim │ │ │ ├── netrw.vim │ │ │ ├── ale.vim │ │ │ ├── tabline │ │ │ │ ├── formatters │ │ │ │ │ ├── unique_tail.vim │ │ │ │ │ └── default.vim │ │ │ │ ├── buflist.vim │ │ │ │ └── autoshow.vim │ │ │ ├── ycm.vim │ │ │ ├── promptline.vim │ │ │ ├── tagbar.vim │ │ │ ├── wordcount.vim │ │ │ ├── wordcount │ │ │ │ └── formatters │ │ │ │ │ └── default.vim │ │ │ ├── quickfix.vim │ │ │ ├── eclim.vim │ │ │ ├── example.vim │ │ │ └── nrrwrgn.vim │ │ ├── themes │ │ │ ├── monochrome.vim │ │ │ ├── hybridline.vim │ │ │ ├── ravenpower.vim │ │ │ ├── serene.vim │ │ │ ├── simple.vim │ │ │ ├── light.vim │ │ │ ├── aurora.vim │ │ │ ├── xtermlight.vim │ │ │ ├── zenburn.vim │ │ │ ├── tomorrow.vim │ │ │ ├── powerlineish.vim │ │ │ ├── wal.vim │ │ │ ├── kolor.vim │ │ │ ├── molokai.vim │ │ │ ├── distinguished.vim │ │ │ ├── papercolor.vim │ │ │ ├── understated.vim │ │ │ ├── durant.vim │ │ │ ├── kalisi.vim │ │ │ ├── badwolf.vim │ │ │ └── laederon.vim │ │ ├── debug.vim │ │ ├── msdos.vim │ │ └── section.vim │ └── gitgutter │ │ ├── fold.vim │ │ └── async.vim ├── .travis.yml ├── ctags │ └── swift.cnf ├── unplace.vim ├── t │ ├── highlighter.vim │ ├── extensions_default.vim │ ├── commands.vim │ ├── parts.vim │ ├── util.vim │ ├── themes.vim │ ├── init.vim │ └── airline.vim ├── compiler │ └── swift.vim ├── LICENCE ├── syntax_checkers │ └── swift │ │ ├── swiftpm.vim │ │ └── swiftlint.vim ├── nerdtree_plugin │ └── exec_menuitem.vim ├── colors │ └── grb256.vim ├── ale_linters │ └── swift │ │ └── swiftpm.vim └── syntax │ └── tagbar.vim ├── .inputrc ├── .mplayer └── config ├── bin ├── gmusic.sh ├── messenger.sh ├── freemem.sh ├── hdmi2 ├── getTz ├── kredshift.sh ├── statwrapper.sh ├── charger.sh ├── hdmivolume ├── hdmibrightness ├── fix_links.sh ├── snes.sh ├── sysmenu.sh ├── git-fshow ├── shortenPath.sh ├── bat.sh ├── xrandr.sh └── move_window_i3.py ├── .dir_colors ├── .gitignore ├── xorg.conf.d ├── 91-external-keyboard.conf └── 90-deathadder.conf ├── .Xresources-cyan ├── .Xresources-green ├── .bashrc ├── .vimrc └── .Xresources /.Xdefaults: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.config/vis/vis.log: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.vim/test/=fixture=.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.vim/test/fix[tu]re.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.config/vis/colors/blue: -------------------------------------------------------------------------------- 1 | blue 2 | -------------------------------------------------------------------------------- /.inputrc: -------------------------------------------------------------------------------- 1 | set editing-mode vi 2 | -------------------------------------------------------------------------------- /.vim/test/hunkUndoGitDiff.expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.config/gsimplecal/config: -------------------------------------------------------------------------------- 1 | close_on_unfocus = 1 2 | -------------------------------------------------------------------------------- /.vim/test/hunkHunkOutsideNoopStageGitDiffStaged.expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.vim/test/hunkHunkOutsideNoopUndoGitDiffStaged.expected: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.vim/test/hunkStageSigns.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | -------------------------------------------------------------------------------- /.vim/test/hunkUndoSigns.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | -------------------------------------------------------------------------------- /.vim/test/noModifications.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | -------------------------------------------------------------------------------- /.vim/test/keepModified.expected: -------------------------------------------------------------------------------- 1 | modified: 1 2 | modified: 1 3 | -------------------------------------------------------------------------------- /.vim/.gitignore: -------------------------------------------------------------------------------- 1 | doc/tags 2 | *.lock 3 | .vim-flavor 4 | *.swp 5 | -------------------------------------------------------------------------------- /.vim/test/hunkOutsideNoopStageSigns.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | -------------------------------------------------------------------------------- /.vim/test/hunkOutsideNoopUndoSigns.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | -------------------------------------------------------------------------------- /.vim/test/untrackedFileOutsideRepo.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | -------------------------------------------------------------------------------- /.vim/test/untrackedFileWithinRepo.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | -------------------------------------------------------------------------------- /.config/vis/colors/neonwave: -------------------------------------------------------------------------------- 1 | cyan 2 | yellow 3 | blue 4 | green 5 | red 6 | -------------------------------------------------------------------------------- /.mplayer/config: -------------------------------------------------------------------------------- 1 | stop-xscreensaver=1 2 | vo=gl 3 | ao=pulse 4 | noborder=1 5 | -------------------------------------------------------------------------------- /.vim/test/keepAlt.expected: -------------------------------------------------------------------------------- 1 | buffer: fixture.txt 2 | altbuffer: 3 | altbuffer: 4 | -------------------------------------------------------------------------------- /.vim/test/untrackedFileSquareBracketsWithinRepo.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | -------------------------------------------------------------------------------- /bin/gmusic.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | $BROWSER --app="https://music.google.com" 4 | -------------------------------------------------------------------------------- /bin/messenger.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | $BROWSER --app="https://messenger.com" 4 | -------------------------------------------------------------------------------- /.dir_colors: -------------------------------------------------------------------------------- 1 | DIR 01;32 # bold, green fg 2 | EXEC 32 # green fg 3 | LINK 36 # cyan fg 4 | -------------------------------------------------------------------------------- /.config/i3/session: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raidzero/dotfiles/HEAD/.config/i3/session -------------------------------------------------------------------------------- /.vim/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raidzero/dotfiles/HEAD/.vim/screenshot.png -------------------------------------------------------------------------------- /.vim/test/cp932.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raidzero/dotfiles/HEAD/.vim/test/cp932.txt -------------------------------------------------------------------------------- /.vim/test/fixture.txt: -------------------------------------------------------------------------------- 1 | a 2 | b 3 | c 4 | d 5 | e 6 | f 7 | g 8 | h 9 | i 10 | j 11 | 12 | -------------------------------------------------------------------------------- /.config/sway/lockscreen: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | swaylock -i ~/wallpapers/trust_the_computer-1080.png 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.swo 3 | .vim/.netrwhist 4 | .config/i3/layout/** 5 | .config/i3/layout** 6 | -------------------------------------------------------------------------------- /.config/sway/barcmd.sh: -------------------------------------------------------------------------------- 1 | for i in `seq 1 100`; do 2 | cat ~/.config/sway/bar.json 3 | sleep 2 4 | done 5 | -------------------------------------------------------------------------------- /.config/sway/idle/inhibitors/pulse.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | pactl list | grep RUNNING && exit 1 || exit 0 4 | -------------------------------------------------------------------------------- /.vim/screenshots/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raidzero/dotfiles/HEAD/.vim/screenshots/screen.png -------------------------------------------------------------------------------- /bin/freemem.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | free -m | grep "^Mem:" | awk '{printf("%2.0f%%\n", (($2-$7)/$2)*100)}' 3 | -------------------------------------------------------------------------------- /bin/hdmi2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ~/.config/i3/lockscreen & 4 | sudo ddcutil -b 4 setvcp 60 0x10 --noverify 5 | -------------------------------------------------------------------------------- /.config/i3/set_brightness.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo $1 > /sys/class/backlight/intel_backlight/brightness 4 | -------------------------------------------------------------------------------- /.config/sway/idle/brightness: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raidzero/dotfiles/HEAD/.config/sway/idle/brightness -------------------------------------------------------------------------------- /.vim/screenshots/screen2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raidzero/dotfiles/HEAD/.vim/screenshots/screen2.png -------------------------------------------------------------------------------- /.vim/screenshots/screen3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raidzero/dotfiles/HEAD/.vim/screenshots/screen3.png -------------------------------------------------------------------------------- /.vim/test/keepOpMarks.expected: -------------------------------------------------------------------------------- 1 | '[ mark: 0,6,1,0 2 | '] mark: 0,6,2,0 3 | '[ mark: 0,6,1,0 4 | '] mark: 0,6,2,0 5 | -------------------------------------------------------------------------------- /.vim/test/testNoModifications.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | call Setup() 3 | 4 | call DumpSigns('noModifications') 5 | -------------------------------------------------------------------------------- /.config/sway/idle/inhibitors/ac.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | grep 1 /sys/class/power_supply/AC/online && exit 1 || exit 0 4 | -------------------------------------------------------------------------------- /.config/sway/idle/lock.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ~/.config/sway/idle/inhibitors/pulse.sh || exit 1 3 | 4 | ~/.config/i3/lockscreen 5 | -------------------------------------------------------------------------------- /.vim/test/addLines.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | Signs for fixture.txt: 4 | line=2 id=3000 name=GitGutterLineAdded 5 | -------------------------------------------------------------------------------- /.vim/test/testAddLines.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | call Setup() 3 | 4 | normal ggo* 5 | write 6 | call DumpSigns('addLines') 7 | -------------------------------------------------------------------------------- /bin/getTz: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | curl -s https://timezoneapi.io/api/ip/?`curl -s icanhazip.com` | jq '.data .timezone .id' 4 | -------------------------------------------------------------------------------- /.vim/test/addLinesFish.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | Signs for fixture.txt: 4 | line=2 id=3000 name=GitGutterLineAdded 5 | -------------------------------------------------------------------------------- /.vim/test/followSymlink.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | Signs for symlink: 4 | line=5 id=3000 name=GitGutterLineRemoved 5 | -------------------------------------------------------------------------------- /.vim/test/modifyLines.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | Signs for fixture.txt: 4 | line=1 id=3000 name=GitGutterLineModified 5 | -------------------------------------------------------------------------------- /.vim/test/orphanedSigns.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | Signs for fixture.txt: 4 | line=6 id=3001 name=GitGutterLineAdded 5 | -------------------------------------------------------------------------------- /.vim/test/removeLines.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | Signs for fixture.txt: 4 | line=4 id=3000 name=GitGutterLineRemoved 5 | -------------------------------------------------------------------------------- /.vim/test/signColumnAlways.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | Signs for fixture.txt: 4 | line=9999 id=2999 name=GitGutterDummy 5 | -------------------------------------------------------------------------------- /.vim/test/testModifyLines.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | call Setup() 3 | 4 | normal ggi* 5 | write 6 | call DumpSigns('modifyLines') 7 | -------------------------------------------------------------------------------- /.config/sway/window_name.sh: -------------------------------------------------------------------------------- 1 | swaymsg -t get_tree | jq '.. | (.nodes? // empty)[] | select(.focused==true) | {name, pid}' | jq '.name' 2 | -------------------------------------------------------------------------------- /.vim/test/ambiguousFile.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | Signs for fixture.txt: 4 | line=5 id=3000 name=GitGutterLineModified 5 | -------------------------------------------------------------------------------- /.vim/test/testRemoveLines.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | call Setup() 3 | 4 | execute '5d' 5 | write 6 | call DumpSigns('removeLines') 7 | -------------------------------------------------------------------------------- /.vim/test/fileAddedToGit.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | Signs for fileAddedToGit.tmp: 4 | line=1 id=3000 name=GitGutterLineAdded 5 | -------------------------------------------------------------------------------- /.vim/ftdetect/openscad.vim: -------------------------------------------------------------------------------- 1 | au BufRead,BufNewFile *.scad setfiletype openscad 2 | an 50.80.265 &Syntax.NO.OpenSCAD :cal SetSyn("openscad") 3 | -------------------------------------------------------------------------------- /.vim/test/removeFirstLines.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | Signs for fixture.txt: 4 | line=1 id=3000 name=GitGutterLineRemovedFirstLine 5 | -------------------------------------------------------------------------------- /.vim/test/testRemoveFirstLines.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | call Setup() 3 | 4 | execute '1d' 5 | write 6 | call DumpSigns('removeFirstLines') 7 | -------------------------------------------------------------------------------- /.config/redshift.conf: -------------------------------------------------------------------------------- 1 | [redshift] 2 | temp-day=6500K 3 | temp-night=3000K 4 | transition=1 5 | location-provider=geoclue2 6 | adjustment-method=randr 7 | -------------------------------------------------------------------------------- /.config/sway/refresh_window.sh: -------------------------------------------------------------------------------- 1 | if [ -p /dev/stdin ]; then 2 | read windowName 3 | else 4 | windowName="None" 5 | fi 6 | 7 | pkill -SIGRTMIN+30 i3blocks 8 | -------------------------------------------------------------------------------- /.config/sway/watchWindowName.sh: -------------------------------------------------------------------------------- 1 | # update window title in i3status 2 | swaymsg -t subscribe -m '["window"]' | while read line; do pkill -SIGRTMIN+30 i3blocks; done 3 | -------------------------------------------------------------------------------- /.vim/test/testAddLinesFish.vim: -------------------------------------------------------------------------------- 1 | set shell=/usr/local/bin/fish 2 | source helper.vim 3 | call Setup() 4 | 5 | normal ggo* 6 | write 7 | call DumpSigns('addLinesFish') 8 | -------------------------------------------------------------------------------- /.vim/test/testSignColumnAlways.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | call Setup() 3 | 4 | let g:gitgutter_sign_column_always=1 5 | write 6 | 7 | call DumpSigns('signColumnAlways') 8 | -------------------------------------------------------------------------------- /xorg.conf.d/91-external-keyboard.conf: -------------------------------------------------------------------------------- 1 | Section "InputClass" 2 | Identifier "External Keyboard" 3 | MatchIsKeyboard "on" 4 | Option "XkbOptions" "caps:super" 5 | EndSection 6 | -------------------------------------------------------------------------------- /.vim/test/testOrphanedSigns.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | call Setup() 3 | 4 | execute "normal 5GoX\Y" 5 | write 6 | execute '6d' 7 | write 8 | call DumpSigns('orphanedSigns') 9 | -------------------------------------------------------------------------------- /.vim/test/filenameWithEquals.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | Signs for =fixture=.txt: 4 | line=1 id=3000 name=GitGutterLineAdded 5 | line=2 id=3001 name=GitGutterLineAdded 6 | -------------------------------------------------------------------------------- /bin/kredshift.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | killall redshift 4 | pgrep redshift &> /dev/null || echo `date` > ~/.redshift.log && redshift -v -c ~/.config/redshift.conf &>> ~/.redshift.log & 5 | -------------------------------------------------------------------------------- /.config/sway/backlight.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BRIGHTNESS=$(cat /sys/class/backlight/intel_backlight/brightness) 4 | 5 | echo "scale=2; ($BRIGHTNESS / 7500) * 100" | bc | sed 's/\..*$/%/' 6 | -------------------------------------------------------------------------------- /xorg.conf.d/90-deathadder.conf: -------------------------------------------------------------------------------- 1 | Section "InputClass" 2 | Identifier "DeathAdder" 3 | MatchProduct "Razer Razer DeathAdder 2013" 4 | Option "ConstantDeceleration" "1.85" 5 | EndSection 6 | -------------------------------------------------------------------------------- /.config/sxhkd/rz: -------------------------------------------------------------------------------- 1 | # 2 | # wm independent hotkeys 3 | # 4 | 5 | # terminal emulator 6 | super + Return 7 | urxvtc 8 | 9 | # program launcher 10 | super + d 11 | dmenu_run 12 | 13 | 14 | -------------------------------------------------------------------------------- /.vim/test/filenameWithSquareBrackets.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | Signs for fix[tu]re.txt: 4 | line=1 id=3000 name=GitGutterLineAdded 5 | line=2 id=3001 name=GitGutterLineAdded 6 | -------------------------------------------------------------------------------- /bin/statwrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cat /proc/stat | grep "^cpu" | awk '{print $1 " USER: " $2 " NICE: " $3 " SYS: " $4 " IDLE: " $5 " IOWAIT: " $6 " IRQ: " $7 " SOFTIRQ: " $8 " STEAL: " $9}' 4 | -------------------------------------------------------------------------------- /.config/sway/idle/suspend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # inhibited? 4 | ~/.config/sway/idle/inhibitors/ac.sh || exit 1 5 | ~/.config/sway/idle/inhibitors/pulse.sh || exit 1 6 | 7 | sudo systemctl suspend 8 | -------------------------------------------------------------------------------- /.vim/test/testHunkUndo.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | call Setup() 3 | 4 | normal 5Gi* 5 | execute 'GitGutterUndoHunk' 6 | call DumpSigns('hunkUndoSigns') 7 | call DumpGitDiffStaged('hunkUndoGitDiff') 8 | -------------------------------------------------------------------------------- /.config/i3/spacefn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | xmodmap ~/.Xmodmap 4 | xmodmap -e 'keycode 66 = 0x1234' 5 | xmodmap -e 'add control = 0x1234' 6 | xmodmap -e 'keycode any = space' 7 | 8 | xcape -e '0x1234=space' 9 | -------------------------------------------------------------------------------- /.config/sway/active_outputs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import i3ipc 3 | 4 | i3 = i3ipc.Connection() 5 | 6 | for output in [ o.name for o in i3.get_outputs() if o.active ]: 7 | print(output) 8 | 9 | -------------------------------------------------------------------------------- /.vim/ftplugin/swift.vim: -------------------------------------------------------------------------------- 1 | setlocal commentstring=//\ %s 2 | " @-@ adds the literal @ to iskeyword for @IBAction and similar 3 | setlocal iskeyword+=@-@,# 4 | setlocal completefunc=syntaxcomplete#Complete 5 | -------------------------------------------------------------------------------- /.vim/test/testHunkStage.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | call Setup() 3 | 4 | normal 5Gi* 5 | execute 'GitGutterStageHunk' 6 | call DumpSigns('hunkStageSigns') 7 | call DumpGitDiffStaged('hunkStageGitDiff') 8 | -------------------------------------------------------------------------------- /.vim/test/testUntrackedFileOutsideRepo.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | 3 | let tmpfile = tempname() 4 | call system('touch '.tmpfile) 5 | execute 'edit '.tmpfile 6 | call DumpSigns('untrackedFileOutsideRepo') 7 | -------------------------------------------------------------------------------- /.config/sway/idle/outputs_off.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # inhibited? 4 | #~/.config/sway/idle/inhibitors/ac.sh || exit 1 5 | ~/.config/sway/idle/inhibitors/pulse.sh || exit 1 6 | 7 | swaymsg "output * dpms off" 8 | -------------------------------------------------------------------------------- /.config/sway/autostart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | xrdb -merge ~/.Xresources & 4 | 5 | libinput-gestures-setup start & 6 | 7 | swaymsg -t subscribe -m '["window"]' | while read line; do pkill -SIGRTMIN+30 i3blocks; done & 8 | -------------------------------------------------------------------------------- /bin/charger.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -z "$1" ]; then 4 | echo "USAGE: $(basename "$0") [connected|disconnected]" 5 | exit 1 6 | fi 7 | 8 | STATUS=$1 9 | echo "$(date) ${STATUS}" >> /home/raidzero/.ac.log 10 | -------------------------------------------------------------------------------- /.vim/test/hunkStageNearbySigns.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | Signs for fixture.txt: 4 | line=3 id=3000 name=GitGutterLineAdded 5 | line=4 id=3001 name=GitGutterLineAdded 6 | line=5 id=3002 name=GitGutterLineAdded 7 | -------------------------------------------------------------------------------- /.vim/test/hunkUndoNearbySigns.expected: -------------------------------------------------------------------------------- 1 | 2 | --- Signs --- 3 | Signs for fixture.txt: 4 | line=3 id=3000 name=GitGutterLineAdded 5 | line=4 id=3001 name=GitGutterLineAdded 6 | line=5 id=3002 name=GitGutterLineAdded 7 | -------------------------------------------------------------------------------- /.config/i3/unhide.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ID=`xdotool getactivewindow` 4 | 5 | xprop -id $ID -f "_NET_WM_STATE" "32a" -remove "_NET_WM_STATE_HIDDEN" 6 | xprop -id $ID -f "_NET_WM_STATE" "32a" -set "_NET_WM_STATE" "_NET_WM_STATE_SHOWN" 7 | -------------------------------------------------------------------------------- /.vim/test/testKeepModified.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | call Setup() 3 | 4 | normal 5Go* 5 | call Dump("modified: ".getbufvar('', '&modified'), 'keepModified') 6 | doautocmd CursorHold 7 | call Dump("modified: ".getbufvar('', '&modified'), 'keepModified') 8 | 9 | -------------------------------------------------------------------------------- /.config/i3/launchx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # launches X on egpu, if present, or igpu if not 3 | 4 | EGPU_PRESENT=`lspci | grep -i nvidia` 5 | 6 | if [ -n "$EGPU_PRESENT" ]; then 7 | startx -- -config nvidia/xorg.nvidia.conf 8 | else 9 | startx 10 | fi 11 | -------------------------------------------------------------------------------- /.vim/plugin/airline-themes.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling & Contributors. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | if (exists('g:loaded_airline_themes') && g:loaded_airline_themes) 5 | finish 6 | endif 7 | let g:loaded_airline_themes = 1 8 | -------------------------------------------------------------------------------- /.vim/test/testEditAmbiguousFile.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | call Setup() 3 | 4 | normal 5Gi* 5 | call system('git checkout -b fixture.txt') 6 | write 7 | call DumpSigns('ambiguousFile') 8 | 9 | call system('git checkout - && git branch -d fixture.txt') 10 | -------------------------------------------------------------------------------- /.config/sway/bar.json: -------------------------------------------------------------------------------- 1 | {"version":1} 2 | [ 3 | []. 4 | 5 | [ 6 | { "full_text":"Home 84.0G Free", "color":"#00ffff", "align":"center" }, 7 | { "align":"left", "full_text":"RAM 32%" , "color":"#ffffff", "min_width":"RAM: 100ooooo%" } 8 | ] 9 | ] 10 | -------------------------------------------------------------------------------- /.vim/test/hunkStageGitDiff.expected: -------------------------------------------------------------------------------- 1 | diff --git a/test/fixture.txt b/test/fixture.txt 2 | index f5c6aff..ae8e546 100644 3 | --- a/test/fixture.txt 4 | +++ b/test/fixture.txt 5 | @@ -2,7 +2,7 @@ a 6 | b 7 | c 8 | d 9 | -e 10 | +*e 11 | f 12 | g 13 | h 14 | -------------------------------------------------------------------------------- /.vim/test/hunkStageNearbyGitDiff.expected: -------------------------------------------------------------------------------- 1 | diff --git a/test/fixture.txt b/test/fixture.txt 2 | index 53b13df..8fdfda7 100644 3 | --- a/test/fixture.txt 4 | +++ b/test/fixture.txt 5 | @@ -1,5 +1,8 @@ 6 | a 7 | b 8 | +x 9 | +y 10 | +z 11 | c 12 | e 13 | f 14 | -------------------------------------------------------------------------------- /.vim/test/hunkStageNearbyGitDiffStaged.expected: -------------------------------------------------------------------------------- 1 | diff --git a/test/fixture.txt b/test/fixture.txt 2 | index f5c6aff..53b13df 100644 3 | --- a/test/fixture.txt 4 | +++ b/test/fixture.txt 5 | @@ -1,7 +1,6 @@ 6 | a 7 | b 8 | c 9 | -d 10 | e 11 | f 12 | g 13 | -------------------------------------------------------------------------------- /.vim/test/hunkUndoNearbyGitDiff.expected: -------------------------------------------------------------------------------- 1 | diff --git a/test/fixture.txt b/test/fixture.txt 2 | index f5c6aff..3fbde56 100644 3 | --- a/test/fixture.txt 4 | +++ b/test/fixture.txt 5 | @@ -1,5 +1,8 @@ 6 | a 7 | b 8 | +x 9 | +y 10 | +z 11 | c 12 | d 13 | e 14 | -------------------------------------------------------------------------------- /.vim/test/testFollowSymlink.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | 3 | let tmpfile = 'symlink' 4 | call system('ln -nfs fixture.txt '.tmpfile) 5 | execute 'edit '.tmpfile 6 | execute '6d' 7 | write 8 | call DumpSigns('followSymlink') 9 | 10 | call system('rm '.tmpfile) 11 | -------------------------------------------------------------------------------- /bin/hdmivolume: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$1" == "get" ] || [ -z "$1" ]; then 4 | VOL=$(sudo ddcutil -b 4 getvcp 62 | cut -d ':' -f3 | grep -oE '[0-9]{1,3}' | head -n 1) 5 | echo "$VOL%" 6 | exit 0 7 | fi 8 | 9 | sudo ddcutil -b 4 setvcp 62 $1 10 | -------------------------------------------------------------------------------- /.vim/test/testFilenameWithSquareBrackets.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | 3 | edit fix[tu]re.txt 4 | normal ggo* 5 | write 6 | call DumpSigns('filenameWithSquareBrackets') 7 | 8 | call system('git reset HEAD fix[tu]re.txt') 9 | call system('git checkout fix[tu]re.txt') 10 | -------------------------------------------------------------------------------- /.vim/test/testHunkUndoNearbyHunk.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | call Setup() 3 | 4 | execute "normal! 2Gox\y\z" 5 | normal 2jdd 6 | normal k 7 | execute 'GitGutterUndoHunk' 8 | call DumpSigns('hunkUndoNearbySigns') 9 | call DumpGitDiff('hunkUndoNearbyGitDiff') 10 | -------------------------------------------------------------------------------- /.config/sway/idle/outputs_on.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | swaymsg "output * dpms on" 3 | 4 | 5 | if swaymsg -t get_outputs -r | grep 3840; then 6 | PREV_HDMI=$(cat /tmp/prev_hdmi_brightness) 7 | hdmibrightness $PREV_HDMI 8 | fi 9 | 10 | rm /tmp/sway_outputs.status 11 | -------------------------------------------------------------------------------- /.vim/test/testFilenameWithEquals.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | 3 | edit =fixture=.txt 4 | normal ggo* 5 | try 6 | write 7 | write 8 | call DumpSigns('filenameWithEquals') 9 | finally 10 | call system('git reset HEAD =fixture=.txt') 11 | call system('git checkout =fixture=.txt') 12 | endtry 13 | -------------------------------------------------------------------------------- /.vim/test/testUntrackedFileWithinRepo.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | 3 | let tmpfile = 'untrackedFileWithinRepo.tmp' 4 | call system('touch '.tmpfile) 5 | execute 'edit '.tmpfile 6 | normal ggo* 7 | doautocmd CursorHold 8 | call DumpSigns('untrackedFileWithinRepo') 9 | 10 | call system('rm '.tmpfile) 11 | -------------------------------------------------------------------------------- /.config/i3/musicwatcher.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Terminate already running instances 4 | killall -q python2 /home/raidzero/.config/i3/musicwatcher.py 5 | 6 | # Wait until the processes have been shut down 7 | while pgrep -x musicwatcher.py >/dev/null; do sleep 1; done 8 | 9 | ~/.config/i3/musicwatcher.py & 10 | -------------------------------------------------------------------------------- /.vim/example/URL.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | class Foo: FooViewController, BarScrollable { 4 | 5 | var canScroll = false 6 | 7 | override func viewDidLoad() { 8 | baseURL = "http://www.oaklandpostonline.com/search/?q=&t=article&c[]=blogs*" 9 | super.viewDidLoad() 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.vim/ftdetect/swift.vim: -------------------------------------------------------------------------------- 1 | autocmd BufNewFile,BufRead *.swift set filetype=swift 2 | autocmd BufRead * call s:Swift() 3 | function! s:Swift() 4 | if !empty(&filetype) 5 | return 6 | endif 7 | 8 | let line = getline(1) 9 | if line =~ "^#!.*swift" 10 | setfiletype swift 11 | endif 12 | endfunction 13 | -------------------------------------------------------------------------------- /.vim/test/testKeepAlt.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | call Setup() 3 | 4 | enew 5 | execute "normal! \" 6 | call Dump('buffer: '.bufname(''), 'keepAlt') 7 | call Dump('altbuffer: '.bufname('#'), 'keepAlt') 8 | 9 | normal ggx 10 | doautocmd CursorHold 11 | call Dump('altbuffer: '.bufname('#'), 'keepAlt') 12 | 13 | -------------------------------------------------------------------------------- /.vim/test/testHunkStageNearbyHunk.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | call Setup() 3 | 4 | execute "normal! 2Gox\y\z" 5 | normal 2jdd 6 | normal k 7 | execute 'GitGutterStageHunk' 8 | call DumpSigns('hunkStageNearbySigns') 9 | call DumpGitDiff('hunkStageNearbyGitDiff') 10 | call DumpGitDiffStaged('hunkStageNearbyGitDiffStaged') 11 | -------------------------------------------------------------------------------- /.vim/test/testUntrackedFileSquareBracketsWithinRepo.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | 3 | let tmpfile = '[un]trackedFileWithinRepo.tmp' 4 | call system('touch '.tmpfile) 5 | execute 'edit '.tmpfile 6 | normal ggo* 7 | doautocmd CursorHold 8 | call DumpSigns('untrackedFileSquareBracketsWithinRepo') 9 | 10 | call system('rm '.tmpfile) 11 | -------------------------------------------------------------------------------- /.vim/test/testFileAddedToGit.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | 3 | let tmpfile = 'fileAddedToGit.tmp' 4 | call system('touch '.tmpfile) 5 | call system('git add '.tmpfile) 6 | execute 'edit '.tmpfile 7 | normal ihello 8 | write 9 | call DumpSigns('fileAddedToGit') 10 | 11 | call system('git reset HEAD '.tmpfile) 12 | call system('rm '.tmpfile) 13 | -------------------------------------------------------------------------------- /.config/i3/kb-backlight.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CMD=$1 4 | 5 | if [ -z "$CMD" ]; then 6 | echo "Must provide command: up, down" 7 | exit 1 8 | fi 9 | 10 | case $CMD in 11 | up) 12 | ~/.config/i3/kb-light.py + ;; 13 | down) 14 | ~/.config/i3/kb-light.py - ;; 15 | esac 16 | 17 | dunstify -r 1002 "Keyboard brightness: `~/.config/i3/kb-light.py --get`" 18 | -------------------------------------------------------------------------------- /.vim/plugin/swift.vim: -------------------------------------------------------------------------------- 1 | let g:tagbar_type_swift = { 2 | \ 'ctagstype': 'swift', 3 | \ 'kinds': [ 4 | \ 'P:protocol', 5 | \ 'c:class', 6 | \ 's:struct', 7 | \ 'e:enum', 8 | \ 'E:extension', 9 | \ 'f:function', 10 | \ 't:typealias' 11 | \ ], 12 | \ 'sort': 0, 13 | \ 'deffile': expand(':p:h:h') . '/ctags/swift.cnf' 14 | \ } 15 | -------------------------------------------------------------------------------- /.vim/test/testKeepOpMarks.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | call Setup() 3 | 4 | normal 5Go* 5 | call Dump("'[ mark: ".join(getpos("'["), ','), 'keepOpMarks') 6 | call Dump("'] mark: ".join(getpos("']"), ','), 'keepOpMarks') 7 | doautocmd CursorHold 8 | call Dump("'[ mark: ".join(getpos("'["), ','), 'keepOpMarks') 9 | call Dump("'] mark: ".join(getpos("']"), ','), 'keepOpMarks') 10 | 11 | -------------------------------------------------------------------------------- /.vim/test/testHunkOutsideNoop.vim: -------------------------------------------------------------------------------- 1 | source helper.vim 2 | call Setup() 3 | 4 | normal 5G 5 | 6 | execute 'GitGutterStageHunk' 7 | call DumpSigns('hunkOutsideNoopStageSigns') 8 | call DumpGitDiffStaged('hunkHunkOutsideNoopStageGitDiffStaged') 9 | 10 | execute 'GitGutterUndoHunk' 11 | call DumpSigns('hunkOutsideNoopUndoSigns') 12 | call DumpGitDiffStaged('hunkHunkOutsideNoopUndoGitDiffStaged') 13 | 14 | -------------------------------------------------------------------------------- /.config/polybar/songname.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | WINDOW_DATA=`wmctrl -l | grep "Google Play Music"` 4 | 5 | if [ -z "$WINDOW_DATA" ]; then 6 | exit 1 7 | fi 8 | 9 | HOSTNAME=`hostname` 10 | 11 | echo "$WINDOW_DATA" | grep -oP '(?<='"$HOSTNAME"' ).*(?= - Google Play Music)' | awk \ 12 | -F ' - ' \ 13 | '{ 14 | if ($2 != "") { 15 | print "  " $2 " - " $1 16 | } else { 17 | print "" 18 | } 19 | }' 20 | -------------------------------------------------------------------------------- /.config/sway/idle/brightness.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char** argv) { 5 | if (argc != 2) { 6 | printf("brightness required.\n"); 7 | return 1; 8 | } 9 | 10 | FILE* fp = fopen("/sys/class/backlight/intel_backlight/brightness", "w"); 11 | 12 | if (fp != NULL) { 13 | fprintf(fp, "%d", atoi(argv[1])); 14 | fclose(fp); 15 | } 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /bin/hdmibrightness: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | I2C_BUS=4 4 | 5 | if [[ $(lspci | grep -i "gtx 1060") ]]; then 6 | I2C_BUS=12 7 | fi 8 | 9 | # only run if this is the active input 10 | sudo ddcutil getvcp 60 | grep DisplayPort-1 &> /dev/null || exit 0 11 | 12 | if [ "$1" == "get" ]; then 13 | sudo ddcutil -b 4 getvcp 10 | cut -d '=' -f2 | cut -d ',' -f1 | sed 's/^ *//g' 14 | else 15 | sudo ddcutil -b $I2C_BUS setvcp 10 $1 --noverify 16 | fi 17 | -------------------------------------------------------------------------------- /.vim/lib/nerdtree/event.vim: -------------------------------------------------------------------------------- 1 | "CLASS: Event 2 | "============================================================ 3 | let s:Event = {} 4 | let g:NERDTreeEvent = s:Event 5 | 6 | function! s:Event.New(nerdtree, subject, action, params) abort 7 | let newObj = copy(self) 8 | let newObj.nerdtree = a:nerdtree 9 | let newObj.subject = a:subject 10 | let newObj.action = a:action 11 | let newObj.params = a:params 12 | return newObj 13 | endfunction 14 | -------------------------------------------------------------------------------- /.config/i3/restore_session_prompt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | HIST=~/.cache/i3 3 | 4 | if [ -f $HIST/apps.running ] && [ -f $HIST/session.json ]; then 5 | Xdialog --title "Restore previous session?" \ 6 | --yesno "There is previous session data available. Would you like to restore it?" \ 7 | 10 80 8 | 9 | case $? in 10 | 0) 11 | ~/.config/i3/i3session restore 12 | ;; 13 | 1) 14 | exit 0 15 | ;; 16 | 255) 17 | exit 0 18 | ;; 19 | esac 20 | fi 21 | -------------------------------------------------------------------------------- /.config/sway/idle/brighten_screen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | BRIGHTNESS_FILE="/sys/class/backlight/intel_backlight/brightness" 3 | PREV=$(cat /tmp/prev_brightness) 4 | 5 | ~/.config/sway/idle/brightness $PREV 6 | 7 | pkill -SIGRTMIN+20 i3blocks 8 | 9 | if swaymsg -t get_outputs -r | grep 3840; then 10 | PREV_HDMI=$(cat /tmp/prev_hdmi_brightness) 11 | echo "$(date) prev brightness: ${PREV_HDMI}" >> /tmp/brightness.log 12 | hdmibrightness $PREV_HDMI 13 | fi 14 | -------------------------------------------------------------------------------- /bin/fix_links.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BAD_LINKS=`ldd $1 | grep "not found" | cut -d ' ' -f1| sed 's/^[\t]*//g'` 4 | 5 | for LN in `echo "${BAD_LINKS}"`; do 6 | NAME=`echo "$LN" | sed 's/\.so.*$/.so/'` 7 | 8 | echo "Attemtping to fix $LN version $NAME" 9 | 10 | if [ -e /usr/lib/$NAME ] && [ ! -e /usr/lib/$LN ]; then 11 | sudo ln -s /usr/lib/$NAME /usr/lib/$LN 12 | else 13 | echo "Could not create link. /usr/lib/$NAME does not exist." 14 | fi 15 | done 16 | -------------------------------------------------------------------------------- /.config/sway/startsway: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export XKB_DEFAULT_OPTIONS=caps:super 3 | export XKB_DEFAULT_LAYOUT=us 4 | 5 | export _JAVA_AWT_WM_NONREPARENTING=1 6 | export QT_QPA_PLATFORM=wayland-egl 7 | export QT_STYLE_OVERRIDE=gtk2 8 | export SDL_VIDEODRIVER=wayland 9 | 10 | # firefox smooth scroll 11 | export MOZ_USE_XINPUT2=1 12 | sway 13 | #sway -d 2> ~/sway.log 14 | 15 | if [ $? -ne 0 ];then 16 | echo "Sway exited abnormally." 17 | sudo systemctl poweroff 18 | fi 19 | -------------------------------------------------------------------------------- /.config/polybar/gmusic.awk: -------------------------------------------------------------------------------- 1 | BEGIN { 2 | MUSIC_WINDOW_FOUND = 0 3 | 4 | while("wmctrl -l" | getline DATA) { 5 | if (DATA ~ /Google Play Music/) { 6 | MUSIC_WINDOW_FOUND = 1 7 | 8 | match(DATA, /chromebook * *(.*) *- *Google Play Music/, a) 9 | LEN = split(a[1], SONGDATA, " - ") 10 | 11 | if (LEN == 2) { 12 | print " "SONGDATA[2] " - " SONGDATA[1] 13 | } else { 14 | print "" 15 | } 16 | 17 | exit 0 18 | } 19 | } 20 | 21 | if (MUSIC_WINDOW_FOUND == 0) { 22 | exit 1 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /bin/snes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | SNES=zsnes 3 | 4 | METROID=$1 5 | 6 | if [ -n "$METROID" ]; then 7 | ROMPATH="$HOME/roms/SNES/metroid" 8 | else 9 | ROMPATH="$HOME/roms/SNES" 10 | fi 11 | 12 | ROMS=$(ls "$ROMPATH" | grep "\.zip$" | sed 's/\.zip//g') 13 | 14 | SELECTED=$(echo "$ROMS" | dmenu -i -nb '#000000' -nf '#ffffff' -sb '#ff00ff' -sf '#000000' -fn 'Inconsolata 11') 15 | 16 | if [ -n "$SELECTED" ]; then 17 | echo "LAUNCHING:" 18 | ls -l "${ROMPATH}/${SELECTED}.zip" 19 | 20 | $SNES "${ROMPATH}/${SELECTED}.zip" 21 | fi 22 | -------------------------------------------------------------------------------- /bin/sysmenu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DMENU="dmenu -nb #000000 -nf #ffffff -sb #ff00ff -sf #000000 -fn Inconsolata-11" 4 | disp="lock\npoweroff\nreboot\nhibernate\nsleep" 5 | 6 | CMD=$(echo -e "$disp" | $DMENU) 7 | echo $CMD 8 | 9 | case $CMD in 10 | "lock") 11 | ~/.config/i3/lockscreen;; 12 | "poweroff") 13 | sudo shutdown -P now;; 14 | "reboot") 15 | sudo reboot now;; 16 | "sleep") 17 | sudo systemctl suspend;; 18 | "hibernate") 19 | sudo systemctl hibernate;; 20 | esac 21 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/capslock.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2014 Mathias Andersson. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | if !exists('*CapsLockStatusline') 7 | finish 8 | endif 9 | 10 | function! airline#extensions#capslock#status() 11 | return tolower(CapsLockStatusline()) == '[caps]' ? 'CAPS' : '' 12 | endfunction 13 | 14 | function! airline#extensions#capslock#init(ext) 15 | call airline#parts#define_function('capslock', 'airline#extensions#capslock#status') 16 | endfunction 17 | 18 | -------------------------------------------------------------------------------- /.vim/.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | before_install: 3 | - curl -f -L "https://raw.githubusercontent.com/vim-airline/vim-airline-themes/master/autoload/airline/themes/simple.vim" -o autoload/airline/themes/simple.vim 4 | - curl -f -L "https://raw.githubusercontent.com/vim-airline/vim-airline-themes/master/autoload/airline/themes/molokai.vim" -o autoload/airline/themes/molokai.vim 5 | - mkdir colors && curl -f -L 'https://raw.githubusercontent.com/tomasr/molokai/master/colors/molokai.vim' -o colors/molokai.vim 6 | rvm: 7 | - 1.9.3 8 | script: rake ci 9 | -------------------------------------------------------------------------------- /.config/i3/google_search.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | query=`i3-input -P "Search query: " | grep command | awk -F 'command = ' '{print$2}'` 4 | 5 | if [ -n "${query}" ]; then 6 | # chromium running? get its window id 7 | ID=`wmctrl -l | grep Chromium | cut -d' ' -f1` 8 | 9 | if [ -z "$ID" ]; then 10 | # no. switch to www workspace 11 | i3-msg workspace '3:www' 12 | else 13 | # yes. focus it 14 | i3-msg '[id='"$ID"'] focus' 15 | fi 16 | 17 | # open a new google search with the query :) 18 | chromium https://google.com/search?q="${query}" 19 | fi 20 | -------------------------------------------------------------------------------- /.config/sway/idle/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIM_TIMEOUT=60 # one minute 4 | let LOCK_TIMEOUT=$DIM_TIMEOUT+120 5 | let DPMS_TIMEOUT=$LOCK_TIMEOUT+60 6 | let SUSPEND_TIMEOUT=$DPMS_TIMEOUT+60 7 | 8 | IDLE=~/.config/sway/idle 9 | 10 | 11 | swayidle \ 12 | timeout $DIM_TIMEOUT "$IDLE/dim_screen.sh" \ 13 | resume "$IDLE/brighten_screen.sh" \ 14 | timeout $LOCK_TIMEOUT "$IDLE/lock.sh" \ 15 | timeout $DPMS_TIMEOUT "$IDLE/outputs_off.sh" \ 16 | resume "$IDLE/outputs_on.sh" \ 17 | timeout $SUSPEND_TIMEOUT "$IDLE/suspend.sh" 18 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/commandt.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | if !get(g:, 'command_t_loaded', 0) 7 | finish 8 | endif 9 | 10 | function! airline#extensions#commandt#apply(...) 11 | if bufname('%') ==# 'GoToFile' 12 | call airline#extensions#apply_left_override('CommandT', '') 13 | endif 14 | endfunction 15 | 16 | function! airline#extensions#commandt#init(ext) 17 | call a:ext.add_statusline_func('airline#extensions#commandt#apply') 18 | endfunction 19 | -------------------------------------------------------------------------------- /.vim/test/test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | VIM="/Applications/MacVim.app/Contents/MacOS/Vim -v" 4 | 5 | export VIM_GITGUTTER_TEST=1 6 | 7 | $VIM -u NONE -U NONE -N \ 8 | --cmd 'set rtp+=../' \ 9 | --cmd 'let g:gitgutter_async=0' \ 10 | --cmd 'source ../plugin/gitgutter.vim' \ 11 | -S runner.vim \ 12 | test_*.vim \ 13 | $* 14 | 15 | cat messages.log 16 | 17 | grep -q "0 errors, 0 failures" messages.log 18 | status=$? 19 | rm messages.log 20 | exit $status 21 | 22 | -------------------------------------------------------------------------------- /.config/bspwm/bspwmrc: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # if 4k, start everything in floating mode 3 | [[ $(xdpyinfo | grep -i 3840x2160) ]] && bspc rule -a "*" state=floating follow=on 4 | 5 | sxhkd & 6 | 7 | bspc config focus_follows_pointer true 8 | bspc config click_to_focus true 9 | 10 | bspc monitor -d I II III IV V VI VII VIII IX X 11 | 12 | bspc config border_width 0 13 | bspc config window_gap 10 14 | 15 | bspc config split_ratio 0.52 16 | bspc config borderless_monocle true 17 | bspc config gapless_monocle true 18 | bspc config single_monocle true 19 | 20 | sh ~/.config/i3/autostart.sh & 21 | -------------------------------------------------------------------------------- /.config/i3/save_session.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | LAYOUT_DIR=~/.config/i3/layout 3 | 4 | [ -d "$LAYOUT_DIR" ] && rm -rf "$LAYOUT_DIR" 5 | mkdir "$LAYOUT_DIR" 6 | 7 | WORKSPACES=$(i3-msg -t get_workspaces | jq '.[] .name') 8 | 9 | echo "$WORKSPACES" > "$LAYOUT_DIR/ws.names" 10 | 11 | WS_NUM=0 12 | for WS in $(echo "$WORKSPACES"); do 13 | let WS_NUM+=1 14 | OUTPUT=$LAYOUT_DIR/$WS_NUM.layout 15 | echo "saving layout on workspace $WS to $OUTPUT" 16 | i3-save-tree --workspace $WS | sed -E 's_^[[:blank:]]*//( ?[a-z:=0-9_ ]+)?__g' >> $OUTPUT 17 | SIZE=$(wc -c < $OUTPUT) 18 | 19 | echo "saved $SIZE bytes" 20 | 21 | done 22 | -------------------------------------------------------------------------------- /.vim/ctags/swift.cnf: -------------------------------------------------------------------------------- 1 | --langdef=swift 2 | --langmap=swift:.swift 3 | --regex-swift=/[[:<:]]class[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/c,class/ 4 | --regex-swift=/[[:<:]]enum[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/e,enum/ 5 | --regex-swift=/[[:<:]]func[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/f,function/ 6 | --regex-swift=/[[:<:]]protocol[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/P,protocol/ 7 | --regex-swift=/[[:<:]]struct[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/s,struct/ 8 | --regex-swift=/[[:<:]]extension[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/E,extension/ 9 | --regex-swift=/[[:<:]]typealias[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/t,typealias/ 10 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/syntastic.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | if !exists(':SyntasticCheck') 7 | finish 8 | endif 9 | 10 | function! airline#extensions#syntastic#get_warnings() 11 | let errors = SyntasticStatuslineFlag() 12 | if strlen(errors) > 0 13 | return errors.(g:airline_symbols.space) 14 | endif 15 | return '' 16 | endfunction 17 | 18 | function! airline#extensions#syntastic#init(ext) 19 | call airline#parts#define_function('syntastic', 'airline#extensions#syntastic#get_warnings') 20 | endfunction 21 | 22 | -------------------------------------------------------------------------------- /.config/i3/run_and_record.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | HIST_DIR=~/.cache/i3/hist 3 | [ ! -d "$HIST_DIR" ] && mkdir -p "$HIST_DIR" 4 | 5 | if (( $# == 0 )); then 6 | read DATA # assume data has been piped in 7 | PROGRAM_NAME=$(echo "$DATA" | cut -d ' ' -f1) 8 | else 9 | DATA="$@" 10 | PROGRAM_NAME="$1" 11 | fi 12 | 13 | # do we already have one of these running? 14 | INST_NUM=1 15 | if [ -e "$HIST_DIR"/"$PROGRAM_NAME"-* ]; then 16 | INST_NUM=$(ls "$HIST_DIR/$PROGRAM_NAME-*" | tail -n 1 | grep -oE "[0-9]+$") 17 | (( INST_NUM++ )) 18 | fi 19 | 20 | echo "$DATA" > "$HIST_DIR"/"$PROGRAM_NAME-$INST_NUM" 21 | eval "$DATA" && rm "$HIST_DIR"/"$PROGRAM_NAME-$INST_NUM" 22 | -------------------------------------------------------------------------------- /bin/git-fshow: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | # git-fshow - git commit browser 3 | # 4 | # https://gist.github.com/akatrevorjay/9fc061e8371529c4007689a696d33c62 5 | # https://asciinema.org/a/101366 6 | # 7 | 8 | git-fshow() { 9 | local g=( 10 | git log 11 | --graph 12 | --format='%C(auto)%h%d %s %C(white)%C(bold)%cr' 13 | --color=always 14 | "$@" 15 | ) 16 | 17 | local fzf=( 18 | fzf 19 | --ansi 20 | --reverse 21 | --tiebreak=index 22 | --no-sort 23 | --bind=ctrl-s:toggle-sort 24 | --preview 'f() { set -- $(echo -- "$@" | grep -o "[a-f0-9]\{7\}"); [ $# -eq 0 ] || git show --color=always $1; }; f {}' 25 | ) 26 | $g | $fzf 27 | } 28 | git-fshow "$@" 29 | -------------------------------------------------------------------------------- /bin/shortenPath.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # shortens a path like vim airline 3 | 4 | DISP=$1 5 | LENGTH=$2 6 | 7 | SHORTENED=$DISP 8 | 9 | if [[ $SHORTENED =~ ^$HOME ]]; then 10 | SHORTENED=`echo "$SHORTENED" | sed 's_'"$HOME"'_~_'` 11 | fi 12 | 13 | LEN=`echo "$SHORTENED" | wc -c` 14 | 15 | if [ "$LEN" -ge $LENGTH ]; then 16 | SHORTENED=`echo "$SHORTENED" | sed 's_/\(.\)[^/]*_/\1_g'` 17 | SHORTENED=${SHORTENED::-1} 18 | SHORTENED="$SHORTENED`echo $DISP | awk -F '/' '{print$NF}'`" 19 | fi 20 | 21 | 22 | # print in red if not in a writable path 23 | #if [ ! -w "$DISP" ]; then 24 | # echo -e "\e[1;31m${SHORTENED}" 25 | #else 26 | echo $SHORTENED 27 | #fi 28 | -------------------------------------------------------------------------------- /bin/bat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | current=`grep remaining /proc/acpi/battery/BAT0/state | tr -d A-z | tr -d " " | tr -d :` 4 | 5 | total=`grep "design capacity:" /proc/acpi/battery/BAT0/info | tr -d A-z | tr -d " " | tr -d :` 6 | 7 | rate=`grep "present rate:" /proc/acpi/battery/BAT0/state | tr -d A-z | tr -d " " | tr -d :` 8 | 9 | percent=`bc << EOF 10 | 100.0 * $current / $total 11 | EOF 12 | 13 | if [ $rate -eq 0 ]; then 14 | echo $percent'%, charging' 15 | else 16 | hours=`bc << EOF 17 | (1.0*$current) / (1.0*$rate) 18 | EOF 19 | 20 | minutes=`bc << EOF 21 | 60.0 * $current / $rate - $hours * 60 22 | EOF 23 | 24 | echo $percent'%, '$hours':'$minutes 25 | fi 26 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/obsession.vim: -------------------------------------------------------------------------------- 1 | " vim: et ts=2 sts=2 sw=2 2 | 3 | scriptencoding utf-8 4 | 5 | if !exists('*ObsessionStatus') 6 | finish 7 | endif 8 | 9 | let s:spc = g:airline_symbols.space 10 | 11 | if !exists('g:airline#extensions#obsession#indicator_text') 12 | let g:airline#extensions#obsession#indicator_text = '$' 13 | endif 14 | 15 | function! airline#extensions#obsession#init(ext) 16 | call airline#parts#define_function('obsession', 'airline#extensions#obsession#get_status') 17 | endfunction 18 | 19 | function! airline#extensions#obsession#get_status() 20 | return ObsessionStatus((g:airline#extensions#obsession#indicator_text . s:spc), '') 21 | endfunction 22 | 23 | -------------------------------------------------------------------------------- /.Xresources-cyan: -------------------------------------------------------------------------------- 1 | ! special 2 | *.foreground: #ffffff 3 | *.background: #000000 4 | *.cursorColor: #cc00ff 5 | 6 | ! black 7 | *.color0: #1c1c1c 8 | *.color8: #00d7ff 9 | 10 | ! red 11 | *.color1: #ff00ff 12 | *.color9: #d700ff 13 | 14 | ! green 15 | *.color2: #00afaf 16 | *.color10: #00afd7 17 | 18 | ! yellow 19 | *.color3: #0087af 20 | *.color11: #5f5fff 21 | 22 | ! blue 23 | *.color4: #5f5faf 24 | *.color12: #ff5fff 25 | 26 | ! magenta 27 | *.color5: #d75fff 28 | *.color13: #00d7ff 29 | 30 | ! cyan 31 | *.color6: #00afff 32 | *.color14: #00ffff 33 | 34 | ! white 35 | *.color7: #808080 36 | *.color15: #ccffff 37 | 38 | -------------------------------------------------------------------------------- /.Xresources-green: -------------------------------------------------------------------------------- 1 | ! special 2 | 3 | *.foreground: #ffffff 4 | *.background: #2e3440 5 | *.cursorColor: #ffffff 6 | 7 | ! black 8 | *.color0: #2e3440 9 | *.color8: #707f9c 10 | 11 | ! red 12 | *.color1: #84d498 13 | *.color9: #84d498 14 | 15 | ! green 16 | *.color2: #1cfa67 17 | *.color10: #1cfa67 18 | 19 | ! yellow 20 | *.color3: #85fa8d 21 | *.color11: #85fa86 22 | 23 | ! blue 24 | *.color4: #1aa662 25 | *.color12: #1aa662 26 | 27 | ! magenta 28 | *.color5: #23ff77 29 | *.color13: #23ff77 30 | 31 | ! cyan 32 | *.color6: #50fa7b 33 | *.color14: #50fa7b 34 | 35 | ! white 36 | *.color7: #707f9c 37 | *.color15: #ffffff 38 | -------------------------------------------------------------------------------- /.vim/unplace.vim: -------------------------------------------------------------------------------- 1 | " Measure how long it takes to unplace signs. 2 | " 3 | " Source this file with `:source %` or `vim -S unplace.vim` 4 | 5 | 6 | let num = 500 7 | sign define Foo text=* 8 | 9 | new 10 | 11 | call append(0, range(1, num)) 12 | 13 | for i in range(1, num) 14 | execute "sign place ".i." line=".i." name=Foo buffer=".bufnr('') 15 | endfor 16 | 17 | let start = reltime() 18 | for i in range(1, num) 19 | execute "sign unplace ".i 20 | endfor 21 | let elapsed = reltime(start) 22 | 23 | bdelete! 24 | 25 | echom split(reltimestr(elapsed))[0]."s to remove ".num." signs" 26 | echom string(reltimefloat(elapsed) * 1000 / num).' ms/sign' 27 | echom string(float2nr(num / reltimefloat(elapsed))).' sign/s' 28 | -------------------------------------------------------------------------------- /.config/sway/move_workspaces.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import i3ipc 3 | import sys 4 | import time 5 | 6 | OUTPUT=sys.argv[1] 7 | 8 | if OUTPUT.startswith('e'): 9 | OTHER_OUTPUT = 'DP-1' 10 | else: 11 | OTHER_OUTPUT = 'eDP-1' 12 | 13 | i3 = i3ipc.Connection() 14 | 15 | # get current ws name so we can switch back to it afterwards 16 | activews = [ws.name for ws in i3.get_workspaces() if ws.focused][0] 17 | i3.command("output %s enable" % OUTPUT) 18 | 19 | for ws in i3.get_workspaces(): 20 | i3.command("workspace %s" % ws.name) 21 | i3.command("move workspace to output %s" % OUTPUT) 22 | 23 | i3.command("workspace %s" % activews) 24 | 25 | time.sleep(1) 26 | i3.command("output %s disable" % OTHER_OUTPUT) 27 | -------------------------------------------------------------------------------- /.vim/test/README.markdown: -------------------------------------------------------------------------------- 1 | ## Testing vim-gitgutter 2 | 3 | ### Run the tests 4 | 5 | ```sh 6 | $ cd test 7 | $ ./test 8 | ``` 9 | 10 | ### Add a new test 11 | 12 | - Add a test file named like `testFoo.vim`. It should have this structure: 13 | 14 | ```viml 15 | source helper.vim 16 | call Setup() 17 | 18 | " test code here 19 | ``` 20 | 21 | - Run the tests. 22 | - Inspect output (in `foo.actual`) from the new test. If good, copy it to `foo.expected`. 23 | - Run the tests to ensure new test's output is verified. 24 | - Commit changes. 25 | 26 | ### Limitations 27 | 28 | - Currently tests are done by writing out a file and comparing it to a known good one. 29 | - There's no support for assertions within the testcase code. 30 | 31 | -------------------------------------------------------------------------------- /.config/i3/polybar-dev.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Terminate already running bar instances 4 | killall -q polybar 5 | 6 | # Wait until the processes have been shut down 7 | while pgrep -x polybar >/dev/null; do sleep 1; done 8 | 9 | if [ "$HOSTNAME" == "chromebook" ] || [ "$HOSTNAME" == "archvm" ] || [ "$HOSTNAME" == "xps13" ]; then 10 | CONFIG=~/.config/polybar/laptop-dev 11 | else 12 | CONFIG=~/.config/polybar/native 13 | fi 14 | 15 | # run the same bar on all monitors 16 | for OUTPUT in $(xrandr | grep " connected" | cut -d ' ' -f1); do 17 | echo "MONITOR=$OUTPUT ~/Projects/polybar/build/bin/polybar -c $CONFIG top &" 18 | MONITOR="$OUTPUT" ~/Projects/polybar/build/bin/polybar -c $CONFIG top & 19 | echo "$CONFIG launched on $OUTPUT" 20 | done 21 | 22 | -------------------------------------------------------------------------------- /.config/i3/polybar.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Terminate already running bar instances 4 | killall -q polybar 5 | 6 | # Wait until the processes have been shut down 7 | while pgrep -x polybar >/dev/null; do sleep 1; done 8 | 9 | if [ "$HOSTNAME" == "chromebook" ] || [ "$HOSTNAME" == "archvm" ] || [ "$HOSTNAME" == "xps" ]; then 10 | CONFIG=~/.config/polybar/laptop 11 | else 12 | CONFIG=~/.config/polybar/native 13 | fi 14 | 15 | # run the same bar on all monitors 16 | #for OUTPUT in $(polybar -m | cut -d ':' -f1); do 17 | # echo "MONITOR=$OUTPUT /usr/bin/polybar -c $CONFIG top &" 18 | # MONITOR="$OUTPUT" /usr/bin/polybar -c $CONFIG top &>> ~/.polybar.log & 19 | # echo "$CONFIG launched on $OUTPUT" 20 | #done 21 | polybar -c $CONFIG top & >> ~/.polybar.log & 22 | -------------------------------------------------------------------------------- /.config/i3/lockscreen: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # determine screen res 4 | RES=`xdpyinfo | grep dimensions` 5 | 6 | # 1440? 7 | if [[ $RES =~ 2160 ]]; then 8 | RES=2160 9 | else 10 | RES=1200 11 | fi 12 | 13 | 14 | # i3lock not already running? 15 | if [ ! $(ps -ef | grep -E "(i3|sway)lock" | grep -v lock) ]; then 16 | if [[ ! $(pidof sway) ]]; then 17 | /home/raidzero/Downloads/i3lock-lixxia/i3lock -c '#000000' -l '#ffffff' -i /home/raidzero/wallpapers/trust_the_computer-$RES.png -e 18 | xset dpms force off 19 | else 20 | swaylock -i /home/raidzero/wallpapers/trust_the_computer-$RES.png --ring-color 'ffffff' --line-color 'ffffff' --text-color 'ffffff' & 21 | sleep 1 22 | #~/.config/sway/toggle_active_outputs.py idle 23 | fi 24 | fi 25 | 26 | -------------------------------------------------------------------------------- /.vim/test/helper.vim: -------------------------------------------------------------------------------- 1 | set runtimepath+=../ 2 | source ../plugin/gitgutter.vim 3 | 4 | function! Setup() 5 | edit! fixture.txt 6 | sign unplace * 7 | endfunction 8 | 9 | function! DumpSigns(filename) 10 | execute 'redir! > ' a:filename.'.actual' 11 | silent execute 'sign place' 12 | redir END 13 | endfunction 14 | 15 | function! DumpGitDiff(filename) 16 | call system('git diff fixture.txt > '.a:filename.'.actual') 17 | endfunction 18 | 19 | function! DumpGitDiffStaged(filename) 20 | call system('git diff --staged fixture.txt > '.a:filename.'.actual') 21 | endfunction 22 | 23 | function! Dump(text, filename) 24 | let msg = type(a:text) == 1 ? split(a:text, '\n') : a:text 25 | call writefile(msg, a:filename.'.actual', 'a') 26 | endfunction 27 | 28 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/ctrlspace.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | let s:spc = g:airline_symbols.space 7 | let s:padding = s:spc . s:spc . s:spc 8 | 9 | function! airline#extensions#ctrlspace#statusline(...) 10 | let b = airline#builder#new({ 'active': 1 }) 11 | call b.add_section('airline_b', '⌗' . s:padding . ctrlspace#api#StatuslineModeSegment(s:padding)) 12 | call b.split() 13 | call b.add_section('airline_x', s:spc . ctrlspace#api#StatuslineTabSegment() . s:spc) 14 | return b.build() 15 | endfunction 16 | 17 | function! airline#extensions#ctrlspace#init(ext) 18 | let g:CtrlSpaceStatuslineFunction = "airline#extensions#ctrlspace#statusline()" 19 | endfunction 20 | -------------------------------------------------------------------------------- /.config/polybar/gmusic.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | ## - this script uses i3 IPC to look for a google music window and pulls the name of the song and artist 4 | 5 | import i3ipc 6 | import re 7 | import sys 8 | 9 | def getSong(windowName): 10 | m = re.search('(.*) *- *(.*) * - *Google Play Music$', windowName) 11 | if m and m.group(1) and m.group(2): 12 | print "♪ {} - {}".format(m.group(2), m.group(1)) 13 | sys.exit(0) 14 | else: 15 | print "" 16 | sys.exit(1) 17 | 18 | # main 19 | i3 = i3ipc.Connection() 20 | tree = i3.get_tree() 21 | 22 | for window in tree.leaves(): 23 | m = re.search('Google Play Music', window.name) 24 | if m: 25 | print getSong(window.name) 26 | 27 | # if we get here, then nothing has been found 28 | sys.exit(1) 29 | -------------------------------------------------------------------------------- /.vim/t/highlighter.vim: -------------------------------------------------------------------------------- 1 | let g:airline_theme = 'dark' 2 | 3 | describe 'highlighter' 4 | it 'should create separator highlight groups' 5 | hi Foo1 ctermfg=1 ctermbg=2 6 | hi Foo2 ctermfg=3 ctermbg=4 7 | call airline#highlighter#add_separator('Foo1', 'Foo2', 0) 8 | let hl = airline#highlighter#get_highlight('Foo1_to_Foo2') 9 | Expect hl == [ '', '', '4', '2', '' ] 10 | end 11 | 12 | it 'should populate accent colors' 13 | Expect exists('g:airline#themes#dark#palette.normal.airline_c_red') to_be_false 14 | Expect hlID('airline_c_red') == 0 15 | call airline#themes#patch(g:airline#themes#dark#palette) 16 | call airline#highlighter#add_accent('red') 17 | call airline#highlighter#highlight(['normal']) 18 | Expect hlID('airline_c_red') != 0 19 | end 20 | end 21 | 22 | -------------------------------------------------------------------------------- /.config/i3/autostart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | xrdb -merge ~/.Xresources 4 | setxkbmap -option 'caps:super' 5 | xset r rate 300 30 6 | 7 | export QT_QPA_PLATFORMTHEME=qt5ct 8 | 9 | urxvtd & 10 | if [ "$HOSTNAME" == "xps" ]; then 11 | ~/Projects/idled/idled & 12 | compton --config ~/.config/compton/compton.conf -b 13 | fi 14 | 15 | sh ~/.fehbg & # set background 16 | 17 | # touchpad gestures! 18 | libinput-gestures-setup start & 19 | 20 | urxvtc -name urxvt_scratchpad -title ScratchPad & 21 | 22 | ~/.config/i3/musicwatcher.sh & 23 | 24 | ~/.config/i3/polybar.sh & 25 | 26 | ~/.config/i3/restore_session_prompt.sh & 27 | 28 | sleep 10 # wait ten seconds? idk why but its needed 29 | /usr/lib/geoclue-2.0/demos/agent & # start geo clue agent 30 | pgrep redshift &> /dev/null || redshift -v -c ~/.config/redshift.conf & 31 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/unicode.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | if !get(g:, 'loaded_unicodePlugin', 0) 7 | finish 8 | endif 9 | 10 | function! airline#extensions#unicode#apply(...) 11 | if exists(":UnicodeTable") == 2 && bufname('') ==# 'UnicodeTable' 12 | call airline#parts#define('unicode', { 13 | \ 'text': '[UnicodeTable]', 14 | \ 'accent': 'bold' }) 15 | let w:airline_section_a = airline#section#create(['unicode']) 16 | let w:airline_section_b = '' 17 | let w:airline_section_c = '' 18 | let w:airline_section_y = '' 19 | endif 20 | endfunction 21 | 22 | function! airline#extensions#unicode#init(ext) 23 | call a:ext.add_statusline_func('airline#extensions#unicode#apply') 24 | endfunction 25 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/xkblayout.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2017 YoungHoon Rhiu. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | if !exists('g:XkbSwitchLib') 7 | finish 8 | endif 9 | 10 | function! airline#extensions#xkblayout#status() 11 | let keyboard_layout = libcall(g:XkbSwitchLib, 'Xkb_Switch_getXkbLayout', '') 12 | let keyboard_layout = split(keyboard_layout, '\.')[-1] 13 | let short_codes = {'2SetKorean': 'KR', 'Chinese': 'CN', 'Japanese': 'JP'} 14 | 15 | if has_key(short_codes, keyboard_layout) 16 | let keyboard_layout = short_codes[keyboard_layout] 17 | endif 18 | 19 | return keyboard_layout 20 | endfunction 21 | 22 | function! airline#extensions#xkblayout#init(ext) 23 | call airline#parts#define_function('xkblayout', 'airline#extensions#xkblayout#status') 24 | endfunction 25 | 26 | -------------------------------------------------------------------------------- /.config/sway/idle/dim_screen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ~/.config/sway/idle/inhibitors/pulse.sh || exit 1 3 | echo "$(date) dim_screen.sh running" >> /tmp/brightness.log 4 | 5 | if swaymsg -t get_outputs -r | grep 3840; then 6 | hdmibrightness get > /tmp/prev_hdmi_brightness 7 | hdmibrightness 0 8 | fi 9 | 10 | # inhibited by AC or pulse? 11 | ~/.config/sway/idle/inhibitors/ac.sh || exit 1 12 | 13 | BRIGHTNESS_FILE="/sys/class/backlight/intel_backlight/brightness" 14 | MAX_BRIGHTNESS_FILE="/sys/class/backlight/intel_backlight/max_brightness" 15 | MAX=$(cat $MAX_BRIGHTNESS_FILE) 16 | cat $BRIGHTNESS_FILE > /tmp/prev_brightness 17 | 18 | 19 | let IDLE_BRIGHTNESS=$MAX/200 # 0.5% 20 | echo "wrote brightness 10% ($IDLE_BRIGHTNESS}. max: $MAX" >> /tmp/brightness.log 21 | ~/.config/sway/idle/brightness $IDLE_BRIGHTNESS 22 | pkill -SIGRTMIN+20 i3blocks 23 | 24 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/monochrome.vim: -------------------------------------------------------------------------------- 1 | let g:airline#themes#monochrome#palette = {} 2 | 3 | function! airline#themes#monochrome#refresh() 4 | let s:SL = airline#themes#get_highlight('StatusLine') 5 | let g:airline#themes#monochrome#palette.normal = airline#themes#generate_color_map(s:SL, s:SL, s:SL) 6 | let g:airline#themes#monochrome#palette.insert = g:airline#themes#monochrome#palette.normal 7 | let g:airline#themes#monochrome#palette.replace = g:airline#themes#monochrome#palette.normal 8 | let g:airline#themes#monochrome#palette.visual = g:airline#themes#monochrome#palette.normal 9 | 10 | let s:SLNC = airline#themes#get_highlight('StatusLineNC') 11 | let g:airline#themes#monochrome#palette.inactive = airline#themes#generate_color_map(s:SLNC, s:SLNC, s:SLNC) 12 | endfunction 13 | 14 | call airline#themes#monochrome#refresh() 15 | 16 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/unite.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | if !get(g:, 'loaded_unite', 0) 7 | finish 8 | endif 9 | 10 | function! airline#extensions#unite#apply(...) 11 | if &ft == 'unite' 12 | call a:1.add_section('airline_a', ' Unite ') 13 | call a:1.add_section('airline_b', ' %{get(unite#get_context(), "buffer_name", "")} ') 14 | call a:1.add_section('airline_c', ' %{unite#get_status_string()} ') 15 | call a:1.split() 16 | call a:1.add_section('airline_y', ' %{get(unite#get_context(), "real_buffer_name", "")} ') 17 | return 1 18 | endif 19 | endfunction 20 | 21 | function! airline#extensions#unite#init(ext) 22 | let g:unite_force_overwrite_statusline = 0 23 | call a:ext.add_statusline_func('airline#extensions#unite#apply') 24 | endfunction 25 | 26 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/vimagit.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2016 Jerome Reybert 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | " This plugin replace the whole section_a when in vimagit buffer 5 | scriptencoding utf-8 6 | 7 | if !get(g:, 'loaded_magit', 0) 8 | finish 9 | endif 10 | 11 | function! airline#extensions#vimagit#init(ext) 12 | call a:ext.add_statusline_func('airline#extensions#vimagit#apply') 13 | endfunction 14 | 15 | function! airline#extensions#vimagit#get_mode() 16 | if ( b:magit_current_commit_mode == '' ) 17 | return "STAGING" 18 | elseif ( b:magit_current_commit_mode == 'CC' ) 19 | return "COMMIT" 20 | elseif ( b:magit_current_commit_mode == 'CA' ) 21 | return "AMEND" 22 | else 23 | return "???" 24 | endfunction 25 | 26 | function! airline#extensions#vimagit#apply(...) 27 | if ( &filetype == 'magit' ) 28 | let w:airline_section_a = '%{airline#extensions#vimagit#get_mode()}' 29 | endif 30 | endfunction 31 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/undotree.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | if !exists(':UndotreeToggle') 7 | finish 8 | endif 9 | 10 | function! airline#extensions#undotree#apply(...) 11 | if exists('t:undotree') 12 | if &ft == 'undotree' 13 | if exists('*t:undotree.GetStatusLine') 14 | call airline#extensions#apply_left_override('undo', '%{t:undotree.GetStatusLine()}') 15 | else 16 | call airline#extensions#apply_left_override('undotree', '%f') 17 | endif 18 | endif 19 | 20 | if &ft == 'diff' && exists('*t:diffpanel.GetStatusLine') 21 | call airline#extensions#apply_left_override('diff', '%{t:diffpanel.GetStatusLine()}') 22 | endif 23 | endif 24 | endfunction 25 | 26 | function! airline#extensions#undotree#init(ext) 27 | call a:ext.add_statusline_func('airline#extensions#undotree#apply') 28 | endfunction 29 | 30 | -------------------------------------------------------------------------------- /.vim/t/extensions_default.vim: -------------------------------------------------------------------------------- 1 | let g:airline#extensions#default#layout = [ 2 | \ [ 'c', 'a', 'b', 'warning' ], 3 | \ [ 'x', 'z', 'y' ] 4 | \ ] 5 | 6 | source plugin/airline.vim 7 | doautocmd VimEnter 8 | 9 | describe 'default' 10 | before 11 | let s:builder = airline#builder#new({'active': 1}) 12 | end 13 | 14 | it 'should use the layout' 15 | call airline#extensions#default#apply(s:builder, { 'winnr': 1, 'active': 1 }) 16 | let stl = s:builder.build() 17 | Expect stl =~ 'airline_c_to_airline_a' 18 | Expect stl =~ 'airline_a_to_airline_b' 19 | Expect stl =~ 'airline_b_to_airline_warning' 20 | Expect stl =~ 'airline_x_to_airline_z' 21 | Expect stl =~ 'airline_z_to_airline_y' 22 | end 23 | 24 | it 'should only render warning section in active splits' 25 | wincmd s 26 | Expect airline#statusline(1) =~ 'warning' 27 | Expect airline#statusline(2) !~ 'warning' 28 | wincmd c 29 | end 30 | end 31 | 32 | -------------------------------------------------------------------------------- /.config/i3/trivial_bar_script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # vim:ts=4:sw=4:expandtab 3 | # © 2012 Michael Stapelberg, Public Domain 4 | 5 | # This script is a trivial shell script to send your own output to i3bar while 6 | # using the JSON protocol. 7 | # 8 | # It is ugly and that is inherent to using JSON with shell scripts. You 9 | # _really_ should not do that. See i3status or i3status’s contrib/ directory 10 | # for examples of how to handle the output in higher-level languages. 11 | # 12 | # This example is purely for illustration of the protocol. DO NOT USE IT IN THE 13 | # REAL WORLD. 14 | 15 | # Send the header so that i3bar knows we want to use JSON: 16 | echo '{ "version": 1 }' 17 | 18 | # Begin the endless array. 19 | echo '[' 20 | 21 | # We send an empty first array of blocks to make the loop simpler: 22 | echo '[]' 23 | 24 | # Now send blocks with information forever: 25 | while :; 26 | do 27 | echo ",[{\"name\":\"time\",\"full_text\":\"$(date)\"}]" 28 | sleep 1 29 | done 30 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/bufferline.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | if !exists('*bufferline#get_status_string') 7 | finish 8 | endif 9 | 10 | let s:overwrite = get(g:, 'airline#extensions#bufferline#overwrite_variables', 1) 11 | 12 | function! airline#extensions#bufferline#init(ext) 13 | if s:overwrite 14 | highlight bufferline_selected gui=bold cterm=bold term=bold 15 | highlight link bufferline_selected_inactive airline_c_inactive 16 | let g:bufferline_inactive_highlight = 'airline_c' 17 | let g:bufferline_active_highlight = 'bufferline_selected' 18 | let g:bufferline_active_buffer_left = '' 19 | let g:bufferline_active_buffer_right = '' 20 | let g:bufferline_separator = g:airline_symbols.space 21 | endif 22 | 23 | call airline#parts#define_raw('file', '%{bufferline#refresh_status()}'.bufferline#get_status_string()) 24 | endfunction 25 | 26 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/windowswap.vim: -------------------------------------------------------------------------------- 1 | " vim: et ts=2 sts=2 sw=2 2 | 3 | scriptencoding utf-8 4 | 5 | if !exists('g:loaded_windowswap') 6 | finish 7 | endif 8 | 9 | let s:spc = g:airline_symbols.space 10 | 11 | if !exists('g:airline#extensions#windowswap#indicator_text') 12 | let g:airline#extensions#windowswap#indicator_text = 'WS' 13 | endif 14 | 15 | function! airline#extensions#windowswap#init(ext) 16 | call airline#parts#define_function('windowswap', 'airline#extensions#windowswap#get_status') 17 | endfunction 18 | 19 | function! airline#extensions#windowswap#get_status() 20 | " use new tab-aware api if WS is up to date 21 | let s:mark = exists('*WindowSwap#IsCurrentWindowMarked') ? 22 | \WindowSwap#IsCurrentWindowMarked() : 23 | \(WindowSwap#HasMarkedWindow() && WindowSwap#GetMarkedWindowNum() == winnr()) 24 | if s:mark 25 | return g:airline#extensions#windowswap#indicator_text.s:spc 26 | endif 27 | return '' 28 | endfunction 29 | 30 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/csv.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | if !get(g:, 'loaded_csv', 0) && !exists(':Table') 7 | finish 8 | endif 9 | 10 | let s:column_display = get(g:, 'airline#extensions#csv#column_display', 'Number') 11 | 12 | function! airline#extensions#csv#get_column() 13 | if exists('*CSV_WCol') 14 | if s:column_display ==# 'Name' 15 | return '['.CSV_WCol('Name').CSV_WCol().']' 16 | else 17 | return '['.CSV_WCol().']' 18 | endif 19 | endif 20 | return '' 21 | endfunction 22 | 23 | function! airline#extensions#csv#apply(...) 24 | if &ft ==# "csv" 25 | call airline#extensions#prepend_to_section('gutter', 26 | \ g:airline_left_alt_sep.' %{airline#extensions#csv#get_column()}') 27 | endif 28 | endfunction 29 | 30 | function! airline#extensions#csv#init(ext) 31 | call a:ext.add_statusline_func('airline#extensions#csv#apply') 32 | endfunction 33 | 34 | -------------------------------------------------------------------------------- /.config/i3/volume.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CMD=$1 4 | 5 | if [ -z "$CMD" ]; then 6 | echo "Must give command: up, down, mute" 7 | exit 1 8 | fi 9 | 10 | # currently muted? 11 | WASMUTED=`amixer get Master | grep '\[off\]$'` 12 | 13 | case $CMD in 14 | up) 15 | AMIXER="amixer sset Master 5%+" ;; 16 | down) 17 | AMIXER="amixer sset Master 5%-" ;; 18 | mute) 19 | AMIXER="amixer sset Master playback toggle" ;; 20 | esac 21 | 22 | # if muted already and not asking to mute, unmute 23 | if [ -n "$WASMUTED" ] && [ "$CMD" != "mute" ]; then 24 | amixer sset Master playback unmute 25 | fi 26 | 27 | # run command 28 | $AMIXER 29 | 30 | if [ "$CMD" == "mute" ]; then 31 | MUTED=`amixer get Master | grep '\[off\]$'` 32 | fi 33 | 34 | # get current volume 35 | VOL=`amixer get Master | grep \% | cut -d '[' -f2 | tr -d '[]' | head -n 1` 36 | 37 | if [ -z "$MUTED" ]; then 38 | dunstify -t 2 -r 1000 "Volume set to $VOL." 39 | else 40 | dunstify -t 2 -r 1000 "Sound muted." 41 | fi 42 | 43 | pkill -SIGRTMIN+10 i3blocks 44 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/neomake.vim: -------------------------------------------------------------------------------- 1 | " vim: et ts=2 sts=2 sw=2 2 | 3 | if !exists(':Neomake') 4 | finish 5 | endif 6 | 7 | let s:error_symbol = get(g:, 'airline#extensions#neomake#error_symbol', 'E:') 8 | let s:warning_symbol = get(g:, 'airline#extensions#neomake#warning_symbol', 'W:') 9 | 10 | function! airline#extensions#neomake#get_warnings() 11 | let counts = neomake#statusline#LoclistCounts() 12 | let warnings = get(counts, 'W', 0) 13 | return warnings ? s:warning_symbol.warnings : '' 14 | endfunction 15 | 16 | function! airline#extensions#neomake#get_errors() 17 | let counts = neomake#statusline#LoclistCounts() 18 | let errors = get(counts, 'E', 0) 19 | return errors ? s:error_symbol.errors : '' 20 | endfunction 21 | 22 | function! airline#extensions#neomake#init(ext) 23 | call airline#parts#define_function('neomake_warning_count', 'airline#extensions#neomake#get_warnings') 24 | call airline#parts#define_function('neomake_error_count', 'airline#extensions#neomake#get_errors') 25 | endfunction 26 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/virtualenv.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | let s:spc = g:airline_symbols.space 7 | 8 | function! airline#extensions#virtualenv#init(ext) 9 | call a:ext.add_statusline_func('airline#extensions#virtualenv#apply') 10 | endfunction 11 | 12 | function! airline#extensions#virtualenv#apply(...) 13 | if &filetype =~# "python" 14 | if get(g:, 'virtualenv_loaded', 0) 15 | let statusline = virtualenv#statusline() 16 | else 17 | let statusline = fnamemodify($VIRTUAL_ENV, ':t') 18 | endif 19 | if !empty(statusline) 20 | call airline#extensions#append_to_section('x', 21 | \ s:spc.g:airline_right_alt_sep.s:spc.statusline) 22 | endif 23 | endif 24 | endfunction 25 | 26 | function! airline#extensions#virtualenv#update() 27 | if &filetype =~# "python" 28 | call airline#extensions#virtualenv#apply() 29 | call airline#update_statusline() 30 | endif 31 | endfunction 32 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/tmuxline.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | if !exists(':Tmuxline') 7 | finish 8 | endif 9 | 10 | let s:tmuxline_snapshot_file = get(g:, 'airline#extensions#tmuxline#snapshot_file', '') 11 | let s:color_template = get(g:, 'airline#extensions#tmuxline#color_template', 'normal') 12 | 13 | function! airline#extensions#tmuxline#init(ext) 14 | call a:ext.add_theme_func('airline#extensions#tmuxline#set_tmux_colors') 15 | endfunction 16 | 17 | function! airline#extensions#tmuxline#set_tmux_colors(palette) 18 | let color_template = has_key(a:palette, s:color_template) ? s:color_template : 'normal' 19 | let mode_palette = a:palette[color_template] 20 | 21 | let tmuxline_theme = tmuxline#api#create_theme_from_airline(mode_palette) 22 | call tmuxline#api#set_theme(tmuxline_theme) 23 | 24 | if strlen(s:tmuxline_snapshot_file) 25 | call tmuxline#api#snapshot(s:tmuxline_snapshot_file) 26 | endif 27 | endfunction 28 | 29 | -------------------------------------------------------------------------------- /.vim/t/commands.vim: -------------------------------------------------------------------------------- 1 | source plugin/airline.vim 2 | doautocmd VimEnter 3 | 4 | describe 'commands' 5 | it 'should toggle off and on' 6 | execute 'AirlineToggle' 7 | Expect exists('#airline') to_be_false 8 | execute 'AirlineToggle' 9 | Expect exists('#airline') to_be_true 10 | end 11 | 12 | it 'should toggle whitespace off and on' 13 | call airline#extensions#load() 14 | execute 'AirlineToggleWhitespace' 15 | Expect exists('#airline_whitespace') to_be_false 16 | execute 'AirlineToggleWhitespace' 17 | Expect exists('#airline_whitespace') to_be_true 18 | end 19 | 20 | it 'should display theme name with no args' 21 | execute 'AirlineTheme simple' 22 | Expect g:airline_theme == 'simple' 23 | execute 'AirlineTheme dark' 24 | Expect g:airline_theme == 'dark' 25 | execute 'AirlineTheme doesnotexist' 26 | Expect g:airline_theme == 'dark' 27 | colors molokai 28 | Expect g:airline_theme == 'molokai' 29 | end 30 | 31 | it 'should have a refresh command' 32 | Expect exists(':AirlineRefresh') to_be_true 33 | end 34 | end 35 | 36 | -------------------------------------------------------------------------------- /.vim/compiler/swift.vim: -------------------------------------------------------------------------------- 1 | " Vim compiler file 2 | " Compiler: Swift Compiler 3 | " Maintainer: Ayman Bagabas 4 | " Latest Revision: 2020 Feb 16 5 | 6 | if exists("current_compiler") 7 | finish 8 | endif 9 | let current_compiler = "swiftc" 10 | 11 | " vint: -ProhibitAbbreviationOption 12 | let s:save_cpo = &cpo 13 | set cpo&vim 14 | " vint: +ProhibitAbbreviationOption 15 | 16 | if exists(":CompilerSet") != 2 17 | command -nargs=* CompilerSet setlocal 18 | endif 19 | 20 | if has('patch-7.4.191') 21 | CompilerSet makeprg=swiftc\ \%:S 22 | else 23 | CompilerSet makeprg=swiftc\ \% 24 | endif 25 | 26 | CompilerSet errorformat= 27 | \%E%f:%l:%c:\ %trror:\ %m, 28 | \%W%f:%l:%c:\ %tarning:\ %m, 29 | \%I%f:%l:%c:\ note:\ %m, 30 | \%E%f:%l:\ %trror:\ %m, 31 | \%W%f:%l:\ %tarning:\ %m, 32 | \%I%f:%l:\ note:\ %m, 33 | 34 | " vint: -ProhibitAbbreviationOption 35 | let &cpo = s:save_cpo 36 | unlet s:save_cpo 37 | " vint: +ProhibitAbbreviationOption 38 | 39 | " vim: set et sw=4 sts=4 ts=8: 40 | -------------------------------------------------------------------------------- /.vim/LICENCE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Andrew Stewart 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /.config/dunst/dunstrc: -------------------------------------------------------------------------------- 1 | [global] 2 | font = "Ninbus Sans L 8" 3 | allow_markup = yes 4 | format = "%s\n%b" 5 | sort = yes 6 | indicate_hidden = yes 7 | alignment = left 8 | bounce_freq = 0 9 | show_age_threshold = 60 10 | word_wrap = yes 11 | ignore_newline = no 12 | geometry = "200x10-6+30" 13 | transparency = 0 14 | idle_threshold = 120 15 | monitor = 0 16 | follow = mouse 17 | sticky_history = yes 18 | line_height = 0 19 | separator_height = 2 20 | padding = 8 21 | horizontal_padding = 8 22 | separator_color = "#888888" 23 | startup_notification = false 24 | 25 | [frame] 26 | width = 1 27 | color = "#cc00ff" 28 | 29 | [shortcuts] 30 | close = ctrl+space 31 | close_all = ctrl+shift+space 32 | history = ctrl+grave 33 | context = ctrl+shift+period 34 | 35 | [urgency_low] 36 | background = "#000000" 37 | foreground = "#ffffff" 38 | timeout = 1 39 | 40 | [urgency_normal] 41 | background = "#000000" 42 | foreground = "#ffffff" 43 | timeout = 1 44 | 45 | [urgency_critical] 46 | background = "#000000" 47 | foreground = "#ffffff" 48 | timeout = 0 49 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/netrw.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | if !exists(':NetrwSettings') 7 | finish 8 | endif 9 | 10 | function! airline#extensions#netrw#apply(...) 11 | if &ft == 'netrw' 12 | let spc = g:airline_symbols.space 13 | 14 | call a:1.add_section('airline_a', spc.'netrw'.spc) 15 | if exists('*airline#extensions#branch#get_head') 16 | call a:1.add_section('airline_b', spc.'%{airline#extensions#branch#get_head()}'.spc) 17 | endif 18 | call a:1.add_section('airline_c', spc.'%f'.spc) 19 | call a:1.split() 20 | call a:1.add_section('airline_y', spc.'%{airline#extensions#netrw#sortstring()}'.spc) 21 | return 1 22 | endif 23 | endfunction 24 | 25 | function! airline#extensions#netrw#init(ext) 26 | let g:netrw_force_overwrite_statusline = 0 27 | call a:ext.add_statusline_func('airline#extensions#netrw#apply') 28 | endfunction 29 | 30 | 31 | function! airline#extensions#netrw#sortstring() 32 | let order = (g:netrw_sort_direction =~ 'n') ? '+' : '-' 33 | return g:netrw_sort_by . (g:airline_symbols.space) . '[' . order . ']' 34 | endfunction 35 | -------------------------------------------------------------------------------- /.vim/lib/nerdtree/notifier.vim: -------------------------------------------------------------------------------- 1 | "CLASS: Notifier 2 | "============================================================ 3 | let s:Notifier = {} 4 | 5 | function! s:Notifier.AddListener(event, funcname) 6 | let listeners = s:Notifier.GetListenersForEvent(a:event) 7 | if listeners == [] 8 | let listenersMap = s:Notifier.GetListenersMap() 9 | let listenersMap[a:event] = listeners 10 | endif 11 | call add(listeners, a:funcname) 12 | endfunction 13 | 14 | function! s:Notifier.NotifyListeners(event, path, nerdtree, params) 15 | let event = g:NERDTreeEvent.New(a:nerdtree, a:path, a:event, a:params) 16 | 17 | for listener in s:Notifier.GetListenersForEvent(a:event) 18 | call {listener}(event) 19 | endfor 20 | endfunction 21 | 22 | function! s:Notifier.GetListenersMap() 23 | if !exists("s:refreshListenersMap") 24 | let s:refreshListenersMap = {} 25 | endif 26 | return s:refreshListenersMap 27 | endfunction 28 | 29 | function! s:Notifier.GetListenersForEvent(name) 30 | let listenersMap = s:Notifier.GetListenersMap() 31 | return get(listenersMap, a:name, []) 32 | endfunction 33 | 34 | let g:NERDTreePathNotifier = deepcopy(s:Notifier) 35 | 36 | -------------------------------------------------------------------------------- /.config/i3/backlight.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CMD=$1 4 | 5 | if [ -z "$CMD" ]; then 6 | echo "Must provide command: up, down" 7 | exit 1 8 | fi 9 | 10 | BRIGHTNESS_FILE=/sys/class/backlight/intel_backlight/brightness 11 | 12 | # detemrmine max brightness 13 | MAX_BRIGHTNESS=`cat /sys/class/backlight/intel_backlight/max_brightness` 14 | CURRENT_BRIGHTNESS=`cat $BRIGHTNESS_FILE` 15 | 16 | # we want do 0.5% steps 17 | let STEP=$MAX_BRIGHTNESS/200 18 | 19 | case $CMD in 20 | up) 21 | let BRIGHTNESS=$CURRENT_BRIGHTNESS+$STEP 22 | if [ $BRIGHTNESS -ge $MAX_BRIGHTNESS ]; then 23 | BRIGHTNESS=$MAX_BRIGHTNESS 24 | fi 25 | ;; 26 | down) 27 | let BRIGHTNESS=$CURRENT_BRIGHTNESS-$STEP 28 | if [ $BRIGHTNESS -le 0 ]; then 29 | BRIGHTNESS=0 30 | fi 31 | ;; 32 | esac 33 | 34 | sudo /home/raidzero/.config/i3/set_brightness.sh $BRIGHTNESS 35 | 36 | CURRENT_BRIGHTNESS_PERCENT=`echo "scale=2; ($BRIGHTNESS/$MAX_BRIGHTNESS)*100" | bc | sed 's/\.[0-9]*$//'` 37 | NOTIFY_STR="LCD brightness: ${CURRENT_BRIGHTNESS_PERCENT}%" 38 | dunstify -r 1001 "${NOTIFY_STR}" 39 | echo "$NOTIFY_STR" 40 | 41 | 42 | cat /sys/class/backlight/intel_backlight/brightness > ~/.lcd-brightness 43 | 44 | pkill -SIGRTMIN+20 i3blocks 45 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/ale.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bjorn Neergaard. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | if !exists('g:loaded_ale') 5 | finish 6 | endif 7 | 8 | let s:error_symbol = get(g:, 'airline#extensions#ale#error_symbol', 'E:') 9 | let s:warning_symbol = get(g:, 'airline#extensions#ale#warning_symbol', 'W:') 10 | 11 | function! s:count(index) 12 | let l:buf = bufnr('%') 13 | let l:count = ale#statusline#Count(l:buf) 14 | if type(l:count) ==# type(0) 15 | let l:count = 0 16 | else 17 | let l:count = l:count[a:index] 18 | endif 19 | 20 | return l:count 21 | endfunction 22 | 23 | function! airline#extensions#ale#get_errors() 24 | let l:count = s:count(0) 25 | return l:count ? s:error_symbol . l:count : '' 26 | endfunction 27 | 28 | function! airline#extensions#ale#get_warnings() 29 | let l:count = s:count(1) 30 | return l:count ? s:warning_symbol . l:count : '' 31 | endfunction 32 | 33 | function! airline#extensions#ale#init(ext) 34 | call airline#parts#define_function('ale_error_count', 'airline#extensions#ale#get_errors') 35 | call airline#parts#define_function('ale_warning_count', 'airline#extensions#ale#get_warnings') 36 | endfunction 37 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/tabline/formatters/unique_tail.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | function! airline#extensions#tabline#formatters#unique_tail#format(bufnr, buffers) 7 | let duplicates = {} 8 | let tails = {} 9 | let map = {} 10 | for nr in a:buffers 11 | let name = bufname(nr) 12 | if empty(name) 13 | let map[nr] = '[No Name]' 14 | else 15 | let tail = fnamemodify(name, ':s?/\+$??:t') 16 | if has_key(tails, tail) 17 | let duplicates[nr] = nr 18 | endif 19 | let tails[tail] = 1 20 | let map[nr] = airline#extensions#tabline#formatters#default#wrap_name(nr, tail) 21 | endif 22 | endfor 23 | 24 | for nr in values(duplicates) 25 | let map[nr] = airline#extensions#tabline#formatters#default#wrap_name(nr, fnamemodify(bufname(nr), ':p:.')) 26 | endfor 27 | 28 | if has_key(map, a:bufnr) 29 | return map[a:bufnr] 30 | endif 31 | 32 | " if we get here, the buffer list isn't in sync with the selected buffer yet, fall back to the default 33 | return airline#extensions#tabline#formatters#default#format(a:bufnr, a:buffers) 34 | endfunction 35 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/ycm.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2015 Evgeny Firsov. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | let s:spc = g:airline_symbols.space 7 | let s:error_symbol = get(g:, 'airline#extensions#ycm#error_symbol', 'E:') 8 | let s:warning_symbol = get(g:, 'airline#extensions#ycm#warning_symbol', 'W:') 9 | 10 | function! airline#extensions#ycm#init(ext) 11 | call airline#parts#define_function('ycm_error_count', 'airline#extensions#ycm#get_error_count') 12 | call airline#parts#define_function('ycm_warning_count', 'airline#extensions#ycm#get_warning_count') 13 | endfunction 14 | 15 | function! airline#extensions#ycm#get_error_count() 16 | if exists(':YcmDiag') && exists("*youcompleteme#GetErrorCount") 17 | let cnt = youcompleteme#GetErrorCount() 18 | 19 | if cnt != 0 20 | return s:error_symbol.cnt 21 | endif 22 | endif 23 | 24 | return '' 25 | endfunction 26 | 27 | function! airline#extensions#ycm#get_warning_count() 28 | if exists(':YcmDiag') && exists("*youcompleteme#GetWarningCount") 29 | let cnt = youcompleteme#GetWarningCount() 30 | 31 | if cnt != 0 32 | return s:warning_symbol.cnt.s:spc 33 | endif 34 | endif 35 | 36 | return '' 37 | endfunction 38 | 39 | -------------------------------------------------------------------------------- /.vim/autoload/airline/debug.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | function! airline#debug#profile1() 7 | profile start airline-profile-switch.log 8 | profile func * 9 | profile file * 10 | split 11 | for i in range(1, 1000) 12 | wincmd w 13 | redrawstatus 14 | endfor 15 | profile pause 16 | noautocmd qall! 17 | endfunction 18 | 19 | function! airline#debug#profile2() 20 | profile start airline-profile-cursor.log 21 | profile func * 22 | profile file * 23 | edit blank 24 | call setline(1, 'all your base are belong to us') 25 | call setline(2, 'all your base are belong to us') 26 | let positions = [[1,2], [2,2], [1,2], [1,1]] 27 | for i in range(1, 1000) 28 | for pos in positions 29 | call cursor(pos[0], pos[1]) 30 | redrawstatus 31 | endfor 32 | endfor 33 | profile pause 34 | noautocmd qall! 35 | endfunction 36 | 37 | function! airline#debug#profile3() 38 | profile start airline-profile-mode.log 39 | profile func * 40 | profile file * 41 | 42 | for i in range(1000) 43 | startinsert 44 | redrawstatus 45 | stopinsert 46 | redrawstatus 47 | endfor 48 | 49 | profile pause 50 | noautocmd qall! 51 | endfunction 52 | 53 | -------------------------------------------------------------------------------- /.vim/t/parts.vim: -------------------------------------------------------------------------------- 1 | describe 'parts' 2 | it 'overwrites existing values' 3 | call airline#parts#define('foo', { 'test': '123' }) 4 | Expect airline#parts#get('foo').test == '123' 5 | call airline#parts#define('foo', { 'test': '321' }) 6 | Expect airline#parts#get('foo').test == '321' 7 | end 8 | 9 | it 'can define a function part' 10 | call airline#parts#define_function('func', 'bar') 11 | Expect airline#parts#get('func').function == 'bar' 12 | end 13 | 14 | it 'can define a text part' 15 | call airline#parts#define_text('text', 'bar') 16 | Expect airline#parts#get('text').text == 'bar' 17 | end 18 | 19 | it 'can define a raw part' 20 | call airline#parts#define_raw('raw', 'bar') 21 | Expect airline#parts#get('raw').raw == 'bar' 22 | end 23 | 24 | it 'can define a minwidth' 25 | call airline#parts#define_minwidth('mw', 123) 26 | Expect airline#parts#get('mw').minwidth == 123 27 | end 28 | 29 | it 'can define a condition' 30 | call airline#parts#define_condition('part', '1') 31 | Expect airline#parts#get('part').condition == '1' 32 | end 33 | 34 | it 'can define a accent' 35 | call airline#parts#define_accent('part', 'red') 36 | Expect airline#parts#get('part').accent == 'red' 37 | end 38 | end 39 | 40 | -------------------------------------------------------------------------------- /.vim/syntax_checkers/swift/swiftpm.vim: -------------------------------------------------------------------------------- 1 | if exists('g:loaded_syntastic_swift_swiftpm_checker') 2 | finish 3 | endif 4 | let g:loaded_syntastic_swift_swiftpm_checker = 1 5 | 6 | if !exists('g:syntastic_swift_swiftpm_executable') 7 | let g:syntastic_swift_swiftpm_executable = 'swift' 8 | endif 9 | 10 | if !exists('g:syntastic_swift_swiftpm_arguments') 11 | let g:syntastic_swift_swiftpm_arguments = 'build' 12 | endif 13 | 14 | let s:save_cpo = &cpo 15 | set cpo&vim 16 | 17 | function! SyntaxCheckers_swift_swiftpm_IsAvailable() dict 18 | if !executable(self.getExec()) 19 | return 0 20 | endif 21 | 22 | return filereadable('Package.swift') 23 | endfunction 24 | 25 | function! SyntaxCheckers_swift_swiftpm_GetLocList() dict 26 | let makeprg = self.makeprgBuild({ 27 | \ 'fname': '', 28 | \ 'args': g:syntastic_swift_swiftpm_arguments }) 29 | 30 | let errorformat = 31 | \ '%f:%l:%c: error: %m' 32 | 33 | return SyntasticMake({ 34 | \ 'makeprg': makeprg, 35 | \ 'errorformat': errorformat }) 36 | endfunction 37 | 38 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 39 | \ 'filetype': 'swift', 40 | \ 'name': 'swiftpm', 41 | \ 'exec': g:syntastic_swift_swiftpm_executable }) 42 | 43 | let &cpo = s:save_cpo 44 | unlet s:save_cpo 45 | -------------------------------------------------------------------------------- /.vim/syntax_checkers/swift/swiftlint.vim: -------------------------------------------------------------------------------- 1 | if exists('g:loaded_syntastic_swift_swiftlint_checker') 2 | finish 3 | endif 4 | let g:loaded_syntastic_swift_swiftlint_checker = 1 5 | 6 | let s:save_cpo = &cpo 7 | set cpo&vim 8 | 9 | function! SyntaxCheckers_swift_swiftlint_IsAvailable() dict 10 | if !executable(self.getExec()) 11 | return 0 12 | endif 13 | 14 | return get(g:, 'syntastic_swift_swiftlint_use_defaults', 0) 15 | \ || filereadable('.swiftlint.yml') 16 | endfunction 17 | 18 | function! SyntaxCheckers_swift_swiftlint_GetLocList() dict 19 | let makeprg = self.makeprgBuild({ 20 | \ 'args': 'lint --use-script-input-files', 21 | \ 'fname': '' }) 22 | 23 | let errorformat = 24 | \ '%f:%l:%c: %trror: %m,' . 25 | \ '%f:%l:%c: %tarning: %m,' . 26 | \ '%f:%l: %trror: %m,' . 27 | \ '%f:%l: %tarning: %m' 28 | 29 | let env = { 30 | \ 'SCRIPT_INPUT_FILE_COUNT': 1, 31 | \ 'SCRIPT_INPUT_FILE_0': expand('%:p'), 32 | \ } 33 | 34 | return SyntasticMake({ 35 | \ 'makeprg': makeprg, 36 | \ 'errorformat': errorformat, 37 | \ 'env': env }) 38 | endfunction 39 | 40 | call g:SyntasticRegistry.CreateAndRegisterChecker({ 41 | \ 'filetype': 'swift', 42 | \ 'name': 'swiftlint' }) 43 | 44 | let &cpo = s:save_cpo 45 | unlet s:save_cpo 46 | -------------------------------------------------------------------------------- /.config/i3/kb-light.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | 4 | from sys import argv 5 | import dbus 6 | 7 | 8 | def kb_light_set(delta): 9 | bus = dbus.SystemBus() 10 | kbd_backlight_proxy = bus.get_object('org.freedesktop.UPower', '/org/freedesktop/UPower/KbdBacklight') 11 | kbd_backlight = dbus.Interface(kbd_backlight_proxy, 'org.freedesktop.UPower.KbdBacklight') 12 | 13 | current = kbd_backlight.GetBrightness() 14 | maximum = kbd_backlight.GetMaxBrightness() 15 | new = max(0, current + delta) 16 | 17 | if new >= 0 and new <= maximum: 18 | current = new 19 | kbd_backlight.SetBrightness(current) 20 | 21 | # Return current backlight level percentage 22 | return "%d%%" % int(100 * current / maximum) 23 | 24 | if __name__ == '__main__': 25 | if len(argv[1:]) == 1: 26 | if argv[1] == "--up" or argv[1] == "+": 27 | # ./kb-light.py (+|--up) to increment 28 | print(kb_light_set(5)) 29 | elif argv[1] == "--down" or argv[1] == "-": 30 | # ./kb-light.py (-|--down) to decrement 31 | print(kb_light_set(-5)) 32 | elif argv[1] == "--get": 33 | print(kb_light_set(0)) 34 | else: 35 | print("Unknown argument:", argv[1]) 36 | else: 37 | print("Script takes exactly one argument.", len(argv[1:]), "arguments provided.") 38 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/promptline.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | if !exists(':PromptlineSnapshot') 7 | finish 8 | endif 9 | 10 | if !exists('airline#extensions#promptline#snapshot_file') || !len('airline#extensions#promptline#snapshot_file') 11 | finish 12 | endif 13 | 14 | let s:prompt_snapshot_file = get(g:, 'airline#extensions#promptline#snapshot_file', '') 15 | let s:color_template = get(g:, 'airline#extensions#promptline#color_template', 'normal') 16 | 17 | function! airline#extensions#promptline#init(ext) 18 | call a:ext.add_theme_func('airline#extensions#promptline#set_prompt_colors') 19 | endfunction 20 | 21 | function! airline#extensions#promptline#set_prompt_colors(palette) 22 | let color_template = has_key(a:palette, s:color_template) ? s:color_template : 'normal' 23 | let mode_palette = a:palette[color_template] 24 | 25 | if !has_key(g:, 'promptline_symbols') 26 | let g:promptline_symbols = { 27 | \ 'left' : g:airline_left_sep, 28 | \ 'right' : g:airline_right_sep, 29 | \ 'left_alt' : g:airline_left_alt_sep, 30 | \ 'right_alt' : g:airline_right_alt_sep} 31 | endif 32 | 33 | let promptline_theme = promptline#api#create_theme_from_airline(mode_palette) 34 | call promptline#api#create_snapshot_with_theme(s:prompt_snapshot_file, promptline_theme) 35 | endfunction 36 | -------------------------------------------------------------------------------- /.config/sway/toggle_active_outputs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import i3ipc 3 | import os 4 | import pickle 5 | import sys 6 | 7 | idleVerb = sys.argv[1] 8 | 9 | savedLoc = "/tmp/sway_outputs.status" 10 | savedOutputStatus = {} 11 | if os.path.exists(savedLoc): 12 | with open(savedLoc, 'rb') as f: 13 | savedOutputStatus = pickle.load(f) 14 | 15 | i3 = i3ipc.Connection() 16 | 17 | def isOutputActive(outputName): 18 | active = len([ o for o in i3.get_outputs() if o['name'] == outputName and o['active'] ]) > 0 19 | return active 20 | 21 | def turnActiveOutputsOff(): 22 | for output in i3.get_outputs(): 23 | # save active status for this output 24 | savedOutputStatus[output['name']] = output['active'] 25 | 26 | if output['active']: 27 | # turn off 28 | print("Disabling output {}".format(output['name'])) 29 | i3.command("output {} disable".format(output['name'])) 30 | 31 | with open(savedLoc, 'wb') as f: 32 | pickle.dump(savedOutputStatus, f) 33 | 34 | 35 | def turnPreviouslyActiveOutputsOn(): 36 | for outputName, active in savedOutputStatus.items(): 37 | if active: 38 | # turn on (if off) 39 | if not isOutputActive(outputName): 40 | print("Enabling output {}".format(outputName)) 41 | i3.command("output {} enable".format(outputName)) 42 | 43 | if idleVerb == 'idle': 44 | turnActiveOutputsOff() 45 | elif idleVerb == 'active': 46 | turnPreviouslyActiveOutputsOn() 47 | 48 | 49 | -------------------------------------------------------------------------------- /.bashrc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $HOME/dotfiles/functions.sh 4 | 5 | alias sudo='sudo ' 6 | alias cls="echo -ne '\033c'" 7 | alias luksOpen="cryptsetup luksOpen" 8 | alias luksClose="cryptsetup luksClose" 9 | alias grep='grep --color' 10 | alias pcp="rsync -ah --progress" 11 | alias dropbox="python2 /usr/bin/dropbox" 12 | alias btc='curl -sSL https://api.coinbase.com/v1/prices/historical?limit=1 | sed -r "s/(^.*)T(.*),([0-9]+\.[0-9]{1,2})/$\3 as of \1 at \2\n/"' 13 | alias vim='nvim' 14 | 15 | export PATH="$PATH:/opt/jdk1.8.0_91/bin" 16 | export PATH="$PATH:~/bin:~/bin/food" 17 | export PATH="$PATH:~/dotfiles/bin" 18 | export PATH="$PATH:~/Android/Sdk/tools:~/Android/Sdk/platform-tools" 19 | 20 | export EDITOR=nvim 21 | export SUDO_EDITOR=vim 22 | export VISUAL=vim 23 | export BROWSER=chromium 24 | 25 | DEFAULT_TERM_TITLE="#!" 26 | TERM_TITLE=$DEFAULT_TERM_TITLE 27 | 28 | eval `dircolors -b "$HOME/.dir_colors"` 29 | 30 | PROMPT_USER='\e[32m\u\e[00m' 31 | PROMPT_HOST='\e[35m\h\e[00m' 32 | PROMPT_PWD='\e[1;36m$(~/dotfiles/bin/shortenPath.sh "$PWD" 30)\e[00m' 33 | PROMPT_BRANCH='\e[1;31m$(get_git_branch)\e[00m' 34 | PROMPT_TIME='\e[36m\@\e[00m' 35 | 36 | PS1="┌─[$PROMPT_USER on $PROMPT_HOST in $PROMPT_PWD$PROMPT_BRANCH at $PROMPT_TIME]╼\n└──╼ " 37 | PROMPT_COMMAND='echo -en "\033]0;[$TERM_TITLE] - $(~/dotfiles/bin/shortenPath.sh "$PWD" 30)\007"' 38 | 39 | # update terminal title with running command like MacOS 40 | trap 'echo [$TERM_TITLE] - $(~/dotfiles/bin/shortenPath.sh "$PWD" 30) - [$BASH_COMMAND] |awk '\''!/\007/ {printf "\033]0;%s\007", $0}'\' DEBUG 41 | set -o vi 42 | -------------------------------------------------------------------------------- /.vim/autoload/airline/msdos.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | " basic 16 msdos from MSDOS 7 | " see output of color, should be 8 | " 0 Black 9 | " 1 DarkBlue 10 | " 2 DarkGreen 11 | " 3 DarkCyan 12 | " 4 DarkRed 13 | " 5 DarkMagenta 14 | " 6 Brown 15 | " 7 LightGray 16 | " 8 DarkGray 17 | " 9 Blue 18 | " 10 Green 19 | " 11 Cyan 20 | " 12 Red 21 | " 13 Magenta 22 | " 14 Yellow 23 | " 15 White 24 | 25 | let s:basic16 = [ 26 | \ [ 0x00, 0x00, 0x00 ], 27 | \ [ 0x00, 0x00, 0x80 ], 28 | \ [ 0x00, 0x80, 0x00 ], 29 | \ [ 0x00, 0x80, 0x80 ], 30 | \ [ 0x80, 0x00, 0x00 ], 31 | \ [ 0x80, 0x00, 0x80 ], 32 | \ [ 0x80, 0x80, 0x00 ], 33 | \ [ 0xC0, 0xC0, 0xC0 ], 34 | \ [ 0x80, 0x80, 0x80 ], 35 | \ [ 0x00, 0x00, 0xFF ], 36 | \ [ 0x00, 0xFF, 0x00 ], 37 | \ [ 0x00, 0xFF, 0xFF ], 38 | \ [ 0xFF, 0x00, 0x00 ], 39 | \ [ 0xFF, 0x00, 0xFF ], 40 | \ [ 0xFF, 0xFF, 0x00 ], 41 | \ [ 0xFF, 0xFF, 0xFF ] 42 | \ ] 43 | 44 | function! airline#msdos#round_msdos_colors(rgblist) 45 | " Check for values from MSDOS 16 color terminal 46 | let best = [] 47 | let min = 100000 48 | let list = s:basic16 49 | for value in list 50 | let t = abs(value[0] - a:rgblist[0]) + 51 | \ abs(value[1] - a:rgblist[1]) + 52 | \ abs(value[2] - a:rgblist[2]) 53 | if min > t 54 | let min = t 55 | let best = value 56 | endif 57 | endfor 58 | return index(s:basic16, best) 59 | endfunction 60 | -------------------------------------------------------------------------------- /.vim/t/util.vim: -------------------------------------------------------------------------------- 1 | call airline#init#bootstrap() 2 | 3 | function! Util1() 4 | let g:count += 1 5 | endfunction 6 | function! Util2() 7 | let g:count += 2 8 | endfunction 9 | function! Util3(...) 10 | let g:count = a:0 11 | endfunction 12 | 13 | describe 'util' 14 | before 15 | let g:count = 0 16 | end 17 | 18 | it 'has append wrapper function' 19 | Expect airline#util#append('', 0) == '' 20 | Expect airline#util#append('1', 0) == ' > 1' 21 | end 22 | 23 | it 'has prepend wrapper function' 24 | Expect airline#util#prepend('', 0) == '' 25 | Expect airline#util#prepend('1', 0) == '1 < ' 26 | end 27 | 28 | it 'has getwinvar function' 29 | Expect airline#util#getwinvar(1, 'asdf', '123') == '123' 30 | call setwinvar(1, 'vspec', 'is cool') 31 | Expect airline#util#getwinvar(1, 'vspec', '') == 'is cool' 32 | end 33 | 34 | it 'has exec funcrefs helper functions' 35 | call airline#util#exec_funcrefs([function('Util1'), function('Util2')]) 36 | Expect g:count == 3 37 | 38 | call airline#util#exec_funcrefs([function('Util3')], 1, 2, 3, 4) 39 | Expect g:count == 4 40 | end 41 | 42 | it 'should ignore minwidth if less than 0' 43 | Expect airline#util#append('foo', -1) == ' > foo' 44 | Expect airline#util#prepend('foo', -1) == 'foo < ' 45 | Expect airline#util#wrap('foo', -1) == 'foo' 46 | end 47 | 48 | it 'should return empty if winwidth() > minwidth' 49 | Expect airline#util#append('foo', 99999) == '' 50 | Expect airline#util#prepend('foo', 99999) == '' 51 | Expect airline#util#wrap('foo', 99999) == '' 52 | end 53 | end 54 | 55 | -------------------------------------------------------------------------------- /.vim/lib/nerdtree/flag_set.vim: -------------------------------------------------------------------------------- 1 | "CLASS: FlagSet 2 | "============================================================ 3 | let s:FlagSet = {} 4 | let g:NERDTreeFlagSet = s:FlagSet 5 | 6 | "FUNCTION: FlagSet.addFlag(scope, flag) {{{1 7 | function! s:FlagSet.addFlag(scope, flag) 8 | let flags = self._flagsForScope(a:scope) 9 | if index(flags, a:flag) == -1 10 | call add(flags, a:flag) 11 | end 12 | endfunction 13 | 14 | "FUNCTION: FlagSet.clearFlags(scope) {{{1 15 | function! s:FlagSet.clearFlags(scope) 16 | let self._flags[a:scope] = [] 17 | endfunction 18 | 19 | "FUNCTION: FlagSet._flagsForScope(scope) {{{1 20 | function! s:FlagSet._flagsForScope(scope) 21 | if !has_key(self._flags, a:scope) 22 | let self._flags[a:scope] = [] 23 | endif 24 | return self._flags[a:scope] 25 | endfunction 26 | 27 | "FUNCTION: FlagSet.New() {{{1 28 | function! s:FlagSet.New() 29 | let newObj = copy(self) 30 | let newObj._flags = {} 31 | return newObj 32 | endfunction 33 | 34 | "FUNCTION: FlagSet.removeFlag(scope, flag) {{{1 35 | function! s:FlagSet.removeFlag(scope, flag) 36 | let flags = self._flagsForScope(a:scope) 37 | 38 | let i = index(flags, a:flag) 39 | if i >= 0 40 | call remove(flags, i) 41 | endif 42 | endfunction 43 | 44 | "FUNCTION: FlagSet.renderToString() {{{1 45 | function! s:FlagSet.renderToString() 46 | let flagstring = "" 47 | for i in values(self._flags) 48 | let flagstring .= join(i) 49 | endfor 50 | 51 | if len(flagstring) == 0 52 | return "" 53 | endif 54 | 55 | return '[' . flagstring . ']' 56 | endfunction 57 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/tabline/formatters/default.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | let s:fnamecollapse = get(g:, 'airline#extensions#tabline#fnamecollapse', 1) 7 | let s:fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0) 8 | let s:buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s: ') 9 | let s:buf_nr_show = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0) 10 | let s:buf_modified_symbol = g:airline_symbols.modified 11 | 12 | function! airline#extensions#tabline#formatters#default#format(bufnr, buffers) 13 | let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.') 14 | let _ = '' 15 | 16 | let name = bufname(a:bufnr) 17 | if empty(name) 18 | let _ .= '[No Name]' 19 | else 20 | if s:fnamecollapse 21 | let _ .= substitute(fnamemodify(name, fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g') 22 | else 23 | let _ .= fnamemodify(name, fmod) 24 | endif 25 | if a:bufnr != bufnr('%') && s:fnametruncate && strlen(_) > s:fnametruncate 26 | let _ = strpart(_, 0, s:fnametruncate) 27 | endif 28 | endif 29 | 30 | return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, _) 31 | endfunction 32 | 33 | function! airline#extensions#tabline#formatters#default#wrap_name(bufnr, buffer_name) 34 | let _ = s:buf_nr_show ? printf(s:buf_nr_format, a:bufnr) : '' 35 | let _ .= substitute(a:buffer_name, '\\', '/', 'g') 36 | 37 | if getbufvar(a:bufnr, '&modified') == 1 38 | let _ .= s:buf_modified_symbol 39 | endif 40 | return _ 41 | endfunction 42 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/tabline/buflist.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | function! airline#extensions#tabline#buflist#invalidate() 7 | unlet! s:current_buffer_list 8 | endfunction 9 | 10 | function! airline#extensions#tabline#buflist#list() 11 | if exists('s:current_buffer_list') 12 | return s:current_buffer_list 13 | endif 14 | 15 | let excludes = get(g:, 'airline#extensions#tabline#excludes', []) 16 | let exclude_preview = get(g:, 'airline#extensions#tabline#exclude_preview', 1) 17 | 18 | let list = (exists('g:did_bufmru') && g:did_bufmru) ? BufMRUList() : range(1, bufnr("$")) 19 | 20 | let buffers = [] 21 | " If this is too slow, we can switch to a different algorithm. 22 | " Basically branch 535 already does it, but since it relies on 23 | " BufAdd autocommand, I'd like to avoid this if possible. 24 | for nr in list 25 | if buflisted(nr) 26 | " Do not add to the bufferlist, if either 27 | " 1) buffername matches exclude pattern 28 | " 2) buffer is a quickfix buffer 29 | " 3) exclude preview windows (if 'bufhidden' == wipe 30 | " and 'buftype' == nofile 31 | if (!empty(excludes) && match(bufname(nr), join(excludes, '\|')) > -1) || 32 | \ (getbufvar(nr, 'current_syntax') == 'qf') || 33 | \ (exclude_preview && getbufvar(nr, '&bufhidden') == 'wipe' 34 | \ && getbufvar(nr, '&buftype') == 'nofile') 35 | continue 36 | endif 37 | call add(buffers, nr) 38 | endif 39 | endfor 40 | 41 | let s:current_buffer_list = buffers 42 | return buffers 43 | endfunction 44 | 45 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/tagbar.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | if !exists(':TagbarToggle') 7 | finish 8 | endif 9 | 10 | let s:flags = get(g:, 'airline#extensions#tagbar#flags', '') 11 | let s:spc = g:airline_symbols.space 12 | 13 | " Arguments: current, sort, fname 14 | function! airline#extensions#tagbar#get_status(...) 15 | let builder = airline#builder#new({ 'active': a:1 }) 16 | call builder.add_section('airline_a', s:spc.'Tagbar'.s:spc) 17 | call builder.add_section('airline_b', s:spc.a:2.s:spc) 18 | call builder.add_section('airline_c', s:spc.a:3.s:spc) 19 | return builder.build() 20 | endfunction 21 | 22 | function! airline#extensions#tagbar#inactive_apply(...) 23 | if getwinvar(a:2.winnr, '&filetype') == 'tagbar' 24 | return -1 25 | endif 26 | endfunction 27 | 28 | let s:airline_tagbar_last_lookup_time = 0 29 | let s:airline_tagbar_last_lookup_val = '' 30 | function! airline#extensions#tagbar#currenttag() 31 | if get(w:, 'airline_active', 0) 32 | if s:airline_tagbar_last_lookup_time != localtime() 33 | let s:airline_tagbar_last_lookup_val = tagbar#currenttag('%s', '', s:flags) 34 | let s:airline_tagbar_last_lookup_time = localtime() 35 | endif 36 | return s:airline_tagbar_last_lookup_val 37 | endif 38 | return '' 39 | endfunction 40 | 41 | function! airline#extensions#tagbar#init(ext) 42 | call a:ext.add_inactive_statusline_func('airline#extensions#tagbar#inactive_apply') 43 | let g:tagbar_status_func = 'airline#extensions#tagbar#get_status' 44 | 45 | call airline#parts#define_function('tagbar', 'airline#extensions#tagbar#currenttag') 46 | endfunction 47 | 48 | -------------------------------------------------------------------------------- /.vim/nerdtree_plugin/exec_menuitem.vim: -------------------------------------------------------------------------------- 1 | " ============================================================================ 2 | " File: exec_menuitem.vim 3 | " Description: plugin for NERD Tree that provides an execute file menu item 4 | " Maintainer: Martin Grenfell 5 | " License: This program is free software. It comes without any warranty, 6 | " to the extent permitted by applicable law. You can redistribute 7 | " it and/or modify it under the terms of the Do What The Fuck You 8 | " Want To Public License, Version 2, as published by Sam Hocevar. 9 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 10 | " 11 | " ============================================================================ 12 | if exists("g:loaded_nerdtree_exec_menuitem") 13 | finish 14 | endif 15 | let g:loaded_nerdtree_exec_menuitem = 1 16 | 17 | call NERDTreeAddMenuItem({ 18 | \ 'text': '(!)Execute file', 19 | \ 'shortcut': '!', 20 | \ 'callback': 'NERDTreeExecFile', 21 | \ 'isActiveCallback': 'NERDTreeExecFileActive' }) 22 | 23 | function! NERDTreeExecFileActive() 24 | let node = g:NERDTreeFileNode.GetSelected() 25 | return !node.path.isDirectory && node.path.isExecutable 26 | endfunction 27 | 28 | function! NERDTreeExecFile() 29 | let treenode = g:NERDTreeFileNode.GetSelected() 30 | echo "==========================================================\n" 31 | echo "Complete the command to execute (add arguments etc):\n" 32 | let cmd = treenode.path.str({'escape': 1}) 33 | let cmd = input(':!', cmd . ' ') 34 | 35 | if cmd != '' 36 | exec ':!' . cmd 37 | else 38 | echo "Aborted" 39 | endif 40 | endfunction 41 | -------------------------------------------------------------------------------- /.vim/colors/grb256.vim: -------------------------------------------------------------------------------- 1 | " Based on 2 | runtime colors/ir_black.vim 3 | 4 | let g:colors_name = "grb256" 5 | 6 | hi pythonSpaceError ctermbg=red guibg=red 7 | 8 | hi Comment ctermfg=darkgray 9 | 10 | hi StatusLine ctermbg=darkgrey ctermfg=white 11 | hi StatusLineNC ctermbg=black ctermfg=lightgrey 12 | hi VertSplit ctermbg=black ctermfg=lightgrey 13 | hi LineNr ctermfg=darkgray 14 | hi CursorLine guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=234 15 | hi Function guifg=#FFD2A7 guibg=NONE gui=NONE ctermfg=yellow ctermbg=NONE cterm=NONE 16 | hi Visual guifg=NONE guibg=#262D51 gui=NONE ctermfg=NONE ctermbg=236 cterm=NONE 17 | 18 | hi Error guifg=NONE guibg=NONE gui=undercurl ctermfg=16 ctermbg=red cterm=NONE guisp=#FF6C60 " undercurl color 19 | hi ErrorMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=16 ctermbg=red cterm=NONE 20 | hi WarningMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=16 ctermbg=red cterm=NONE 21 | hi SpellBad guifg=white guibg=#FF6C60 gui=BOLD ctermfg=16 ctermbg=160 cterm=NONE 22 | 23 | " ir_black doesn't highlight operators for some reason 24 | hi Operator guifg=#6699CC guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE 25 | 26 | highlight DiffAdd term=reverse cterm=bold ctermbg=NONE ctermfg=green 27 | highlight DiffChange term=reverse cterm=bold ctermbg=NONE ctermfg=white 28 | highlight DiffText term=reverse cterm=bold ctermbg=NONE ctermfg=red 29 | highlight DiffDelete term=reverse cterm=bold ctermbg=NONE ctermfg=red 30 | 31 | highlight PmenuSel ctermfg=16 ctermbg=156 32 | -------------------------------------------------------------------------------- /.config/i3/musicwatcher.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | import i3ipc 3 | import subprocess 4 | 5 | # process all windows on this workspace. hide when leaving and show when entering 6 | # because chrome/ium doesnt consider itself hidden when on an invisible workspace 7 | # this script drops my cpu usage when listening to google music from ~10% to ~3% 8 | 9 | # I'm just putting any workspaces that have chromium apps running on them 10 | WATCHED_WORKSPACES = [5, 6] 11 | 12 | HIDDEN = '_NET_WM_STATE_HIDDEN' 13 | SHOWN = '_NET_WM_STATE_SHOWN' 14 | 15 | def showWindow(windowId): 16 | print "SHOWING" 17 | 18 | subprocess.call(["xprop", "-id", str(windowId), "-f", 19 | "_NET_WM_STATE", "32a", "-remove", HIDDEN]) 20 | subprocess.call(["xprop", "-id", str(windowId), "-f", 21 | "_NET_WM_STATE", "32a", "-set", "_NET_WM_STATE", SHOWN]) 22 | 23 | 24 | def hideWindow(windowId): 25 | print "HIDING" 26 | 27 | subprocess.call(["xprop", "-id", str(windowId), "-f", 28 | "_NET_WM_STATE", "32a", "-remove", SHOWN]) 29 | subprocess.call(["xprop", "-id", str(windowId), "-f", 30 | "_NET_WM_STATE", "32a", "-set", "_NET_WM_STATE", HIDDEN]) 31 | 32 | 33 | def process_window(window, ws_event): 34 | print "Processing window: %s (%d)" % (window.name, window.window) 35 | 36 | 37 | if ws_event.current.num in WATCHED_WORKSPACES: 38 | # music workspace has been focused 39 | showWindow(window.window) 40 | elif ws_event.old.num in WATCHED_WORKSPACES: 41 | # music workspace has been unfocused 42 | hideWindow(window.window) 43 | 44 | def onWorkspace(i3, event): 45 | if event.change in ['focus']: 46 | windows = i3.get_tree().leaves() 47 | for window in windows: 48 | if window.workspace().num in WATCHED_WORKSPACES: 49 | process_window(window, event) 50 | 51 | i3 = i3ipc.Connection() 52 | 53 | i3.on('workspace', onWorkspace) 54 | i3.main() 55 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/wordcount.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | let s:format = get(g:, 'airline#extensions#wordcount#format', '%d words') 7 | let s:formatter = get(g:, 'airline#extensions#wordcount#formatter', 'default') 8 | let g:airline#extensions#wordcount#filetypes = get(g:, 'airline#extensions#wordcount#filetypes', 9 | \ '\vhelp|markdown|rst|org|text|asciidoc|tex|mail') 10 | 11 | function! s:update() 12 | if match(&ft, get(g:, 'airline#extensions#wordcount#filetypes')) > -1 13 | let l:mode = mode() 14 | if l:mode ==# 'v' || l:mode ==# 'V' || l:mode ==# 's' || l:mode ==# 'S' 15 | let b:airline_wordcount = airline#extensions#wordcount#formatters#{s:formatter}#format() 16 | let b:airline_change_tick = b:changedtick 17 | else 18 | if get(b:, 'airline_wordcount_cache', '') is# '' || 19 | \ b:airline_wordcount_cache isnot# get(b:, 'airline_wordcount', '') || 20 | \ get(b:, 'airline_change_tick', 0) != b:changedtick 21 | " cache data 22 | let b:airline_wordcount = airline#extensions#wordcount#formatters#{s:formatter}#format() 23 | let b:airline_wordcount_cache = b:airline_wordcount 24 | let b:airline_change_tick = b:changedtick 25 | endif 26 | endif 27 | endif 28 | endfunction 29 | 30 | function! airline#extensions#wordcount#apply(...) 31 | if match(&ft, get(g:, 'airline#extensions#wordcount#filetypes')) > -1 32 | call airline#extensions#prepend_to_section('z', '%{get(b:, "airline_wordcount", "")}') 33 | endif 34 | endfunction 35 | 36 | function! airline#extensions#wordcount#init(ext) 37 | call a:ext.add_statusline_func('airline#extensions#wordcount#apply') 38 | autocmd BufReadPost,CursorMoved,CursorMovedI * call s:update() 39 | endfunction 40 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/hybridline.vim: -------------------------------------------------------------------------------- 1 | " vim-airline theme based on vim-hybrid and powerline 2 | " (https://github.com/w0ng/vim-hybrid) 3 | " (https://github.com/Lokaltog/powerline) 4 | 5 | let g:airline#themes#hybridline#palette = {} 6 | 7 | let s:N1 = [ '#282a2e' , '#c5c8c6' , 'black' , 15 ] 8 | let s:N2 = [ '#c5c8c6' , '#373b41' , 15 , 8 ] 9 | let s:N3 = [ '#ffffff' , '#282a2e' , 255 , 'black' ] 10 | let g:airline#themes#hybridline#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 11 | let g:airline#themes#hybridline#palette.normal.airline_a = ['#005f00', '#b5bd68', 22, 10, ''] 12 | 13 | let s:I1 = [ '#005f5f' , '#8abeb7' , 23 , 14 ] 14 | let s:I2 = [ '#c5c8c6' , '#0087af' , 15 , 31 ] 15 | let s:I3 = [ '#ffffff' , '#005f87' , 255 , 24 ] 16 | let g:airline#themes#hybridline#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 17 | let g:airline#themes#hybridline#palette.insert_paste = { 18 | \ 'airline_a': ['#000000', '#ac4142', 16 , 1, ''] , 19 | \ } 20 | 21 | let g:airline#themes#hybridline#palette.replace = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 22 | let g:airline#themes#hybridline#palette.replace.airline_a = ['#000000', '#CC6666', 16, 9] 23 | 24 | let g:airline#themes#hybridline#palette.visual = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 25 | let g:airline#themes#hybridline#palette.visual.airline_a = ['#000000', '#de935f', 16, 3] 26 | 27 | let s:IA1 = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ] 28 | let s:IA2 = [ '#4e4e4e' , '#262626' , 239 , 235 , '' ] 29 | let s:IA3 = [ '#4e4e4e' , '#303030' , 239 , 236 , '' ] 30 | let g:airline#themes#hybridline#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3) 31 | 32 | let g:airline#themes#hybridline#palette.accents = { 33 | \ 'red': [ '#ff0000' , '' , 160 , '' ] 34 | \ } 35 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/wordcount/formatters/default.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | function! airline#extensions#wordcount#formatters#default#format() 7 | let words = string(s:wordcount()) 8 | if empty(words) 9 | return 10 | endif 11 | let separator = s:get_decimal_group() 12 | if words > 999 && !empty(separator) 13 | " Format number according to locale, e.g. German: 1.245 or English: 1,245 14 | let a = join(reverse(split(words, '.\zs')),'') 15 | let a = substitute(a, '...', '&'.separator, 'g') 16 | let words = join(reverse(split(a, '.\zs')),'') 17 | endif 18 | return words . " words" . g:airline_symbols.space . g:airline_right_alt_sep . g:airline_symbols.space 19 | endfunction 20 | 21 | function! s:wordcount() 22 | if exists("*wordcount") 23 | let l:mode = mode() 24 | if l:mode ==# 'v' || l:mode ==# 'V' || l:mode ==# 's' || l:mode ==# 'S' 25 | let l:visual_words = wordcount()['visual_words'] 26 | if l:visual_words != '' 27 | return l:visual_words 28 | else 29 | return 0 30 | endif 31 | else 32 | return wordcount()['words'] 33 | endif 34 | elseif mode() =~? 's' 35 | return 36 | else 37 | let old_status = v:statusmsg 38 | let position = getpos(".") 39 | exe "silent normal! g\" 40 | let stat = v:statusmsg 41 | call setpos('.', position) 42 | let v:statusmsg = old_status 43 | 44 | let parts = split(stat) 45 | if len(parts) > 11 46 | return str2nr(parts[11]) 47 | else 48 | return 49 | endif 50 | endif 51 | endfunction 52 | 53 | function! s:get_decimal_group() 54 | if match(v:lang, '\v\cC|en') > -1 55 | return ',' 56 | elseif match(v:lang, '\v\cde|dk|fr|pt') > -1 57 | return '.' 58 | endif 59 | return '' 60 | endfunction 61 | -------------------------------------------------------------------------------- /bin/xrandr.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # DVI-D-0, DP-1, DVI-I-1 (770) 3 | # DP-4, DVI-D-0, DP-0 4 | 5 | DISPLAYS=$(cat /tmp/randrmode) # can be jkl, any combination or blank 6 | 7 | #OUTPUTS=$(echo -e "DP-1\nDVI-I-1\nDVI-D-0") 8 | OUTPUTS=$(echo -e "DP-4\nDVI-D-0\nDP-0") 9 | 10 | if [ -z "$DISPLAYS" ]; then 11 | xrandr --auto 12 | else 13 | SELECTED_OUTPUTS="" 14 | 15 | if [[ "$DISPLAYS" == *j* ]]; then 16 | D=$(echo "$OUTPUTS" | head -n 1 | cut -d ' ' -f1) 17 | SELECTED_OUTPUTS="${SELECTED_OUTPUTS}\n$D" 18 | echo "selected left" 19 | fi 20 | 21 | if [[ "$DISPLAYS" == *k* ]]; then 22 | D=$(echo "$OUTPUTS" | head -n 2 | tail -n 1 | cut -d ' ' -f1) 23 | SELECTED_OUTPUTS="${SELECTED_OUTPUTS}\n$D" 24 | echo "selected center" 25 | fi 26 | 27 | if [[ "$DISPLAYS" == *l* ]]; then 28 | D=$(echo "$OUTPUTS" | tail -n 1 | cut -d ' ' -f1) 29 | SELECTED_OUTPUTS="${SELECTED_OUTPUTS}\n$D" 30 | echo "selected right" 31 | fi 32 | 33 | echo -e "SELECTED:\n$SELECTED_OUTPUTS" 34 | 35 | # build up an xrandr command to enable/disable outputs 36 | 37 | XRANDR_STR="xrandr " 38 | for OUTPUT in $(echo "$OUTPUTS"); do 39 | # selected? 40 | echo "checking for output $OUTPUT" 41 | if [ $(echo "$SELECTED_OUTPUTS" | grep "$OUTPUT") ]; then 42 | echo "$OUTPUT enabled" 43 | if [ -z "$PREV_OUTPUT" ] || [ "$PREV_OUTPUT_ENABLED" != "true" ]; then 44 | # first output in command 45 | XRANDR_STR="${XRANDR_STR} --output ${OUTPUT} --auto " 46 | PREV_OUTPUT_ENABLED="true" 47 | else 48 | # subsequent outputs, use --left-of 49 | XRANDR_STR="${XRANDR_STR} --output ${OUTPUT} --right-of ${PREV_OUTPUT} --auto " 50 | fi 51 | else 52 | echo "$OUTPUT disabled" 53 | XRANDR_STR="${XRANDR_STR} --output ${OUTPUT} --off " 54 | fi 55 | PREV_OUTPUT="$OUTPUT" 56 | done 57 | 58 | echo $XRANDR_STR 59 | $XRANDR_STR # execute it 60 | rm /tmp/randrmode # remove display file 61 | fi 62 | 63 | 64 | sh ~/.fehbg 65 | ~/.config/i3/polybar.sh 66 | -------------------------------------------------------------------------------- /.config/sway/musicwatcher.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import i3ipc 3 | import subprocess 4 | 5 | # process all windows on this workspace. hide when leaving and show when entering 6 | # because chrome/ium doesnt consider itself hidden when on an invisible workspace 7 | # this script drops my cpu usage when listening to google music from ~10% to ~3% 8 | 9 | # I'm just putting any workspaces that have chromium apps running on them 10 | WATCHED_WORKSPACES = [5, 6] 11 | 12 | HIDDEN = '_NET_WM_STATE_HIDDEN' 13 | SHOWN = '_NET_WM_STATE_SHOWN' 14 | 15 | def showWindow(windowId): 16 | print("SHOWING") 17 | 18 | subprocess.call(["xprop", "-id", str(windowId), "-f", 19 | "_NET_WM_STATE", "32a", "-remove", HIDDEN]) 20 | subprocess.call(["xprop", "-id", str(windowId), "-f", 21 | "_NET_WM_STATE", "32a", "-set", "_NET_WM_STATE", SHOWN]) 22 | 23 | 24 | def hideWindow(windowId): 25 | print("HIDING") 26 | 27 | subprocess.call(["xprop", "-id", str(windowId), "-f", 28 | "_NET_WM_STATE", "32a", "-remove", SHOWN]) 29 | subprocess.call(["xprop", "-id", str(windowId), "-f", 30 | "_NET_WM_STATE", "32a", "-set", "_NET_WM_STATE", HIDDEN]) 31 | 32 | 33 | def process_window(window, ws_event): 34 | print("Processing window: %s (%d)" % (window.name, window.window)) 35 | 36 | if ws_event.current.num in WATCHED_WORKSPACES: 37 | # music workspace has been focused 38 | showWindow(window.window) 39 | elif ws_event.old.num in WATCHED_WORKSPACES: 40 | # music workspace has been unfocused 41 | hideWindow(window.window) 42 | 43 | def onWorkspace(i3, event): 44 | if event.change in ['focus']: 45 | windows = [ leaf for leaf in i3.get_tree() if (leaf.type == 'con' or leaf.type == 'floating_con') and leaf.workspace().num in WATCHED_WORKSPACES and leaf.name != None ] 46 | 47 | for window in windows: 48 | process_window(window, event) 49 | 50 | i3 = i3ipc.Connection() 51 | 52 | i3.on('workspace', onWorkspace) 53 | i3.main() 54 | -------------------------------------------------------------------------------- /.config/sxhkd/global.sxhkdrc: -------------------------------------------------------------------------------- 1 | # basic launchers 2 | super + Return 3 | urxvtc 4 | 5 | super + shift + Return 6 | urxvtc -name urxvt_floating 7 | 8 | super + shift + p 9 | urxvtc -name urxvt_python -e python 10 | 11 | super + d 12 | dmenu_run -nb '#000000' -nf '#ffffff' -sb '#ff00ff' -sf '#000000' -fn 'Inconsolata-11' 13 | 14 | super + c 15 | gsimplecal 16 | 17 | super + shift + c 18 | gsimplecal 19 | 20 | super + Escape 21 | ~/.config/i3/lockscreen 22 | 23 | super + Print 24 | scrot ~/Pictures/screenshots/`date +%Y%m%d-%H%M%S`.png 25 | 26 | super + shift + Print 27 | maim -s > ~/Pictures/screenshots/`date +%Y%m%d-%H%M%S`.png 28 | 29 | super + Tab 30 | rofi -hide-scrollbar -show window 31 | 32 | super + Scroll_Lock 33 | ~/dotfiles/bin/sysmenu.sh 34 | 35 | ctrl + super + alt + Tab 36 | skippy-xd-toggle 37 | 38 | super + BackSpace 39 | xfce4-taskmanager 40 | 41 | super + shift + g 42 | ~/.config/i3/google_search.sh 43 | 44 | super + Tab 45 | rofi -hide-scrollbar -show window 46 | 47 | super + shift + w 48 | sh ~/.fehbg 49 | 50 | # volume / brightness 51 | XF86AudioMute 52 | ~/.config/i3/volume.sh mute 53 | XF86AudioRaiseVolume 54 | ~/.config/i3/volume.sh up 55 | XF86AudioLowerVolume 56 | ~/.config/i3/volume.sh down 57 | 58 | 59 | XF86MonBrightnessUp 60 | ~/.config/i3/backlight.sh up 61 | XF86MonBrightnessDown 62 | ~/.config/i3/backlight.sh down 63 | XF86KbdBrightnessUp 64 | ~/.config/i3/kb-backlight.sh up 65 | XF86KbdBrightnessDown 66 | ~/.config/i3/kb-backlight.sh down 67 | 68 | # divvy 69 | alt + super + {q,a,d,e,h,l,z,x,c} 70 | ~/bin/divvy { quarter-top-left,quarter-bottom-left,quarter-bottom-right,quarter-top-right,half-left,half-right,third-left,third-middle,third-right} 0 15 71 | 72 | alt + super + {y,u,b,n,g} 73 | ~/bin/move_window {top-left,top-right,bottom-left,bottom-right,center} 74 | 75 | # dmenu things 76 | super + z 77 | ~/bin/metroid.sh 78 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/tabline/autoshow.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | let s:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1) 7 | let s:buf_min_count = get(g:, 'airline#extensions#tabline#buffer_min_count', 0) 8 | let s:tab_min_count = get(g:, 'airline#extensions#tabline#tab_min_count', 0) 9 | 10 | function! airline#extensions#tabline#autoshow#off() 11 | if exists('s:original_tabline') 12 | let &tabline = s:original_tabline 13 | let &showtabline = s:original_showtabline 14 | endif 15 | 16 | augroup airline_tabline_autoshow 17 | autocmd! 18 | augroup END 19 | endfunction 20 | 21 | function! airline#extensions#tabline#autoshow#on() 22 | let [ s:original_tabline, s:original_showtabline ] = [ &tabline, &showtabline ] 23 | 24 | augroup airline_tabline_autoshow 25 | autocmd! 26 | if s:buf_min_count <= 0 && s:tab_min_count <= 1 27 | if &lines > 3 28 | set showtabline=2 29 | endif 30 | else 31 | if s:show_buffers == 1 32 | autocmd BufEnter * call show_tabline(s:buf_min_count, len(airline#extensions#tabline#buflist#list())) 33 | autocmd BufUnload * call show_tabline(s:buf_min_count, len(airline#extensions#tabline#buflist#list()) - 1) 34 | else 35 | autocmd TabEnter * call show_tabline(s:tab_min_count, tabpagenr('$')) 36 | endif 37 | endif 38 | 39 | " Invalidate cache. This has to come after the BufUnload for 40 | " s:show_buffers, to invalidate the cache for BufEnter. 41 | autocmd BufLeave,BufAdd,BufUnload * call airline#extensions#tabline#buflist#invalidate() 42 | augroup END 43 | endfunction 44 | 45 | function! s:show_tabline(min_count, total_count) 46 | if a:total_count >= a:min_count 47 | if &showtabline != 2 && &lines > 3 48 | set showtabline=2 49 | endif 50 | else 51 | if &showtabline != 0 52 | set showtabline=0 53 | endif 54 | endif 55 | endfunction 56 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/quickfix.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | let g:airline#extensions#quickfix#quickfix_text = 'Quickfix' 7 | let g:airline#extensions#quickfix#location_text = 'Location' 8 | 9 | function! airline#extensions#quickfix#apply(...) 10 | if &buftype == 'quickfix' 11 | let w:airline_section_a = s:get_text() 12 | let w:airline_section_b = '%{get(w:, "quickfix_title", "")}' 13 | let w:airline_section_c = '' 14 | let w:airline_section_x = '' 15 | endif 16 | endfunction 17 | 18 | function! airline#extensions#quickfix#init(ext) 19 | call a:ext.add_statusline_func('airline#extensions#quickfix#apply') 20 | call a:ext.add_inactive_statusline_func('airline#extensions#quickfix#inactive_qf_window') 21 | endfunction 22 | 23 | function! airline#extensions#quickfix#inactive_qf_window(...) 24 | if getbufvar(a:2.bufnr, '&filetype') is# 'qf' && !empty(airline#util#getwinvar(a:2.winnr, 'quickfix_title', '')) 25 | call setwinvar(a:2.winnr, 'airline_section_c', '[%{get(w:, "quickfix_title", "")}] %f %m') 26 | endif 27 | endfunction 28 | 29 | function! s:get_text() 30 | if exists("*win_getid") && exists("*getwininfo") 31 | let dict = getwininfo(win_getid()) 32 | if len(dict) > 0 && get(dict[0], 'quickfix', 0) && !get(dict[0], 'loclist', 0) 33 | return g:airline#extensions#quickfix#quickfix_text 34 | elseif len(dict) > 0 && get(dict[0], 'quickfix', 0) && get(dict[0], 'loclist', 0) 35 | return g:airline#extensions#quickfix#location_text 36 | endif 37 | endif 38 | redir => buffers 39 | silent ls 40 | redir END 41 | 42 | let nr = bufnr('%') 43 | for buf in split(buffers, '\n') 44 | if match(buf, '\v^\s*'.nr) > -1 45 | if match(buf, '\cQuickfix') > -1 46 | return g:airline#extensions#quickfix#quickfix_text 47 | else 48 | return g:airline#extensions#quickfix#location_text 49 | endif 50 | endif 51 | endfor 52 | return '' 53 | endfunction 54 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/ravenpower.vim: -------------------------------------------------------------------------------- 1 | " Pretty much powerlineish clone, and some 2 | " of the hex colours was borrowed from raven 3 | 4 | " Normal mode " fg & bg 5 | let s:N1 = [ '#005f00' , '#1d1f21' , 7 , 8 ] " darkestgreen & brightgreen 6 | let s:N2 = [ '#9e9e9e' , '#303030' , 247 , 236 ] " gray8 & gray2 7 | let s:N3 = [ '#c8c8c8' , '#2e2e2e' , 188 , 235 ] " white & gray4 8 | 9 | " Insert mode " fg & bg 10 | "let s:I1 = [ '#005f5f' , '#ffffff' , 23 , 231 ] " darkestcyan & white 11 | "let s:I2 = [ '#5fafd7' , '#0087af' , 74 , 31 ] " darkcyan & darkblue 12 | let s:I1 = [ '#87d7ff' , '#1d1f21' , 7 , 24 ] " mediumcyan & darkestblue 13 | 14 | " Visual mode " fg & bg 15 | let s:V1 = [ '#080808' , '#ffaf00' , 232 , 214 ] " gray3 & brightestorange 16 | 17 | " Replace mode " fg & bg 18 | let s:RE = [ '#ffffff' , '#d70000' , 231 , 160 ] " white & brightred 19 | 20 | let g:airline#themes#ravenpower#palette = {} 21 | 22 | let g:airline#themes#ravenpower#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 23 | 24 | let g:airline#themes#ravenpower#palette.insert = airline#themes#generate_color_map(s:I1, s:N2, s:N3) 25 | let g:airline#themes#ravenpower#palette.insert_replace = { 26 | \ 'airline_a': [ s:RE[0] , s:I1[1] , s:RE[1] , s:I1[3] , '' ] } 27 | 28 | let g:airline#themes#ravenpower#palette.visual = { 29 | \ 'airline_a': [ s:V1[0] , s:V1[1] , s:V1[2] , s:V1[3] , '' ] } 30 | 31 | let g:airline#themes#ravenpower#palette.replace = copy(airline#themes#ravenpower#palette.normal) 32 | let g:airline#themes#ravenpower#palette.replace.airline_a = [ s:RE[0] , s:RE[1] , s:RE[2] , s:RE[3] , '' ] 33 | 34 | 35 | let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ] 36 | let g:airline#themes#ravenpower#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) 37 | -------------------------------------------------------------------------------- /.vim/ale_linters/swift/swiftpm.vim: -------------------------------------------------------------------------------- 1 | if !exists('g:ale_swift_swiftpm_executable') 2 | let g:ale_swift_swiftpm_executable = 'swift' 3 | endif 4 | 5 | if !exists('g:ale_swift_swiftpm_arguments') 6 | let g:ale_swift_swiftpm_arguments = 'build' 7 | endif 8 | 9 | function! ale_linters#swift#swiftpm#GetExecutable(buffer) 10 | if !filereadable('Package.swift') 11 | return '' 12 | endif 13 | 14 | return g:ale_swift_swiftpm_executable 15 | endfunction 16 | 17 | function! ale_linters#swift#swiftpm#GetCommand(buffer) 18 | return g:ale_swift_swiftpm_executable 19 | \ . ' ' 20 | \ . g:ale_swift_swiftpm_arguments 21 | endfunction 22 | 23 | function! ale_linters#swift#swiftpm#Handle(buffer, lines) 24 | " Match and ignore file path (anything but :) 25 | " Match and capture line number 26 | " Match and capture column number 27 | " Match and capture anything in the message 28 | let l:pattern = '^[^:]\+:\(\d\+\):\(\d\+\):\s*\(error\|warning\):\s*\(.*\)$' 29 | let l:output = [] 30 | 31 | for l:line in a:lines 32 | let l:match = matchlist(l:line, l:pattern) 33 | 34 | if len(l:match) == 0 35 | continue 36 | endif 37 | 38 | let l:line_number = l:match[1] 39 | let l:column = l:match[2] 40 | let l:type = l:match[3] 41 | let l:text = l:match[4] 42 | let l:type_identifier = 'N' 43 | 44 | if l:type == 'error' 45 | let l:type_identifier = 'E' 46 | elseif l:type == 'warning' 47 | let l:type_identifier = 'W' 48 | endif 49 | 50 | call add(l:output, { 51 | \ 'bufnr': a:buffer, 52 | \ 'lnum': l:line_number, 53 | \ 'vcol': 0, 54 | \ 'col': l:column, 55 | \ 'text': l:text, 56 | \ 'type': l:type_identifier, 57 | \ }) 58 | endfor 59 | 60 | return l:output 61 | endfunction 62 | 63 | call ale#linter#Define('swift', { 64 | \ 'name': 'swiftpm', 65 | \ 'executable_callback': 'ale_linters#swift#swiftpm#GetExecutable', 66 | \ 'command_callback': 'ale_linters#swift#swiftpm#GetCommand', 67 | \ 'callback': 'ale_linters#swift#swiftpm#Handle', 68 | \ 'lint_file': 1, 69 | \ }) 70 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/serene.vim: -------------------------------------------------------------------------------- 1 | let g:airline#themes#serene#palette = {} 2 | 3 | let s:guibg = '#080808' 4 | let s:termbg = 232 5 | let s:termsep = 236 6 | let s:guisep = '#303030' 7 | 8 | let s:N1 = [ '#00dfff' , s:guibg , 45 , s:termbg ] 9 | let s:N2 = [ '#ff5f00' , s:guibg , 202 , s:termbg ] 10 | let s:N3 = [ '#767676' , s:guibg , 7 , s:termbg ] 11 | 12 | let g:airline#themes#serene#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 13 | let g:airline#themes#serene#palette.normal_modified = { 14 | \ 'airline_c': [ '#df0000' , s:guibg, 160 , s:termbg , '' ] , 15 | \ } 16 | 17 | let s:I1 = [ '#5fff00' , s:guibg , 82 , s:termbg ] 18 | let s:I2 = [ '#ff5f00' , s:guibg , 202 , s:termbg ] 19 | let s:I3 = [ '#767676' , s:guibg , 7 , s:termbg ] 20 | let g:airline#themes#serene#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 21 | let g:airline#themes#serene#palette.insert_modified = copy(g:airline#themes#serene#palette.normal_modified) 22 | let g:airline#themes#serene#palette.insert_paste = { 23 | \ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] , 24 | \ } 25 | 26 | let g:airline#themes#serene#palette.replace = { 27 | \ 'airline_a': [ s:I1[0] , '#af0000' , s:I1[2] , 124 , '' ] , 28 | \ } 29 | let g:airline#themes#serene#palette.replace_modified = copy(g:airline#themes#serene#palette.normal_modified) 30 | 31 | let s:V1 = [ '#dfdf00' , s:guibg , 184 , s:termbg ] 32 | let s:V2 = [ '#ff5f00' , s:guibg , 202 , s:termbg ] 33 | let s:V3 = [ '#767676' , s:guibg , 7 , s:termbg ] 34 | let g:airline#themes#serene#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) 35 | let g:airline#themes#serene#palette.visual_modified = copy(g:airline#themes#serene#palette.normal_modified) 36 | 37 | let s:IA = [ '#4e4e4e' , s:guibg , 239 , s:termbg , '' ] 38 | let s:IA2 = [ '#4e4e4e' , s:guisep , 239 , s:termsep , '' ] 39 | let g:airline#themes#serene#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA2, s:IA2) 40 | let g:airline#themes#serene#palette.inactive_modified = copy(g:airline#themes#serene#palette.normal_modified) 41 | 42 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/simple.vim: -------------------------------------------------------------------------------- 1 | let g:airline#themes#simple#palette = {} 2 | 3 | let s:guibg = '#080808' 4 | let s:guibg2 = '#1c1c1c' 5 | let s:termbg = 232 6 | let s:termbg2= 234 7 | 8 | let s:N1 = [ s:guibg , '#00dfff' , s:termbg , 45 ] 9 | let s:N2 = [ '#ff5f00' , s:guibg2, 202 , s:termbg2 ] 10 | let s:N3 = [ '#767676' , s:guibg, 243 , s:termbg] 11 | let g:airline#themes#simple#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 12 | let g:airline#themes#simple#palette.normal_modified = { 13 | \ 'airline_c': [ '#df0000' , s:guibg, 160 , s:termbg , '' ] , 14 | \ } 15 | 16 | 17 | let s:I1 = [ s:guibg, '#5fff00' , s:termbg , 82 ] 18 | let s:I2 = [ '#ff5f00' , s:guibg2, 202 , s:termbg2 ] 19 | let s:I3 = [ '#767676' , s:guibg, 243 , s:termbg ] 20 | let g:airline#themes#simple#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 21 | let g:airline#themes#simple#palette.insert_modified = copy(g:airline#themes#simple#palette.normal_modified) 22 | let g:airline#themes#simple#palette.insert_paste = { 23 | \ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] , 24 | \ } 25 | 26 | 27 | let g:airline#themes#simple#palette.replace = { 28 | \ 'airline_a': [ s:I1[0] , '#af0000' , s:I1[2] , 124 , '' ] , 29 | \ } 30 | let g:airline#themes#simple#palette.replace_modified = copy(g:airline#themes#simple#palette.normal_modified) 31 | 32 | 33 | let s:V1 = [ s:guibg, '#dfdf00' , s:termbg , 184 ] 34 | let s:V2 = [ '#ff5f00' , s:guibg2, 202 , s:termbg2 ] 35 | let s:V3 = [ '#767676' , s:guibg, 243 , s:termbg ] 36 | let g:airline#themes#simple#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) 37 | let g:airline#themes#simple#palette.visual_modified = copy(g:airline#themes#simple#palette.normal_modified) 38 | 39 | 40 | let s:IA = [ '#4e4e4e' , s:guibg , 239 , s:termbg , '' ] 41 | let s:IA2 = [ '#4e4e4e' , s:guibg2 , 239 , s:termbg2 , '' ] 42 | let g:airline#themes#simple#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA2, s:IA2) 43 | let g:airline#themes#simple#palette.inactive_modified = { 44 | \ 'airline_c': [ '#df0000', '', 160, '', '' ] , 45 | \ } 46 | 47 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/eclim.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | if !exists(':ProjectCreate') 7 | finish 8 | endif 9 | 10 | function! airline#extensions#eclim#creat_line(...) 11 | if &filetype == "tree" 12 | let builder = a:1 13 | call builder.add_section('airline_a', ' Project ') 14 | call builder.add_section('airline_b', ' %f ') 15 | call builder.add_section('airline_c', '') 16 | return 1 17 | endif 18 | endfunction 19 | 20 | function! airline#extensions#eclim#get_warnings() 21 | " Cache vavlues, so that it isn't called too often 22 | if exists("s:eclim_errors") && 23 | \ get(b:, 'airline_changenr', 0) == changenr() 24 | return s:eclim_errors 25 | endif 26 | let eclimList = eclim#display#signs#GetExisting() 27 | let s:eclim_errors = '' 28 | 29 | if !empty(eclimList) 30 | " Remove any non-eclim signs (see eclim#display#signs#Update) 31 | " First check for just errors since they are more important. 32 | " If there are no errors, then check for warnings. 33 | let errorList = filter(copy(eclimList), 'v:val.name =~ "^\\(qf_\\)\\?\\(error\\)$"') 34 | 35 | if (empty(errorList)) 36 | " use the warnings 37 | call filter(eclimList, 'v:val.name =~ "^\\(qf_\\)\\?\\(warning\\)$"') 38 | let type = 'W' 39 | else 40 | " Use the errors 41 | let eclimList = errorList 42 | let type = 'E' 43 | endif 44 | 45 | if !empty(eclimList) 46 | let errorsLine = eclimList[0]['line'] 47 | let errorsNumber = len(eclimList) 48 | let errors = "[Eclim:" . type . " line:".string(errorsLine)." (".string(errorsNumber).")]" 49 | if !exists(':SyntasticCheck') || SyntasticStatuslineFlag() == '' 50 | let s:eclim_errors = errors.(g:airline_symbols.space) 51 | endif 52 | endif 53 | endif 54 | let b:airline_changenr = changenr() 55 | return s:eclim_errors 56 | endfunction 57 | 58 | function! airline#extensions#eclim#init(ext) 59 | call airline#parts#define_function('eclim', 'airline#extensions#eclim#get_warnings') 60 | call a:ext.add_statusline_func('airline#extensions#eclim#creat_line') 61 | endfunction 62 | 63 | -------------------------------------------------------------------------------- /.vimrc: -------------------------------------------------------------------------------- 1 | set number 2 | colorscheme grb256 3 | 4 | set laststatus=2 5 | set updatetime=250 6 | set shiftwidth=4 7 | set tabstop=4 8 | set expandtab 9 | set softtabstop=4 10 | set autoindent 11 | set showcmd 12 | set hlsearch 13 | set incsearch 14 | set modeline 15 | 16 | syntax enable 17 | 18 | set mouse=a 19 | 20 | highlight SignColumn ctermbg=NONE 21 | 22 | let g:airline#extensions#tabline#enabled = 1 23 | let g:airline_powerline_fonts = 1 24 | let g:airline_theme='surarken' 25 | let g:airline#extensions#tabline#show_buffers = 0 26 | 27 | let mapleader = ',' 28 | 29 | noremap gt 30 | noremap gT 31 | 32 | " set terminal title to name of file 33 | set title 34 | 35 | " double space tabs 36 | autocmd FileType c,cpp setl sw=2 sts=2 et 37 | " clear trailing whitespace on files just before saving 38 | autocmd FileType c,cpp,sh,python autocmd BufWritePre %s/\s\+$//e 39 | 40 | " comment the current line for various file types 41 | augroup comments 42 | autocmd! 43 | autocmd FIleType html nnoremap c I 44 | autocmd FileType python,bash,sh nnoremap c I# 45 | autocmd FileType php,c,cpp,javascript nnoremap c I// 46 | autocmd FileType vim nnoremap c I" 47 | augroup END 48 | 49 | " quickly edit and source vimrc 50 | nnoremap ev :vsplit $MYVIMRC 51 | nnoremap sv :source $MYVIMRC 52 | 53 | " uppercase/lowercase the current word 54 | nnoremap U viwU 55 | nnoremap u viwu 56 | inoremap U viwUi 57 | inoremap u viwui 58 | 59 | " surround current word in single/double quotes 60 | nnoremap " viwa"bi"lel 61 | nnoremap ' viwa'bi'lel 62 | 63 | " surround current visual selection in single/double quotes 64 | nnoremap v" viw`a"`>a" 65 | nnoremap v' viw`a'`>a' 66 | 67 | " move current line down/up 68 | nnoremap - ddp 69 | nnoremap _ ddP 70 | 71 | augroup modelines 72 | autocmd! 73 | autocmd FileType python,bash,sh nnoremap m I# vim: sw=2 ts=2 sts=2 et : 74 | autocmd FileType php,c,cpp,javascript nnoremap m I// vim: sw=2 ts=2 sts=2 et : 75 | augroup END 76 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/light.vim: -------------------------------------------------------------------------------- 1 | let g:airline#themes#light#palette = {} 2 | 3 | let s:N1 = [ '#ffffff' , '#005fff' , 255 , 27 ] 4 | let s:N2 = [ '#000087' , '#00dfff' , 18 , 45 ] 5 | let s:N3 = [ '#005fff' , '#afffff' , 27 , 159 ] 6 | let g:airline#themes#light#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 7 | let g:airline#themes#light#palette.normal_modified = { 8 | \ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] , 9 | \ } 10 | 11 | 12 | let s:I1 = [ '#ffffff' , '#00875f' , 255 , 29 ] 13 | let s:I2 = [ '#005f00' , '#00df87' , 22 , 42 ] 14 | let s:I3 = [ '#005f5f' , '#afff87' , 23 , 156 ] 15 | let g:airline#themes#light#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 16 | let g:airline#themes#light#palette.insert_modified = { 17 | \ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] , 18 | \ } 19 | let g:airline#themes#light#palette.insert_paste = { 20 | \ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] , 21 | \ } 22 | 23 | 24 | let g:airline#themes#light#palette.replace = copy(g:airline#themes#light#palette.insert) 25 | let g:airline#themes#light#palette.replace.airline_a = [ s:I2[0] , '#ff0000' , s:I1[2] , 196 , '' ] 26 | let g:airline#themes#light#palette.replace_modified = g:airline#themes#light#palette.insert_modified 27 | 28 | 29 | let s:V1 = [ '#ffffff' , '#ff5f00' , 255 , 202 ] 30 | let s:V2 = [ '#5f0000' , '#ffaf00' , 52 , 214 ] 31 | let s:V3 = [ '#df5f00' , '#ffff87' , 166 , 228 ] 32 | let g:airline#themes#light#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) 33 | let g:airline#themes#light#palette.visual_modified = { 34 | \ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] , 35 | \ } 36 | 37 | 38 | let s:IA1 = [ '#666666' , '#b2b2b2' , 242 , 249 , '' ] 39 | let s:IA2 = [ '#8a8a8a' , '#d0d0d0' , 245 , 252 , '' ] 40 | let s:IA3 = [ '#a8a8a8' , '#ffffff' , 248 , 255 , '' ] 41 | let g:airline#themes#light#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3) 42 | let g:airline#themes#light#palette.inactive_modified = { 43 | \ 'airline_c': [ '#df0000' , '' , 160 , '' , '' ] , 44 | \ } 45 | 46 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/example.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | " we don't actually want this loaded :P 7 | finish 8 | 9 | " Due to some potential rendering issues, the use of the `space` variable is 10 | " recommended. 11 | let s:spc = g:airline_symbols.space 12 | 13 | " Extension specific variables can be defined the usual fashion. 14 | if !exists('g:airline#extensions#example#number_of_cats') 15 | let g:airline#extensions#example#number_of_cats = 42 16 | endif 17 | 18 | " First we define an init function that will be invoked from extensions.vim 19 | function! airline#extensions#example#init(ext) 20 | 21 | " Here we define a new part for the plugin. This allows users to place this 22 | " extension in arbitrary locations. 23 | call airline#parts#define_raw('cats', '%{airline#extensions#example#get_cats()}') 24 | 25 | " Next up we add a funcref so that we can run some code prior to the 26 | " statusline getting modifed. 27 | call a:ext.add_statusline_func('airline#extensions#example#apply') 28 | 29 | " You can also add a funcref for inactive statuslines. 30 | " call a:ext.add_inactive_statusline_func('airline#extensions#example#unapply') 31 | endfunction 32 | 33 | " This function will be invoked just prior to the statusline getting modified. 34 | function! airline#extensions#example#apply(...) 35 | " First we check for the filetype. 36 | if &filetype == "nyancat" 37 | 38 | " Let's say we want to append to section_c, first we check if there's 39 | " already a window-local override, and if not, create it off of the global 40 | " section_c. 41 | let w:airline_section_c = get(w:, 'airline_section_c', g:airline_section_c) 42 | 43 | " Then we just append this extenion to it, optionally using separators. 44 | let w:airline_section_c .= s:spc.g:airline_left_alt_sep.s:spc.'%{airline#extensions#example#get_cats()}' 45 | endif 46 | endfunction 47 | 48 | " Finally, this function will be invoked from the statusline. 49 | function! airline#extensions#example#get_cats() 50 | let cats = '' 51 | for i in range(1, g:airline#extensions#example#number_of_cats) 52 | let cats .= ' (,,,)=(^.^)=(,,,) ' 53 | endfor 54 | return cats 55 | endfunction 56 | 57 | -------------------------------------------------------------------------------- /.vim/t/themes.vim: -------------------------------------------------------------------------------- 1 | describe 'themes' 2 | after 3 | highlight clear Foo 4 | highlight clear Normal 5 | end 6 | 7 | it 'should extract correct colors' 8 | highlight Foo ctermfg=1 ctermbg=2 9 | let colors = airline#themes#get_highlight('Foo') 10 | Expect colors[2] == '1' 11 | Expect colors[3] == '2' 12 | end 13 | 14 | it 'should extract from normal if colors unavailable' 15 | highlight Normal ctermfg=100 ctermbg=200 16 | highlight Foo ctermbg=2 17 | let colors = airline#themes#get_highlight('Foo') 18 | Expect colors[2] == '100' 19 | Expect colors[3] == '2' 20 | end 21 | 22 | it 'should flip target group if it is reversed' 23 | highlight Foo ctermbg=222 ctermfg=103 term=reverse 24 | let colors = airline#themes#get_highlight('Foo') 25 | Expect colors[2] == '222' 26 | Expect colors[3] == '103' 27 | end 28 | 29 | it 'should pass args through correctly' 30 | let hl = airline#themes#get_highlight('Foo', 'bold', 'italic') 31 | Expect hl == ['', '', 'NONE', 'NONE', 'bold,italic'] 32 | 33 | let hl = airline#themes#get_highlight2(['Foo','bg'], ['Foo','fg'], 'italic', 'bold') 34 | Expect hl == ['', '', 'NONE', 'NONE', 'italic,bold'] 35 | end 36 | 37 | it 'should generate color map with mirroring' 38 | let map = airline#themes#generate_color_map( 39 | \ [ 1, 1, 1, 1, '1' ], 40 | \ [ 2, 2, 2, 2, '2' ], 41 | \ [ 3, 3, 3, 3, '3' ], 42 | \ ) 43 | Expect map.airline_a[0] == 1 44 | Expect map.airline_b[0] == 2 45 | Expect map.airline_c[0] == 3 46 | Expect map.airline_x[0] == 3 47 | Expect map.airline_y[0] == 2 48 | Expect map.airline_z[0] == 1 49 | end 50 | 51 | it 'should generate color map with full set of colors' 52 | let map = airline#themes#generate_color_map( 53 | \ [ 1, 1, 1, 1, '1' ], 54 | \ [ 2, 2, 2, 2, '2' ], 55 | \ [ 3, 3, 3, 3, '3' ], 56 | \ [ 4, 4, 4, 4, '4' ], 57 | \ [ 5, 5, 5, 5, '5' ], 58 | \ [ 6, 6, 6, 6, '6' ], 59 | \ ) 60 | Expect map.airline_a[0] == 1 61 | Expect map.airline_b[0] == 2 62 | Expect map.airline_c[0] == 3 63 | Expect map.airline_x[0] == 4 64 | Expect map.airline_y[0] == 5 65 | Expect map.airline_z[0] == 6 66 | end 67 | end 68 | 69 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/aurora.vim: -------------------------------------------------------------------------------- 1 | " Normal mode 2 | let s:N1 = [ '#ffffff' , '#5f00af' , 231 , 55 ] 3 | let s:N2 = [ '#ffffff' , '#875fd7' , 231 , 98 ] 4 | let s:N3 = [ '#333333' , '#efefef' , 59 , 255 ] 5 | 6 | " Insert mode 7 | let s:I1 = [ '#ffffff' , '#005fff' , 231 , 27 ] 8 | let s:I2 = [ '#ffffff' , '#00afff' , 231 , 39 ] 9 | let s:I3 = [ '#333333' , '#efefef' , 59 , 255 ] 10 | 11 | " Visual mode 12 | let s:V1 = [ '#121212' , '#ff5f00' , 233 , 202 ] 13 | let s:V2 = [ '#121212' , '#ffaf00' , 233 , 214 ] 14 | let s:V3 = [ '#333333' , '#efefef' , 59 , 255 ] 15 | 16 | " Replace mode 17 | let s:R1 = [ '#ffffff' , '#ff0000' , 231 , 196 ] 18 | let s:R2 = [ '#ffffff' , '#ff5f5f' , 231 , 203 ] 19 | let s:R3 = [ '#333333' , '#efefef' , 59 , 255 ] 20 | 21 | let g:airline#themes#aurora#palette = {} 22 | let g:airline#themes#aurora#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 23 | let g:airline#themes#aurora#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 24 | let g:airline#themes#aurora#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) 25 | let g:airline#themes#aurora#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3) 26 | 27 | " Inactive mode 28 | let s:IN1 = [ '#9e9e9e' , '#9e9e9e' , 247 , 247 ] 29 | let s:IN2 = [ '#efefef' , '#efefef' , 255 , 255 ] 30 | 31 | let s:IA = [ s:IN1[1] , s:IN2[1] , s:IN1[3] , s:IN2[3] , '' ] 32 | let g:airline#themes#aurora#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) 33 | 34 | " CtrlP 35 | if !get(g:, 'loaded_ctrlp', 0) 36 | finish 37 | endif 38 | 39 | let s:CP1 = [ '#ffffff' , '#5f00af' , 231 , 55 ] 40 | let s:CP2 = [ '#ffffff' , '#875fd7' , 231 , 98 ] 41 | let s:CP3 = [ '#5f00af' , '#ffffff' , 55 , 231 ] 42 | 43 | let g:airline#themes#aurora#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(s:CP1, s:CP2, s:CP3) 44 | 45 | " Tabline 46 | let g:airline#themes#aurora#palette.tabline = { 47 | \ 'airline_tab': [ '#ffffff' , '#5f00af' , 231 , 55 , '' ], 48 | \ 'airline_tabsel': [ '#ffffff' , '#875fd7' , 231 , 98 , '' ], 49 | \ 'airline_tabtype': [ '#ffffff' , '#875fd7' , 231 , 98 , '' ], 50 | \ 'airline_tabfill': [ '#ffffff' , '#121212' , 231 , 16 , '' ], 51 | \ 'airline_tabmod': [ '#ffffff' , '#ff5f5f' , 231 , 203 , '' ] 52 | \ } 53 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/xtermlight.vim: -------------------------------------------------------------------------------- 1 | let g:airline#themes#xtermlight#palette = {} 2 | 3 | let s:N1 = [ '#eeeeee' , '#005fff' , 255 , 27 ] 4 | let s:N2 = [ '#000087' , '#00d7ff' , 18 , 45 ] 5 | let s:N3 = [ '#005fff' , '#afffff' , 27 , 159 ] 6 | let g:airline#themes#xtermlight#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 7 | let g:airline#themes#xtermlight#palette.normal_modified = { 8 | \ 'airline_c': [ '#d70000' , '#ffdfdf' , 160 , 224 , '' ] , 9 | \ } 10 | 11 | 12 | let s:I1 = [ '#eeeeee' , '#00875f' , 255 , 29 ] 13 | let s:I2 = [ '#005f00' , '#00d787' , 22 , 42 ] 14 | let s:I3 = [ '#005f5f' , '#afff87' , 23 , 156 ] 15 | let g:airline#themes#xtermlight#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 16 | let g:airline#themes#xtermlight#palette.insert_modified = { 17 | \ 'airline_c': [ '#d70000' , '#ffdfdf' , 160 , 224 , '' ] , 18 | \ } 19 | let g:airline#themes#xtermlight#palette.insert_paste = { 20 | \ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] , 21 | \ } 22 | 23 | 24 | let g:airline#themes#xtermlight#palette.replace = copy(g:airline#themes#xtermlight#palette.insert) 25 | let g:airline#themes#xtermlight#palette.replace.airline_a = [ s:I2[0] , '#ff0000' , s:I1[2] , 196 , '' ] 26 | let g:airline#themes#xtermlight#palette.replace_modified = g:airline#themes#xtermlight#palette.insert_modified 27 | 28 | 29 | let s:V1 = [ '#eeeeee' , '#ff5f00' , 255 , 202 ] 30 | let s:V2 = [ '#5f0000' , '#ffaf00' , 52 , 214 ] 31 | let s:V3 = [ '#d75f00' , '#ffff87' , 166 , 228 ] 32 | let g:airline#themes#xtermlight#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) 33 | let g:airline#themes#xtermlight#palette.visual_modified = { 34 | \ 'airline_c': [ '#d70000' , '#ffdfdf' , 160 , 224 , '' ] , 35 | \ } 36 | 37 | 38 | let s:IA1 = [ '#6c6c6c' , '#b2b2b2' , 242 , 249 , '' ] 39 | let s:IA2 = [ '#8a8a8a' , '#d0d0d0' , 245 , 252 , '' ] 40 | let s:IA3 = [ '#a8a8a8' , '#eeeeee' , 248 , 255 , '' ] 41 | let g:airline#themes#xtermlight#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3) 42 | let g:airline#themes#xtermlight#palette.inactive_modified = { 43 | \ 'airline_c': [ '#d70000' , '' , 160 , '' , '' ] , 44 | \ } 45 | 46 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/zenburn.vim: -------------------------------------------------------------------------------- 1 | let g:airline#themes#zenburn#palette = {} 2 | 3 | function! airline#themes#zenburn#refresh() 4 | let g:airline#themes#zenburn#palette.accents = { 5 | \ 'red': airline#themes#get_highlight('Constant'), 6 | \ } 7 | 8 | let s:N1 = airline#themes#get_highlight2(['DbgCurrent', 'bg'], ['Folded', 'fg'], 'bold') 9 | let s:N2 = airline#themes#get_highlight('Folded') 10 | let s:N3 = airline#themes#get_highlight('NonText') 11 | 12 | let g:airline#themes#zenburn#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 13 | let s:Nmod = airline#themes#get_highlight('Comment') 14 | let g:airline#themes#zenburn#palette.normal_modified = { 15 | \ 'airline_c': s:Nmod 16 | \ } 17 | 18 | let s:I1 = airline#themes#get_highlight2(['DbgCurrent', 'bg'], ['String', 'fg'], 'bold') 19 | let s:I2 = airline#themes#get_highlight2(['String', 'fg'], ['Folded', 'bg']) 20 | let s:I3 = s:N3 21 | let g:airline#themes#zenburn#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 22 | let g:airline#themes#zenburn#palette.insert_modified = g:airline#themes#zenburn#palette.normal_modified 23 | 24 | let s:R1 = airline#themes#get_highlight2(['DbgCurrent', 'bg'], ['Comment', 'fg'], 'bold') 25 | let s:R2 = airline#themes#get_highlight2(['Comment', 'fg'], ['Folded', 'bg']) 26 | let s:R3 = s:N3 27 | let g:airline#themes#zenburn#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3) 28 | let g:airline#themes#zenburn#palette.replace_modified = g:airline#themes#zenburn#palette.normal_modified 29 | 30 | let s:V1 = airline#themes#get_highlight2(['DbgCurrent', 'bg'], ['Identifier', 'fg'], 'bold') 31 | let s:V2 = airline#themes#get_highlight2(['Identifier', 'fg'], ['Folded', 'bg']) 32 | let s:V3 = s:N3 33 | let g:airline#themes#zenburn#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) 34 | let g:airline#themes#zenburn#palette.visual_modified = g:airline#themes#zenburn#palette.normal_modified 35 | 36 | let s:IA = airline#themes#get_highlight('NonText') 37 | let g:airline#themes#zenburn#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) 38 | let g:airline#themes#zenburn#palette.inactive_modified = { 39 | \ 'airline_c': s:Nmod 40 | \ } 41 | endfunction 42 | 43 | call airline#themes#zenburn#refresh() 44 | 45 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/tomorrow.vim: -------------------------------------------------------------------------------- 1 | let g:airline#themes#tomorrow#palette = {} 2 | 3 | function! airline#themes#tomorrow#refresh() 4 | let g:airline#themes#tomorrow#palette.accents = { 5 | \ 'red': airline#themes#get_highlight('Constant'), 6 | \ } 7 | 8 | let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Directory', 'fg'], 'bold') 9 | let s:N2 = airline#themes#get_highlight('Pmenu') 10 | let s:N3 = airline#themes#get_highlight('CursorLine') 11 | let g:airline#themes#tomorrow#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 12 | 13 | let group = airline#themes#get_highlight('vimCommand') 14 | let g:airline#themes#tomorrow#palette.normal_modified = { 15 | \ 'airline_c': [ group[0], '', group[2], '', '' ] 16 | \ } 17 | 18 | let s:I1 = airline#themes#get_highlight2(['Normal', 'bg'], ['MoreMsg', 'fg'], 'bold') 19 | let s:I2 = airline#themes#get_highlight2(['MoreMsg', 'fg'], ['Normal', 'bg']) 20 | let s:I3 = s:N3 21 | let g:airline#themes#tomorrow#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 22 | let g:airline#themes#tomorrow#palette.insert_modified = g:airline#themes#tomorrow#palette.normal_modified 23 | 24 | let s:R1 = airline#themes#get_highlight('Error', 'bold') 25 | let s:R2 = s:N2 26 | let s:R3 = s:N3 27 | let g:airline#themes#tomorrow#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3) 28 | let g:airline#themes#tomorrow#palette.replace_modified = g:airline#themes#tomorrow#palette.normal_modified 29 | 30 | let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Constant', 'fg'], 'bold') 31 | let s:V2 = airline#themes#get_highlight2(['Constant', 'fg'], ['Normal', 'bg']) 32 | let s:V3 = s:N3 33 | let g:airline#themes#tomorrow#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) 34 | let g:airline#themes#tomorrow#palette.visual_modified = g:airline#themes#tomorrow#palette.normal_modified 35 | 36 | let s:IA = airline#themes#get_highlight2(['NonText', 'fg'], ['CursorLine', 'bg']) 37 | let g:airline#themes#tomorrow#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) 38 | let g:airline#themes#tomorrow#palette.inactive_modified = { 39 | \ 'airline_c': [ group[0], '', group[2], '', '' ] 40 | \ } 41 | endfunction 42 | 43 | call airline#themes#tomorrow#refresh() 44 | 45 | -------------------------------------------------------------------------------- /.vim/t/init.vim: -------------------------------------------------------------------------------- 1 | let s:sections = ['a', 'b', 'c', 'gutter', 'x', 'y', 'z', 'warning'] 2 | 3 | function! s:clear() 4 | for key in s:sections 5 | unlet! g:airline_section_{key} 6 | endfor 7 | endfunction 8 | 9 | call airline#init#bootstrap() 10 | 11 | describe 'init sections' 12 | before 13 | call s:clear() 14 | call airline#init#sections() 15 | end 16 | 17 | after 18 | call s:clear() 19 | end 20 | 21 | it 'section a should have mode, paste, spell, iminsert' 22 | Expect g:airline_section_a =~ 'mode' 23 | Expect g:airline_section_a =~ 'paste' 24 | Expect g:airline_section_a =~ 'spell' 25 | Expect g:airline_section_a =~ 'iminsert' 26 | end 27 | 28 | it 'section b should be blank because no extensions are installed' 29 | Expect g:airline_section_b == '' 30 | end 31 | 32 | it 'section c should be file' 33 | Expect g:airline_section_c == '%<%f%m %#__accent_red#%{airline#util#wrap(airline#parts#readonly(),0)}%#__restore__#' 34 | end 35 | 36 | it 'section x should be filetype' 37 | Expect g:airline_section_x == '%{airline#util#wrap(airline#parts#filetype(),0)}' 38 | end 39 | 40 | it 'section y should be fenc and ff' 41 | Expect g:airline_section_y =~ 'ff' 42 | Expect g:airline_section_y =~ 'fenc' 43 | end 44 | 45 | it 'section z should be line numbers' 46 | Expect g:airline_section_z =~ '%3p%%' 47 | Expect g:airline_section_z =~ '%4l' 48 | Expect g:airline_section_z =~ '%3v' 49 | end 50 | 51 | it 'should not redefine sections already defined' 52 | for s in s:sections 53 | let g:airline_section_{s} = s 54 | endfor 55 | call airline#init#bootstrap() 56 | for s in s:sections 57 | Expect g:airline_section_{s} == s 58 | endfor 59 | end 60 | 61 | it 'all default statusline extensions should be blank' 62 | Expect airline#parts#get('hunks').raw == '' 63 | Expect airline#parts#get('branch').raw == '' 64 | Expect airline#parts#get('tagbar').raw == '' 65 | Expect airline#parts#get('syntastic').raw == '' 66 | Expect airline#parts#get('eclim').raw == '' 67 | Expect airline#parts#get('whitespace').raw == '' 68 | end 69 | end 70 | 71 | describe 'init parts' 72 | it 'should not redefine parts already defined' 73 | call airline#parts#define_raw('linenr', 'bar') 74 | call airline#init#sections() 75 | Expect g:airline_section_z =~ 'bar' 76 | end 77 | end 78 | 79 | -------------------------------------------------------------------------------- /.vim/autoload/gitgutter/fold.vim: -------------------------------------------------------------------------------- 1 | function! gitgutter#fold#enable() 2 | call s:save_fold_state() 3 | 4 | call s:set_fold_levels() 5 | setlocal foldexpr=gitgutter#fold#level(v:lnum) 6 | setlocal foldmethod=expr 7 | setlocal foldlevel=0 8 | setlocal foldenable 9 | 10 | call gitgutter#utility#setbufvar(bufnr(''), 'folded', 1) 11 | endfunction 12 | 13 | 14 | function! gitgutter#fold#disable() 15 | call s:restore_fold_state() 16 | call gitgutter#utility#setbufvar(bufnr(''), 'folded', 0) 17 | endfunction 18 | 19 | 20 | function! gitgutter#fold#toggle() 21 | if s:folded() 22 | call gitgutter#fold#disable() 23 | else 24 | call gitgutter#fold#enable() 25 | endif 26 | endfunction 27 | 28 | 29 | function! gitgutter#fold#level(lnum) 30 | return gitgutter#utility#getbufvar(bufnr(''), 'fold_levels')[a:lnum] 31 | endfunction 32 | 33 | 34 | " A line in a hunk has a fold level of 0. 35 | " A line within 3 lines of a hunk has a fold level of 1. 36 | " All other lines have a fold level of 2. 37 | function! s:set_fold_levels() 38 | let fold_levels = [''] 39 | 40 | for lnum in range(1, line('$')) 41 | let in_hunk = gitgutter#hunk#in_hunk(lnum) 42 | call add(fold_levels, (in_hunk ? 0 : 2)) 43 | endfor 44 | 45 | let lines_of_context = 3 46 | 47 | for lnum in range(1, line('$')) 48 | if fold_levels[lnum] == 2 49 | let pre = lnum >= 3 ? lnum - lines_of_context : 0 50 | let post = lnum + lines_of_context 51 | if index(fold_levels[pre:post], 0) != -1 52 | let fold_levels[lnum] = 1 53 | endif 54 | endif 55 | endfor 56 | 57 | call gitgutter#utility#setbufvar(bufnr(''), 'fold_levels', fold_levels) 58 | endfunction 59 | 60 | 61 | function! s:save_fold_state() 62 | let bufnr = bufnr('') 63 | call gitgutter#utility#setbufvar(bufnr, 'foldlevel', &foldlevel) 64 | call gitgutter#utility#setbufvar(bufnr, 'foldmethod', &foldmethod) 65 | if &foldmethod ==# 'manual' 66 | mkview 67 | endif 68 | endfunction 69 | 70 | function! s:restore_fold_state() 71 | let bufnr = bufnr('') 72 | let &foldlevel = gitgutter#utility#getbufvar(bufnr, 'foldlevel') 73 | let &foldmethod = gitgutter#utility#getbufvar(bufnr, 'foldmethod') 74 | if &foldmethod ==# 'manual' 75 | loadview 76 | else 77 | normal! zx 78 | endif 79 | endfunction 80 | 81 | function! s:folded() 82 | return gitgutter#utility#getbufvar(bufnr(''), 'folded') 83 | endfunction 84 | 85 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/powerlineish.vim: -------------------------------------------------------------------------------- 1 | " Theme to mimic the default colorscheme of powerline 2 | " Not 100% the same so it's powerline... ish. 3 | " 4 | " Differences from default powerline: 5 | " * Paste indicator isn't colored different 6 | " * Far right hand section matches the color of the mode indicator 7 | " 8 | " Differences from other airline themes: 9 | " * No color differences when you're in a modified buffer 10 | " * Visual mode only changes the mode section. Otherwise 11 | " it appears the same as normal mode 12 | 13 | " Normal mode " fg & bg 14 | let s:N1 = [ '#005f00' , '#afd700' , 22 , 148 ] " darkestgreen & brightgreen 15 | let s:N2 = [ '#9e9e9e' , '#303030' , 247 , 236 ] " gray8 & gray2 16 | let s:N3 = [ '#ffffff' , '#121212' , 231 , 233 ] " white & gray4 17 | 18 | " Insert mode " fg & bg 19 | let s:I1 = [ '#005f5f' , '#ffffff' , 23 , 231 ] " darkestcyan & white 20 | let s:I2 = [ '#5fafd7' , '#0087af' , 74 , 31 ] " darkcyan & darkblue 21 | let s:I3 = [ '#87d7ff' , '#005f87' , 117 , 24 ] " mediumcyan & darkestblue 22 | 23 | " Visual mode " fg & bg 24 | let s:V1 = [ '#080808' , '#ffaf00' , 232 , 214 ] " gray3 & brightestorange 25 | 26 | " Replace mode " fg & bg 27 | let s:RE = [ '#ffffff' , '#d70000' , 231 , 160 ] " white & brightred 28 | 29 | let g:airline#themes#powerlineish#palette = {} 30 | 31 | let g:airline#themes#powerlineish#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 32 | 33 | let g:airline#themes#powerlineish#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 34 | let g:airline#themes#powerlineish#palette.insert_replace = { 35 | \ 'airline_a': [ s:RE[0] , s:I1[1] , s:RE[1] , s:I1[3] , '' ] } 36 | 37 | let g:airline#themes#powerlineish#palette.visual = { 38 | \ 'airline_a': [ s:V1[0] , s:V1[1] , s:V1[2] , s:V1[3] , '' ] } 39 | 40 | let g:airline#themes#powerlineish#palette.replace = copy(airline#themes#powerlineish#palette.normal) 41 | let g:airline#themes#powerlineish#palette.replace.airline_a = [ s:RE[0] , s:RE[1] , s:RE[2] , s:RE[3] , '' ] 42 | 43 | 44 | let s:IA = [ s:N2[0] , s:N3[1] , s:N2[2] , s:N3[3] , '' ] 45 | let g:airline#themes#powerlineish#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) 46 | 47 | -------------------------------------------------------------------------------- /.Xresources: -------------------------------------------------------------------------------- 1 | Xft.hinting: true 2 | Xft.hintstyle: hintfull 3 | Xft.antialias: rgba 4 | Xft.rgba: none 5 | Xft.dpi: 96 6 | 7 | Xcursor.theme: DMZ-Black 8 | Xcursor.size: 16 9 | 10 | #define r_bg #000000 11 | #define r_fg #aaaaaa 12 | #define r_hlfg #ffffff 13 | 14 | ! States: bg, fg, bgalt, hlbg, hlfg 15 | rofi.color-enabled: true 16 | rofi.color-normal: r_bg,r_fg,r_bg,r_bg,r_hlfg 17 | rofi.color-urgent: r_bg,#ffffff,r_bg,r_bg,r_hlfg 18 | rofi.color-active: r_bg,r_fg,#ffffff,r_bg,#ffffff 19 | ! states: background, border 20 | rofi.color-window: r_bg,#ffffff 21 | 22 | rofi.separator-style: solid 23 | rofi.sidebar-mode: false 24 | rofi.bw: 1 25 | rofi.columns: 1 26 | rofi.padding: 5 27 | 28 | rofi.yoffset: -300 29 | rofi.opacity: 80 30 | rofi.fake-transparency: true 31 | rofi.location: 0 32 | rofi.width: 30 33 | rofi.font: Inconsolata 12 34 | rofi.lines: 10 35 | 36 | #define cyan_theme 37 | 38 | #ifdef green_theme 39 | #include "/home/raidzero/.Xresources-green" 40 | #else 41 | #include "/home/raidzero/.Xresources-cyan" 42 | #endif 43 | 44 | ! define different font params for various machines 45 | #ifdef SRVR_chromebook 46 | #define urxvt_font_size 15 47 | #define urxvt_letter_spacing -1 48 | #elif defined SRVR_xps 49 | #define urxvt_font_size 14 50 | #define urxvt_letter_spacing 1 51 | #elif defined SRVR_baseline 52 | #define urxvt_font_size 14 53 | #define urxvt_letter_spacing -1 54 | #else 55 | #define urxvt_font_size 13 56 | #define urxvt_letter_spacing -1 57 | #endif 58 | 59 | ! make it easy to change font in one place 60 | !#define urxvt_font xft:Hack:pixelsize=urxvt_font_size 61 | !#define urxvt_bold_font urxvt_font:style=Bold 62 | 63 | URxvt*font: -xos4-terminus-medium-*-*-*-16-*-72-72-c-80-*-* 64 | URxvt*boldFont: -xos4-terminus-bold-*-*-*-16-*-72-72-c-80-*-* 65 | URxvt*italicFont: -xos4-terminus-medium-*-*-*-16-*-72-72-c-80-*-* 66 | URxvt*boldItalicFont: -xos4-terminus-bold-*-*-*-16-*-72-72-c-80-*-* 67 | 68 | URxvt*internalBorder: 10 69 | !URxvt*font: urxvt_font 70 | !URxvt*boldFont: urxvt_bold_font 71 | 72 | URxvt*allow_bold: true 73 | URxvt*letterSpace: urxvt_letter_spacing 74 | 75 | URxvt*buffered: true 76 | 77 | #ifdef SRVR_xps 78 | ! URxvt.transparent: true 79 | ! URxvt*shading: 10 80 | URxvt*depth:32 81 | URxvt*background:rgba:0000/0000/0000/ddcc 82 | #elif defined SRVR_baseline 83 | URxvt.transparent: true 84 | URxvt*shading: 10 85 | #endif 86 | URxvt*scrollBar: false 87 | 88 | twobwm.enable_compton: false 89 | -------------------------------------------------------------------------------- /.vim/autoload/airline/extensions/nrrwrgn.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | if !get(g:, 'loaded_nrrw_rgn', 0) 7 | finish 8 | endif 9 | 10 | function! airline#extensions#nrrwrgn#apply(...) 11 | if exists(":WidenRegion") == 2 12 | let spc = g:airline_symbols.space 13 | if !exists("*nrrwrgn#NrrwRgnStatus()") || empty(nrrwrgn#NrrwRgnStatus()) 14 | call a:1.add_section('airline_a', printf('%s[Narrowed%s#%d]', spc, spc, b:nrrw_instn)) 15 | let bufname=(get(b:, 'orig_buf', 0) ? bufname(b:orig_buf) : substitute(bufname('%'), '^Nrrwrgn_\zs.*\ze_\d\+$', submatch(0), '')) 16 | call a:1.add_section('airline_c', spc.bufname.spc) 17 | call a:1.split() 18 | else 19 | let dict=nrrwrgn#NrrwRgnStatus() 20 | let vmode = { 'v': 'Char ', 'V': 'Line ', '': 'Block '} 21 | let mode = dict.visual ? vmode[dict.visual] : vmode['V'] 22 | let winwidth = winwidth(0) 23 | if winwidth < 80 24 | let mode = mode[0] 25 | endif 26 | let title = (winwidth < 80 ? "Nrrw" : "Narrowed ") 27 | let multi = (winwidth < 80 ? 'M' : 'Multi') 28 | call a:1.add_section('airline_a', printf('[%s%s%s#%d]%s', (dict.multi ? multi : ""), 29 | \ title, mode, b:nrrw_instn, spc)) 30 | let name = dict.fullname 31 | if name !=# '[No Name]' 32 | if winwidth > 100 33 | " need some space 34 | let name = fnamemodify(dict.fullname, ':~') 35 | if strlen(name) > 8 36 | " shorten name 37 | let name = substitute(name, '\(.\)[^/\\]*\([/\\]\)', '\1\2', 'g') 38 | endif 39 | else 40 | let name = fnamemodify(dict.fullname, ':t') 41 | endif 42 | endif 43 | let range=(dict.multi ? '' : printf("[%d-%d]", dict.start[1], dict.end[1])) 44 | call a:1.add_section('airline_c', printf("%s %s %s", name, range, 45 | \ dict.enabled ? (&encoding ==? 'utf-8' ? "\u2713" : '') : '!')) 46 | call a:1.split() 47 | call a:1.add_section('airline_x', get(g:, 'airline_section_x').spc) 48 | call a:1.add_section('airline_y', spc.get(g:, 'airline_section_y').spc) 49 | call a:1.add_section('airline_z', spc.get(g:, 'airline_section_z')) 50 | endif 51 | return 1 52 | endif 53 | endfunction 54 | 55 | function! airline#extensions#nrrwrgn#init(ext) 56 | call a:ext.add_statusline_func('airline#extensions#nrrwrgn#apply') 57 | endfunction 58 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/wal.vim: -------------------------------------------------------------------------------- 1 | " wal Airline 2 | let g:airline#themes#wal#palette = {} 3 | 4 | " Normal mode 5 | let s:N = [ '', '', 66, 4, 'BOLD' ] 6 | let s:N2 = [ '', '', 4, 66, 'BOLD' ] 7 | 8 | " Insert mode 9 | let s:I = [ '', '', 66, 2, 'BOLD' ] 10 | let s:I2 = [ '', '', 2, 66, 'BOLD' ] 11 | 12 | " Visual mode 13 | let s:V = [ '', '', 66, 1, 'BOLD' ] 14 | let s:V2 = [ '', '', 1, 66, 'BOLD' ] 15 | 16 | " Replace mode 17 | let s:R = [ '', '', 66, 5, 'BOLD' ] 18 | let s:R2 = [ '', '', 5, 66, 'BOLD' ] 19 | 20 | let g:airline#themes#wal#palette.normal = airline#themes#generate_color_map(s:N, s:N2, s:N2) 21 | let g:airline#themes#wal#palette.insert = airline#themes#generate_color_map(s:I, s:I2, s:I2) 22 | let g:airline#themes#wal#palette.visual = airline#themes#generate_color_map(s:V, s:V2, s:V2) 23 | let g:airline#themes#wal#palette.replace = airline#themes#generate_color_map(s:R, s:R2, s:R2) 24 | 25 | let g:airline#themes#wal#palette.accents = { 'red': [ '', '', 0, 2, 'BOLD' ] } 26 | 27 | " Inactive mode 28 | let s:IN1 = [ '', '', 0, 8 ] 29 | let s:IN2 = [ '', '', 0, 0 ] 30 | 31 | let s:IA = [ s:IN1[1], s:IN2[1], s:IN1[3], s:IN2[3], '' ] 32 | let g:airline#themes#wal#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) 33 | 34 | " Warnings 35 | let s:WI = [ '', '', 66, 1, 'BOLD' ] 36 | let g:airline#themes#wal#palette.normal.airline_warning = s:WI 37 | let g:airline#themes#wal#palette.insert.airline_warning = s:WI 38 | let g:airline#themes#wal#palette.visual.airline_warning = s:WI 39 | let g:airline#themes#wal#palette.replace.airline_warning = s:WI 40 | 41 | let g:airline#themes#wal#palette.normal.airline_error = s:WI 42 | let g:airline#themes#wal#palette.insert.airline_error = s:WI 43 | let g:airline#themes#wal#palette.visual.airline_error = s:WI 44 | let g:airline#themes#wal#palette.replace.airline_error = s:WI 45 | 46 | " Tabline 47 | let g:airline#themes#wal#palette.tabline = { 48 | \ 'airline_tab': [ '', '', 4, 0, 'BOLD' ], 49 | \ 'airline_tabsel': [ '', '', 66, 4, 'BOLD' ], 50 | \ 'airline_tabtype': [ '', '', 66, 4, 'BOLD' ], 51 | \ 'airline_tabfill': [ '', '', 4, 0, 'BOLD' ], 52 | \ 'airline_tabmod': [ '', '', 66, 4, 'BOLD' ] 53 | \ } 54 | 55 | if !get(g:, 'loaded_ctrlp', 0) 56 | finish 57 | endif 58 | 59 | let g:airline#themes#wal#palette.ctrlp = airline#extensions#ctrlp#generate_color_map( 60 | \ [ '', '', 0, 0, 'BOLD' ], 61 | \ [ '', '', 0, 0, 'BOLD' ], 62 | \ [ '', '', 0, 0, 'BOLD' ] ) 63 | -------------------------------------------------------------------------------- /.config/compton/compton.conf: -------------------------------------------------------------------------------- 1 | # Compton Configuration, courtesy of Xubuntu Developers 2 | # Please note that Compton is not supported by Xubuntu and may not work 3 | # correctly for you. This file is provided as a set of sane defaults and is in 4 | # no way endorsed by the Xubuntu team. 5 | # 6 | # About Compton: https://github.com/chjj/compton 7 | # Heavily based on: http://bit.ly/1l5OrzL 8 | # Sample settings: https://github.com/chjj/compton/blob/master/compton.sample.conf 9 | 10 | # --- Backend (OpenGL used by default) 11 | # Related Links 12 | # https://github.com/chjj/compton/wiki/perf-guide 13 | # https://github.com/chjj/compton/wiki/vsync-guide 14 | 15 | # compton -b --backend xr_glx_hybrid --vsync-use-glfinish --vsync drm --unredir-if-possible --paint-on-overlay 16 | backend = "glx" 17 | paint-on-overlay = true; 18 | glx-no-stencil = true; 19 | glx-swap-buffer = 1; 20 | unredir-if-possible = true; 21 | vsync = "opengl"; 22 | # --- Shadows (Disable with shadow = false;) 23 | # The shadow exclude options are helpful if you have shadows enabled. 24 | # Due to the way compton draws its shadows, certain applications (Such as 25 | # shaped windows, custom popups, non-standard toolkits) will have visual glitches. 26 | 27 | shadow = false; # Enabled client-side shadows on windows. 28 | 29 | # Opacity 30 | menu-opacity = 0.90; # The opacity for menus. (default 1.0) 31 | inactive-opacity = 1.0; # Opacity of inactive windows. (0.1 - 1.0) 32 | frame-opacity = 1.0; # Opacity of window titlebars and borders. (0.1 - 1.0) 33 | inactive-opacity-override = true; # Inactive opacity set by 'inactive-opacity' overrides value of _NET_WM_OPACITY. 34 | 35 | opacity-rule = [ 36 | "90:class_g = 'Gvim'", # gvim 90% opaque 37 | "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'" # make hidden windows transparent 38 | ]; 39 | 40 | 41 | # --- Fading (Disable with fading = false;) 42 | 43 | fading = false; # Fade windows during opacity changes. 44 | fade-delta = 3; # The time between steps in a fade in milliseconds. (default 5). 45 | fade-in-step = 0.03; # Opacity change between steps while fading in. (default 0.03). 46 | fade-out-step = 0.03; # Opacity change between steps while fading out. (default 0.03). 47 | 48 | 49 | # --- Additional Settings 50 | detect-client-opacity = true; 51 | 52 | 53 | # --- Window type settings 54 | wintypes: 55 | { 56 | tooltip = { fade = true; shadow = false; opacity = 0.9; focus = true; }; 57 | dialog = { fade = true; shadow = true; opacity = 1.0; focus = true; }; 58 | }; 59 | -------------------------------------------------------------------------------- /bin/move_window_i3.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import sys 3 | import i3ipc 4 | 5 | TYPE = sys.argv[1] 6 | CMD = sys.argv[2] 7 | BAR_TOP = 0 8 | 9 | i3 = i3ipc.Connection() 10 | 11 | MONITOR_DIMENS = [(ws.rect.width, ws.rect.height) for ws in i3.get_workspaces() if ws.focused][0] 12 | WINDOW_DIMENS = [(leaf.rect.width, leaf.rect.height) for leaf in i3.get_tree() if leaf.focused][0] 13 | 14 | MON_WIDTH = MONITOR_DIMENS[0] 15 | MON_HEIGHT = MONITOR_DIMENS[1] 16 | 17 | WIN_WIDTH = WINDOW_DIMENS[0] 18 | WIN_HEIGHT = WINDOW_DIMENS[1] 19 | 20 | def move(x, y): 21 | i3.command("move position %d %d" % (x, y)) 22 | 23 | def resize(w, h): 24 | i3.command("resize set %d %d" % (w, h)) 25 | 26 | def divvy(x, y, w, h): 27 | resize(w, h) 28 | move(x, y) 29 | 30 | 31 | if TYPE == 'teleport': 32 | if CMD == 'top-left': 33 | move(0, BAR_TOP) 34 | elif CMD == 'bottom-left': 35 | move(0, (MON_HEIGHT - WIN_HEIGHT)) 36 | elif CMD == 'top-right': 37 | move((MON_WIDTH - WIN_WIDTH), BAR_TOP) 38 | elif CMD == 'bottom-right': 39 | move((MON_WIDTH - WIN_WIDTH), (MON_HEIGHT - WIN_HEIGHT)) 40 | elif CMD == 'center': 41 | move((MON_WIDTH / 2) - WIN_WIDTH / 2, (MON_HEIGHT / 2) - WIN_HEIGHT / 2) 42 | 43 | if TYPE == 'divvy': 44 | if CMD == 'half-left': 45 | divvy(0, 0, MON_WIDTH / 2, MON_HEIGHT) 46 | elif CMD == 'half-right': 47 | divvy(MON_WIDTH / 2, 0, MON_WIDTH / 2, MON_HEIGHT) 48 | elif CMD == 'third-left': 49 | divvy(0, 0, MON_WIDTH / 3, MON_HEIGHT) 50 | elif CMD == 'third-middle': 51 | divvy(MON_WIDTH / 3, 0, MON_WIDTH / 3, MON_HEIGHT) 52 | elif CMD == 'third-right': 53 | divvy(MON_WIDTH - MON_WIDTH / 3, 0, MON_WIDTH / 3, MON_HEIGHT) 54 | elif CMD == 'two-thirds-left': 55 | divvy(0, 0, (MON_WIDTH / 3) * 2, MON_HEIGHT) 56 | elif CMD == 'two-thirds-right': 57 | divvy(MON_WIDTH / 3, 0, (MON_WIDTH / 3) * 2, MON_HEIGHT) 58 | elif CMD == 'quarter-top-left': 59 | divvy(0, 0, MON_WIDTH / 2, MON_HEIGHT / 2) 60 | elif CMD == 'quarter-top-right': 61 | divvy(MON_WIDTH / 2, 0, MON_WIDTH / 2, MON_HEIGHT / 2) 62 | elif CMD == 'quarter-bottom-left': 63 | divvy(0, MON_HEIGHT / 2, MON_WIDTH / 2, MON_HEIGHT / 2) 64 | elif CMD == 'quarter-bottom-right': 65 | divvy(MON_WIDTH / 2, MON_HEIGHT / 2, MON_WIDTH / 2, MON_HEIGHT / 2) 66 | elif CMD == 'half-top': 67 | divvy(0, 0, MON_WIDTH, MON_HEIGHT / 2) 68 | elif CMD == 'half-bottom': 69 | divvy(0, MON_HEIGHT / 2, MON_WIDTH, MON_HEIGHT / 2) 70 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/kolor.vim: -------------------------------------------------------------------------------- 1 | let g:airline#themes#kolor#palette = {} 2 | 3 | let s:N1 = [ '#e2e2e2' , '#4f3598' , 254 , 56 ] 4 | let s:N2 = [ '#ff5fd7' , '#242322' , 206 , 234 ] 5 | let s:N3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ] 6 | 7 | let g:airline#themes#kolor#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 8 | 9 | let g:airline#themes#kolor#palette.normal_modified = { 10 | \ 'airline_c': [ '#e2e2e2' , '#4f3598' , 254 , 56 , '' ] , 11 | \ } 12 | 13 | 14 | let s:I1 = [ '#242322' , '#7eaefd' , 234 , 111 ] 15 | let s:I2 = [ '#75d7d8' , '#242322' , 80 , 234 ] 16 | let s:I3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ] 17 | let g:airline#themes#kolor#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 18 | let g:airline#themes#kolor#palette.insert_modified = { 19 | \ 'airline_c': [ '#242322' , '#7eaefd' , 234 , 111 , '' ] , 20 | \ } 21 | 22 | 23 | let g:airline#themes#kolor#palette.replace = copy(g:airline#themes#kolor#palette.insert) 24 | let g:airline#themes#kolor#palette.replace.airline_a = [ s:I2[0] , '#005154' , s:I2[2] , 23 , '' ] 25 | let g:airline#themes#kolor#palette.replace_modified = { 26 | \ 'airline_c': [ '#e2e2e2' , '#005154' , 254 , 23 , '' ] , 27 | \ } 28 | 29 | 30 | let s:V1 = [ '#242322' , '#e6987a' , 234 , 180 ] 31 | let s:V2 = [ '#dbc570' , '#242322' , 186 , 234 ] 32 | let s:V3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ] 33 | let g:airline#themes#kolor#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) 34 | let g:airline#themes#kolor#palette.visual_modified = { 35 | \ 'airline_c': [ '#242322' , '#e6987a' , 234 , 180 , '' ] , 36 | \ } 37 | 38 | 39 | let s:IA1 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 , '' ] 40 | let s:IA2 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 ] 41 | let s:IA3 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 , '' ] 42 | let g:airline#themes#kolor#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3) 43 | let g:airline#themes#kolor#palette.inactive_modified = { 44 | \ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] , 45 | \ } 46 | 47 | 48 | let g:airline#themes#kolor#palette.accents = { 49 | \ 'red': [ '#d96e8a' , '' , 168 , '' ] 50 | \ } 51 | 52 | 53 | if !get(g:, 'loaded_ctrlp', 0) 54 | finish 55 | endif 56 | let g:airline#themes#kolor#palette.ctrlp = airline#extensions#ctrlp#generate_color_map( 57 | \ [ '#e2e2e2' , '#4a4a4a' , 254 , 238 , '' ], 58 | \ [ '#e2e2e2' , '#242322' , 254 , 234 , '' ], 59 | \ [ '#e2e2e2' , '#4f3598' , 254 , 56 , 'bold' ]) 60 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/molokai.vim: -------------------------------------------------------------------------------- 1 | let g:airline#themes#molokai#palette = {} 2 | 3 | let g:airline#themes#molokai#palette.accents = { 4 | \ 'red': [ '#66d9ef' , '' , 81 , '' , '' ], 5 | \ } 6 | 7 | 8 | " Normal mode 9 | let s:N1 = [ '#080808' , '#e6db74' , 232 , 144 ] " mode 10 | let s:N2 = [ '#f8f8f0' , '#232526' , 253 , 16 ] " info 11 | let s:N3 = [ '#f8f8f0' , '#465457' , 253 , 67 ] " statusline 12 | 13 | let g:airline#themes#molokai#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 14 | let g:airline#themes#molokai#palette.normal_modified = { 15 | \ 'airline_c': [ '#080808' , '#e6db74' , 232 , 144 , '' ] , 16 | \ } 17 | 18 | 19 | " Insert mode 20 | let s:I1 = [ '#080808' , '#66d9ef' , 232 , 81 ] 21 | let s:I2 = [ '#f8f8f0' , '#232526' , 253 , 16 ] 22 | let s:I3 = [ '#f8f8f0' , '#465457' , 253 , 67 ] 23 | 24 | let g:airline#themes#molokai#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 25 | let g:airline#themes#molokai#palette.insert_modified = { 26 | \ 'airline_c': [ '#080808' , '#66d9ef' , 232 , 81 , '' ] , 27 | \ } 28 | 29 | 30 | " Replace mode 31 | let g:airline#themes#molokai#palette.replace = copy(g:airline#themes#molokai#palette.insert) 32 | let g:airline#themes#molokai#palette.replace.airline_a = [ s:I1[0] , '#ef5939' , s:I1[2] , 166 , '' ] 33 | let g:airline#themes#molokai#palette.replace_modified = { 34 | \ 'airline_c': [ '#080808' , '#ef5939' , 232 , 166 , '' ] , 35 | \ } 36 | 37 | 38 | " Visual mode 39 | let s:V1 = [ '#080808' , '#fd971f' , 232 , 208 ] 40 | let s:V2 = [ '#f8f8f0' , '#232526' , 253 , 16 ] 41 | let s:V3 = [ '#f8f8f0' , '#465457' , 253 , 67 ] 42 | 43 | let g:airline#themes#molokai#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) 44 | let g:airline#themes#molokai#palette.visual_modified = { 45 | \ 'airline_c': [ '#080808' , '#fd971f' , 232 , 208 , '' ] , 46 | \ } 47 | 48 | 49 | " Inactive 50 | let s:IA = [ '#1b1d1e' , '#465457' , 233 , 67 , '' ] 51 | let g:airline#themes#molokai#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) 52 | let g:airline#themes#molokai#palette.inactive_modified = { 53 | \ 'airline_c': [ '#f8f8f0' , '' , 253 , '' , '' ] , 54 | \ } 55 | 56 | 57 | " CtrlP 58 | if !get(g:, 'loaded_ctrlp', 0) 59 | finish 60 | endif 61 | let g:airline#themes#molokai#palette.ctrlp = airline#extensions#ctrlp#generate_color_map( 62 | \ [ '#f8f8f0' , '#465457' , 253 , 67 , '' ] , 63 | \ [ '#f8f8f0' , '#232526' , 253 , 16 , '' ] , 64 | \ [ '#080808' , '#e6db74' , 232 , 144 , 'bold' ] ) 65 | 66 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/distinguished.vim: -------------------------------------------------------------------------------- 1 | " vim-airline companion theme of distinguished 2 | " (https://github.com/Lokaltog/vim-distinguished) 3 | " I have nothing to do with the original 4 | " distinguished theme other than being a big fan. 5 | " this theme was shamelessly created by modifying 6 | " the Ubaryd airline theme. 7 | 8 | let s:gray = [245, '#8a8a8a'] 9 | let s:golden = [143, '#afaf5f'] 10 | let s:pink = [131, '#af5f5f'] 11 | let s:blue = [ 67, '#5f87af'] 12 | let s:orange = [166, '#d75f00'] 13 | let s:outerfg = [ 16, '#000000'] 14 | let s:innerbg = [234, '#1c1c1c'] 15 | let s:middle = ['#bcbcbc', '#444444', 250, 238] 16 | 17 | " Normal mode 18 | let s:N1 = [s:outerfg[1], s:gray[1], s:outerfg[0], s:gray[0]] 19 | let s:N3 = [s:gray[1], s:innerbg[1], s:gray[0], s:innerbg[0]] 20 | 21 | " Insert mode 22 | let s:I1 = [s:outerfg[1], s:golden[1], s:outerfg[0], s:golden[0]] 23 | let s:I3 = [s:golden[1], s:innerbg[1], s:golden[0], s:innerbg[0]] 24 | 25 | " Visual mode 26 | let s:V1 = [s:outerfg[1], s:pink[1], s:outerfg[0], s:pink[0]] 27 | let s:V3 = [s:pink[1], s:innerbg[1], s:pink[0], s:innerbg[0]] 28 | 29 | " Replace mode 30 | let s:R1 = [s:outerfg[1], s:blue[1], s:outerfg[0], s:blue[0]] 31 | let s:R3 = [s:blue[1], s:innerbg[1], s:blue[0], s:innerbg[0]] 32 | 33 | " Inactive pane 34 | let s:IA = [s:middle[1], s:innerbg[1], s:middle[3], s:innerbg[0]] 35 | 36 | let g:airline#themes#distinguished#palette = {} 37 | let g:airline#themes#distinguished#palette.accents = { 38 | \ 'red': ['#d70000', '', 160, '', '']} 39 | 40 | let g:airline#themes#distinguished#palette.inactive = { 41 | \ 'airline_a': s:IA, 42 | \ 'airline_b': s:IA, 43 | \ 'airline_c': s:IA} 44 | 45 | let g:airline#themes#distinguished#palette.normal = airline#themes#generate_color_map(s:N1, s:middle, s:N3) 46 | let g:airline#themes#distinguished#palette.normal_modified = { 47 | \ 'airline_a': ['', s:orange[1], '', s:orange[0], ''], 48 | \ 'airline_c': [s:orange[1], '', s:orange[0], '', ''], 49 | \ 'airline_x': [s:orange[1], '', s:orange[0], '', ''], 50 | \ 'airline_z': ['', s:orange[1], '', s:orange[0], '']} 51 | 52 | let g:airline#themes#distinguished#palette.insert = airline#themes#generate_color_map(s:I1, s:middle, s:I3) 53 | let g:airline#themes#distinguished#palette.insert_modified = {} 54 | 55 | let g:airline#themes#distinguished#palette.replace = airline#themes#generate_color_map(s:R1, s:middle, s:R3) 56 | let g:airline#themes#distinguished#palette.replace_modified = {} 57 | 58 | let g:airline#themes#distinguished#palette.visual = airline#themes#generate_color_map(s:V1, s:middle, s:V3) 59 | let g:airline#themes#distinguished#palette.visual_modified = {} 60 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/papercolor.vim: -------------------------------------------------------------------------------- 1 | let g:airline#themes#papercolor#palette = {} 2 | 3 | let g:airline#themes#papercolor#palette.accents = { 4 | \ 'red': [ '#66d9ef' , '' , 81 , '' , '' ], 5 | \ } 6 | 7 | " Normal Mode: 8 | let s:N1 = [ '#585858' , '#e4e4e4' , 240 , 254 ] " Mode 9 | let s:N2 = [ '#e4e4e4' , '#0087af' , 254 , 31 ] " Info 10 | let s:N3 = [ '#eeeeee' , '#005f87' , 255 , 24 ] " StatusLine 11 | 12 | 13 | let g:airline#themes#papercolor#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 14 | let g:airline#themes#papercolor#palette.normal_modified = { 15 | \ 'airline_c': [ '#eeeeee' , '#005f87' , 255 , 24 , '' ] , 16 | \ } 17 | 18 | 19 | " Insert Mode: 20 | let s:I1 = [ '#585858' , '#e4e4e4' , 240 , 254 ] " Mode 21 | let s:I2 = [ '#e4e4e4' , '#0087af' , 254 , 31 ] " Info 22 | let s:I3 = [ '#eeeeee' , '#005f87' , 255 , 24 ] " StatusLine 23 | 24 | 25 | let g:airline#themes#papercolor#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 26 | let g:airline#themes#papercolor#palette.insert_modified = { 27 | \ 'airline_c': [ '#eeeeee' , '#005f87' , 255 , 24 , '' ] , 28 | \ } 29 | 30 | 31 | " Replace Mode: 32 | let g:airline#themes#papercolor#palette.replace = copy(g:airline#themes#papercolor#palette.insert) 33 | let g:airline#themes#papercolor#palette.replace.airline_a = [ '#d7005f' , '#e4e4e4' , 161 , 254, '' ] 34 | let g:airline#themes#papercolor#palette.replace_modified = { 35 | \ 'airline_c': [ '#eeeeee' , '#005f87' , 255 , 24 , '' ] , 36 | \ } 37 | 38 | 39 | " Visual Mode: 40 | let s:V1 = [ '#005f87', '#e4e4e4', 24, 254 ] 41 | let s:V2 = [ '', '#0087af', '', 31 ] 42 | let s:V3 = [ '#e4e4e4', '#005f87', 254, 24 ] 43 | 44 | let g:airline#themes#papercolor#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) 45 | let g:airline#themes#papercolor#palette.visual_modified = { 46 | \ 'airline_c': [ '#e4e4e4', '#005f87', 254, 24 ] , 47 | \ } 48 | 49 | " Inactive: 50 | let s:IA = [ '#585858' , '#e4e4e4' , 240 , 254 , '' ] 51 | let g:airline#themes#papercolor#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) 52 | let g:airline#themes#papercolor#palette.inactive_modified = { 53 | \ 'airline_c': [ '#585858' , '#e4e4e4' , 240 , 254 , '' ] , 54 | \ } 55 | 56 | 57 | " CtrlP: 58 | if !get(g:, 'loaded_ctrlp', 0) 59 | finish 60 | endif 61 | let g:airline#themes#papercolor#palette.ctrlp = airline#extensions#ctrlp#generate_color_map( 62 | \ [ '#e4e4e4' , '#005f87' , 254 , 24 , '' ] , 63 | \ [ '#e4e4e4' , '#0087af' , 254 , 31 , '' ] , 64 | \ [ '#585858' , '#e4e4e4' , 240 , 254 , 'bold' ] ) 65 | 66 | -------------------------------------------------------------------------------- /.vim/autoload/airline/section.vim: -------------------------------------------------------------------------------- 1 | " MIT License. Copyright (c) 2013-2016 Bailey Ling. 2 | " vim: et ts=2 sts=2 sw=2 3 | 4 | scriptencoding utf-8 5 | 6 | call airline#init#bootstrap() 7 | let s:spc = g:airline_symbols.space 8 | 9 | function! s:wrap_accent(part, value) 10 | if exists('a:part.accent') 11 | call airline#highlighter#add_accent(a:part.accent) 12 | return '%#__accent_'.(a:part.accent).'#'.a:value.'%#__restore__#' 13 | endif 14 | return a:value 15 | endfunction 16 | 17 | function! s:create(parts, append) 18 | let _ = '' 19 | for idx in range(len(a:parts)) 20 | let part = airline#parts#get(a:parts[idx]) 21 | let val = '' 22 | let add_sep = get(l:, 'add_sep', 0) 23 | 24 | if exists('part.function') 25 | let func = (part.function).'()' 26 | elseif exists('part.text') 27 | let func = '"'.(part.text).'"' 28 | else 29 | if a:append > 0 && idx != 0 30 | let val .= s:spc.g:airline_left_alt_sep.s:spc 31 | endif 32 | if a:append < 0 && idx != 0 33 | let t = '' 34 | if !add_sep 35 | let t = s:spc.g:airline_right_alt_sep.s:spc 36 | endif 37 | let val = t.val 38 | endif 39 | if exists('part.raw') 40 | let _ .= s:wrap_accent(part, val.(part.raw)) 41 | continue 42 | else 43 | let _ .= s:wrap_accent(part, val.a:parts[idx]) 44 | continue 45 | endif 46 | endif 47 | 48 | let minwidth = get(part, 'minwidth', 0) 49 | 50 | if a:append > 0 && idx != 0 51 | let partval = printf('%%{airline#util#append(%s,%s)}', func, minwidth) 52 | " will add an extra separator, if minwidth is zero 53 | let add_sep = (minwidth == 0) 54 | elseif a:append < 0 && idx != len(a:parts) - 1 55 | let partval = printf('%%{airline#util#prepend(%s,%s)}', func, minwidth) 56 | " will add an extra separator, if minwidth is zero 57 | let add_sep = (minwidth == 0) 58 | else 59 | let partval = printf('%%{airline#util#wrap(%s,%s)}', func, minwidth) 60 | let add_sep = 0 61 | endif 62 | 63 | if exists('part.condition') 64 | let partval = substitute(partval, '{', '\="{".(part.condition)." ? "', '') 65 | let partval = substitute(partval, '}', ' : ""}', '') 66 | endif 67 | 68 | let val .= s:wrap_accent(part, partval) 69 | let _ .= val 70 | endfor 71 | return _ 72 | endfunction 73 | 74 | function! airline#section#create(parts) 75 | return s:create(a:parts, 0) 76 | endfunction 77 | 78 | function! airline#section#create_left(parts) 79 | return s:create(a:parts, 1) 80 | endfunction 81 | 82 | function! airline#section#create_right(parts) 83 | return s:create(a:parts, -1) 84 | endfunction 85 | 86 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/understated.vim: -------------------------------------------------------------------------------- 1 | let g:airline#themes#understated#palette = {} 2 | 3 | let s:N1 = ['#FFFFFF', '#5F87FF', 15, 69] " Outside blocks in normal mode (mode and file position) 4 | let s:N2 = ['#AFAF87', '#5F5F5F', 144, 59] " Next blocks inside (branch and file format) 5 | let s:N3 = ['#AFAF87', '#5F5F5F', 144, 59] " The middle block 6 | 7 | let g:airline#themes#understated#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 8 | let g:airline#themes#understated#palette.normal_modified = {'airline_c': ['#ffffff', '#5f005f', 144, 59, 'bold'] ,} 9 | 10 | let s:I1 = ['#FFFFFF', '#87AF5F', 15, 107] " Outside blocks in normal mode (mode and file position) 11 | let s:I2 = ['#AFAF87', '#5F5F5F', 144, 59] " Next blocks inside (branch and file format) 12 | let s:I3 = ['#AFAF87', '#5F5F5F', 144, 59] " The middle block 13 | let g:airline#themes#understated#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 14 | let g:airline#themes#understated#palette.insert_modified = {'airline_c': ['#AFAF87', '#5F5F5F', 144, 59, 'bold'] ,} 15 | let g:airline#themes#understated#palette.insert_paste = {'airline_c': ['#AFAF87', '#5F5F5F', 144, 59, ''] ,} 16 | 17 | let g:airline#themes#understated#palette.replace = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 18 | let g:airline#themes#understated#palette.replace.airline_a = ['#FFFFFF', '#870000', 15, 88, ''] 19 | let g:airline#themes#understated#palette.replace_modified = {'airline_c': ['#AFAF87', '#5F5F5F', 144, 59, 'bold'] ,} 20 | 21 | let s:V1 = ['#FFFFFF', '#AF5F00', 15, 130] 22 | let s:V2 = ['#AFAF87', '#5F5F5F', 144, 59] 23 | let s:V3 = ['#AFAF87', '#5F5F5F', 144, 59] 24 | let g:airline#themes#understated#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) 25 | let g:airline#themes#understated#palette.visual_modified = {'airline_c': [ '#AFAF87', '#5f005f', 144, 59, 'bold'] ,} 26 | 27 | let s:V1 = ['#080808', '#FFAF00', 232, 214] 28 | let s:IA1 = ['#4E4E4E', '#1C1C1C', 239, 234, ''] 29 | let s:IA2 = ['#4E4E4E', '#1C1C1C', 239, 234, ''] 30 | let s:IA3 = ['#4E4E4E', '#1C1C1C', 239, 234, ''] 31 | let g:airline#themes#understated#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3) 32 | let g:airline#themes#understated#palette.inactive_modified = {'airline_c': ['#4E4E4E', '', 239, '', 'bold'] ,} 33 | 34 | let g:airline#themes#understated#palette.accents = {'red': ['#FF0000', '', 88, '']} 35 | 36 | if !get(g:, 'loaded_ctrlp', 0) 37 | finish 38 | endif 39 | let g:airline#themes#understated#palette.ctrlp = airline#extensions#ctrlp#generate_color_map( 40 | \ ['#FFFFFF', '#1C1C1C', 15, 234, '' ], 41 | \ ['#FFFFFF', '#262626', 15, 235, '' ], 42 | \ ['#FFFFFF', '#303030', 15, 236, 'bold']) 43 | 44 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/durant.vim: -------------------------------------------------------------------------------- 1 | let g:airline#themes#durant#palette = {} 2 | 3 | 4 | let s:N1 = [ '#005f00' , '#afd700' , 22 , 148 ] 5 | let s:N2 = [ '#93a1a1' , '#586e75' , 245 , 240 ] 6 | let s:N3 = [ '#93a1a1' , '#073642' , 240 , 233 ] 7 | let g:airline#themes#durant#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 8 | 9 | 10 | let g:airline#themes#durant#normal_modified = { 11 | \ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] , 12 | \ } 13 | 14 | 15 | 16 | let s:I1 = [ '#ffffff' , '#00875f' , 255 , 29 ] 17 | let s:I2 = [ '#9e9e9e' , '#303030' , 247 , 236 ] 18 | let s:I3 = [ '#87d7ff' , '#005f87' , 117 , 24 ] 19 | let g:airline#themes#durant#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 20 | let g:airline#themes#durant#palette.insert_modified = { 21 | \ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] , 22 | \ } 23 | let g:airline#themes#durant#palette.insert_paste = { 24 | \ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] , 25 | \ } 26 | 27 | 28 | let g:airline#themes#durant#palette.replace = copy(g:airline#themes#durant#palette.insert) 29 | let g:airline#themes#durant#palette.replace.airline_a = [ s:I2[0] , '#af0000' , s:I2[2] , 124 , '' ] 30 | 31 | let g:airline#themes#durant#palette.replace_modified = g:airline#themes#durant#palette.insert_modified 32 | 33 | let s:V1 = [ '#1a1a18' , '#ffffff' , 232 , 255 ] 34 | let s:V2 = [ '#ffffff' , '#44403a' , 255, 238 ] 35 | let s:V3 = [ '#90a680' , '#2e2d2a' , 64, 235 ] 36 | let g:airline#themes#durant#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) 37 | let g:airline#themes#durant#palette.visual_modified = { 38 | \ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] , 39 | \ } 40 | 41 | 42 | let s:IA1 = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ] 43 | let s:IA2 = [ '#4e4e4e' , '#262626' , 239 , 235 , '' ] 44 | let s:IA3 = [ '#4e4e4e' , '#303030' , 239 , 236 , '' ] 45 | let g:airline#themes#durant#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3) 46 | let g:airline#themes#durant#palette.inactive_modified = { 47 | \ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] , 48 | \ } 49 | 50 | 51 | let g:airline#themes#durant#palette.accents = { 52 | \ 'red': [ '#ff0000' , '' , 160 , '' ] 53 | \ } 54 | 55 | if !get(g:, 'loaded_ctrlp', 0) 56 | finish 57 | endif 58 | let g:airline#themes#durant#palette.ctrlp = airline#extensions#ctrlp#generate_color_map( 59 | \ [ '#d7d7ff' , '#5f00af' , 189 , 55 , '' ], 60 | \ [ '#ffffff' , '#875fd7' , 231 , 98 , '' ], 61 | \ [ '#5f00af' , '#ffffff' , 55 , 231 , 'bold' ]) 62 | 63 | -------------------------------------------------------------------------------- /.vim/t/airline.vim: -------------------------------------------------------------------------------- 1 | let g:airline_theme = 'dark' 2 | 3 | source plugin/airline.vim 4 | doautocmd VimEnter 5 | 6 | function! MyFuncref(...) 7 | call a:1.add_raw('hello world') 8 | return 1 9 | endfunction 10 | 11 | function! MyIgnoreFuncref(...) 12 | return -1 13 | endfunction 14 | 15 | function! MyAppend1(...) 16 | call a:1.add_raw('hello') 17 | endfunction 18 | 19 | function! MyAppend2(...) 20 | call a:1.add_raw('world') 21 | endfunction 22 | 23 | describe 'airline' 24 | before 25 | let g:airline_statusline_funcrefs = [] 26 | end 27 | 28 | it 'should run user funcrefs first' 29 | call airline#add_statusline_func('MyFuncref') 30 | let &statusline = '' 31 | call airline#update_statusline() 32 | Expect airline#statusline(1) =~ 'hello world' 33 | end 34 | 35 | it 'should not change the statusline with -1' 36 | call airline#add_statusline_funcref(function('MyIgnoreFuncref')) 37 | let &statusline = 'foo' 38 | call airline#update_statusline() 39 | Expect &statusline == 'foo' 40 | end 41 | 42 | it 'should support multiple chained funcrefs' 43 | call airline#add_statusline_func('MyAppend1') 44 | call airline#add_statusline_func('MyAppend2') 45 | call airline#update_statusline() 46 | Expect airline#statusline(1) =~ 'helloworld' 47 | end 48 | 49 | it 'should allow users to redefine sections' 50 | let g:airline_section_a = airline#section#create(['mode', 'mode']) 51 | call airline#update_statusline() 52 | Expect airline#statusline(1) =~ '%{airline#util#wrap(airline#parts#mode(),0)}%#airline_a#%#airline_a_bold#%{airline#util#wrap(airline#parts#mode(),0)}%#airline_a#' 53 | end 54 | 55 | it 'should remove funcrefs properly' 56 | let c = len(g:airline_statusline_funcrefs) 57 | call airline#add_statusline_func('MyIgnoreFuncref') 58 | call airline#remove_statusline_func('MyIgnoreFuncref') 59 | Expect len(g:airline_statusline_funcrefs) == c 60 | end 61 | 62 | it 'should overwrite the statusline with active and inactive splits' 63 | wincmd s 64 | Expect airline#statusline(1) !~ 'inactive' 65 | Expect airline#statusline(2) =~ 'inactive' 66 | wincmd c 67 | end 68 | 69 | it 'should collapse the inactive split if the variable is set true' 70 | let g:airline_inactive_collapse = 1 71 | wincmd s 72 | Expect getwinvar(2, '&statusline') !~ 'airline#parts#mode' 73 | wincmd c 74 | end 75 | 76 | it 'should not collapse the inactive split if the variable is set false' 77 | let g:airline_inactive_collapse = 0 78 | wincmd s 79 | Expect getwinvar(2, '&statusline') != 'airline#parts#mode' 80 | wincmd c 81 | end 82 | 83 | it 'should include check_mode' 84 | Expect airline#statusline(1) =~ 'airline#check_mode' 85 | end 86 | end 87 | 88 | -------------------------------------------------------------------------------- /.vim/syntax/tagbar.vim: -------------------------------------------------------------------------------- 1 | " File: tagbar.vim 2 | " Description: Tagbar syntax settings 3 | " Author: Jan Larres 4 | " Licence: Vim licence 5 | " Website: http://majutsushi.github.com/tagbar/ 6 | " Version: 2.6.1 7 | 8 | scriptencoding utf-8 9 | 10 | if exists("b:current_syntax") 11 | finish 12 | endif 13 | 14 | let s:ics = escape(join(g:tagbar_iconchars, ''), ']^\-') 15 | let s:pattern = '\(^[' . s:ics . '] \?\)\@<=[^-+: ]\+[^:]\+$' 16 | execute "syntax match TagbarKind '" . s:pattern . "'" 17 | 18 | let s:pattern = '\(\S\@ 59 | index-sort = true 60 | wrapping-scroll = false 61 | enable-click = true 62 | 63 | label-mode-padding = 2 64 | label-mode-foreground = #000 65 | label-mode-background = ${colors.primary} 66 | 67 | ; focused = Active workspace on focused monitor 68 | label-focused = %name% 69 | label-focused-background = ${colors.primary} 70 | label-focused-foreground = ${colors.background} 71 | label-focused-underline = ${colors.background} 72 | label-focused-padding = 1 73 | 74 | ; unfocused = Inactive workspace on any monitor 75 | label-unfocused = %name% 76 | label-unfocused-padding = 1 77 | 78 | ; visible = Active workspace on unfocused monitor 79 | label-visible = %index% 80 | label-visible-background = ${self.label-focused-background} 81 | label-visible-underline = ${self.label-focused-underline} 82 | label-visible-padding = ${self.label-focused-padding} 83 | 84 | ; urgent = Workspace with urgency hint set 85 | label-urgent = %name% 86 | label-urgent-background = ${colors.alert} 87 | label-urgent-padding = 1 88 | 89 | [module/i3status] 90 | type = custom/script 91 | exec = cat /tmp/i3status 92 | interval = 2 93 | format-underline = #00000000 94 | format-prefix = "🖧 " 95 | format-prefix-foreground = #5b 96 | 97 | [settings] 98 | screenchange-reload = true 99 | 100 | [global/wm] 101 | margin-top = 0 102 | margin-bottom = 0 103 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/kalisi.vim: -------------------------------------------------------------------------------- 1 | " 2 | " Colorscheme: Kalisi for airline. Inspired by powerline. 3 | " Arthur Jaron 4 | " hifreeo@gmail.com 5 | " 24.10.2014 6 | 7 | " Visual mode 8 | let s:V1 = [ '#0087ff' , '#ffffff','33','231'] 9 | let s:V2 = [ '#005faf' , '#5fafff','25','75'] 10 | let s:V3 = [ '#87d7ff' , '#005faf','117','25'] 11 | 12 | " Replace mode 13 | let s:R1 = [ '#d75fff' , '#ffffff','171','231'] 14 | let s:R2 = [ '#5f005f' , '#d75fff','53','171'] 15 | let s:R3 = [ '#ff87ff' , '#8700af','213','91'] 16 | 17 | let g:airline#themes#kalisi#palette = {} 18 | 19 | 20 | function! airline#themes#kalisi#refresh() 21 | 22 | let s:StatusLine = airline#themes#get_highlight('StatusLine') 23 | let s:StatusLineNC = airline#themes#get_highlight('StatusLineNC') 24 | 25 | " Insert mode 26 | let s:I1 = [ '#ffffff' , '#e80000','231','160'] 27 | let s:I2 = [ '#ff0000' , '#5f0000','196','52'] 28 | let s:I3 = s:StatusLine 29 | 30 | " Normal mode 31 | let s:N1 = [ '#005f00' , '#afd700','22','148'] 32 | let s:N2 = [ '#afd700' , '#005f00','148','22'] 33 | let s:N3 = s:StatusLine 34 | 35 | " Tabline Plugin 36 | let g:airline#themes#kalisi#palette.tabline = { 37 | \ 'airline_tab': ['#bcbcbc', '#005f00','250','22'], 38 | \ 'airline_tabsel': ['#404042', '#A6DB29','238','148'], 39 | \ 'airline_tabtype':['#afd700', '#204d20','148','22'], 40 | \ 'airline_tabfill': s:StatusLine, 41 | \ 'airline_tabhid': ['#c5c5c5', '#404042','251','238'], 42 | \ 'airline_tabmod': ['#d7ff00', '#afd700','190','148'], 43 | \ 'airline_tabmod_unsel': ['#d7ff00', '#005f00','190','22'] 44 | \ } 45 | 46 | let g:airline#themes#kalisi#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 47 | let g:airline#themes#kalisi#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) 48 | let g:airline#themes#kalisi#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 49 | let g:airline#themes#kalisi#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3) 50 | 51 | " Inactive Mode 52 | let s:IA = airline#themes#get_highlight('StatusLineNC') 53 | let g:airline#themes#kalisi#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) 54 | let g:airline#themes#kalisi#palette.inactive_modified = { 55 | \ 'airline_c': ['#d7ff00', s:IA[1],'190',s:IA[3]], 56 | \ } 57 | 58 | endfunction 59 | 60 | call airline#themes#kalisi#refresh() 61 | 62 | if !get(g:, 'loaded_ctrlp', 0) 63 | finish 64 | endif 65 | let g:airline#themes#kalisi#palette.ctrlp = airline#extensions#ctrlp#generate_color_map( 66 | \ s:StatusLine, 67 | \ ['#afd700', '#005f00','148','22'], 68 | \ [ '#005f00' , '#afd700' , '22','148'] 69 | \) 70 | 71 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/badwolf.vim: -------------------------------------------------------------------------------- 1 | let s:N1 = [ '#141413' , '#aeee00' , 232 , 154 ] " blackestgravel & lime 2 | let s:N2 = [ '#f4cf86' , '#45413b' , 222 , 238 ] " dirtyblonde & deepgravel 3 | let s:N3 = [ '#8cffba' , '#242321' , 121 , 235 ] " saltwatertaffy & darkgravel 4 | let s:N4 = [ '#666462' , 241 ] " mediumgravel 5 | 6 | let s:I1 = [ '#141413' , '#0a9dff' , 232 , 39 ] " blackestgravel & tardis 7 | let s:I2 = [ '#f4cf86' , '#005fff' , 222 , 27 ] " dirtyblonde & facebook 8 | let s:I3 = [ '#0a9dff' , '#242321' , 39 , 235 ] " tardis & darkgravel 9 | 10 | let s:V1 = [ '#141413' , '#ffa724' , 232 , 214 ] " blackestgravel & orange 11 | let s:V2 = [ '#000000' , '#fade3e' , 16 , 221 ] " coal & dalespale 12 | let s:V3 = [ '#000000' , '#b88853' , 16 , 137 ] " coal & toffee 13 | let s:V4 = [ '#c7915b' , 173 ] " coffee 14 | 15 | let s:PA = [ '#f4cf86' , 222 ] " dirtyblonde 16 | let s:RE = [ '#ff9eb8' , 211 ] " dress 17 | 18 | let s:IA = [ s:N3[1] , s:N2[1] , s:N3[3] , s:N2[3] , '' ] 19 | 20 | let g:airline#themes#badwolf#palette = {} 21 | 22 | let g:airline#themes#badwolf#palette.accents = { 23 | \ 'red': [ '#ff2c4b' , '' , 196 , '' , '' ] 24 | \ } 25 | 26 | let g:airline#themes#badwolf#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 27 | let g:airline#themes#badwolf#palette.normal_modified = { 28 | \ 'airline_b': [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] , 29 | \ 'airline_c': [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] } 30 | 31 | 32 | let g:airline#themes#badwolf#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 33 | let g:airline#themes#badwolf#palette.insert_modified = { 34 | \ 'airline_c': [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] } 35 | let g:airline#themes#badwolf#palette.insert_paste = { 36 | \ 'airline_a': [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] } 37 | 38 | 39 | let g:airline#themes#badwolf#palette.replace = copy(airline#themes#badwolf#palette.insert) 40 | let g:airline#themes#badwolf#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ] 41 | let g:airline#themes#badwolf#palette.replace_modified = g:airline#themes#badwolf#palette.insert_modified 42 | 43 | 44 | let g:airline#themes#badwolf#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) 45 | let g:airline#themes#badwolf#palette.visual_modified = { 46 | \ 'airline_c': [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] } 47 | 48 | 49 | let g:airline#themes#badwolf#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) 50 | let g:airline#themes#badwolf#palette.inactive_modified = { 51 | \ 'airline_c': [ s:V1[1] , '' , s:V1[3] , '' , '' ] } 52 | 53 | -------------------------------------------------------------------------------- /.vim/autoload/gitgutter/async.vim: -------------------------------------------------------------------------------- 1 | let s:available = has('nvim') || ( 2 | \ has('job') && ( 3 | \ (has('patch-7-4-1826') && !has('gui_running')) || 4 | \ (has('patch-7-4-1850') && has('gui_running')) || 5 | \ (has('patch-7-4-1832') && has('gui_macvim')) 6 | \ ) 7 | \ ) 8 | 9 | function! gitgutter#async#available() 10 | return s:available 11 | endfunction 12 | 13 | 14 | function! gitgutter#async#execute(cmd, bufnr, handler) abort 15 | call gitgutter#debug#log('[async] '.a:cmd) 16 | 17 | let options = { 18 | \ 'stdoutbuffer': [], 19 | \ 'buffer': a:bufnr, 20 | \ 'handler': a:handler 21 | \ } 22 | let command = s:build_command(a:cmd) 23 | 24 | if has('nvim') 25 | call jobstart(command, extend(options, { 26 | \ 'on_stdout': function('s:on_stdout_nvim'), 27 | \ 'on_stderr': function('s:on_stderr_nvim'), 28 | \ 'on_exit': function('s:on_exit_nvim') 29 | \ })) 30 | else 31 | call job_start(command, { 32 | \ 'out_cb': function('s:on_stdout_vim', options), 33 | \ 'err_cb': function('s:on_stderr_vim', options), 34 | \ 'close_cb': function('s:on_exit_vim', options) 35 | \ }) 36 | endif 37 | endfunction 38 | 39 | 40 | function! s:build_command(cmd) 41 | if has('unix') 42 | return ['sh', '-c', a:cmd] 43 | endif 44 | 45 | if has('win32') 46 | return has('nvim') ? ['cmd.exe', '/c', a:cmd] : 'cmd.exe /c '.a:cmd 47 | endif 48 | 49 | throw 'unknown os' 50 | endfunction 51 | 52 | 53 | function! s:on_stdout_nvim(_job_id, data, _event) dict abort 54 | if empty(self.stdoutbuffer) 55 | let self.stdoutbuffer = a:data 56 | else 57 | let self.stdoutbuffer = self.stdoutbuffer[:-2] + 58 | \ [self.stdoutbuffer[-1] . a:data[0]] + 59 | \ a:data[1:] 60 | endif 61 | endfunction 62 | 63 | function! s:on_stderr_nvim(_job_id, _data, _event) dict abort 64 | call self.handler.err(self.buffer) 65 | endfunction 66 | 67 | function! s:on_exit_nvim(_job_id, exit_code, _event) dict abort 68 | if !a:exit_code 69 | call self.handler.out(self.buffer, join(self.stdoutbuffer, "\n")) 70 | endif 71 | endfunction 72 | 73 | 74 | function! s:on_stdout_vim(_channel, data) dict abort 75 | call add(self.stdoutbuffer, a:data) 76 | endfunction 77 | 78 | function! s:on_stderr_vim(channel, _data) dict abort 79 | call self.handler.err(self.buffer) 80 | endfunction 81 | 82 | function! s:on_exit_vim(channel) dict abort 83 | let job = ch_getjob(a:channel) 84 | while 1 85 | if job_status(job) == 'dead' 86 | let exit_code = job_info(job).exitval 87 | break 88 | endif 89 | sleep 5m 90 | endwhile 91 | 92 | if !exit_code 93 | call self.handler.out(self.buffer, join(self.stdoutbuffer, "\n")) 94 | endif 95 | endfunction 96 | -------------------------------------------------------------------------------- /.vim/autoload/airline/themes/laederon.vim: -------------------------------------------------------------------------------- 1 | " vim-airline companion theme of Laederon 2 | " (https://github.com/Donearm/Laederon) 3 | 4 | " Normal mode 5 | let s:N1 = [ '#1a1a18' , '#ffffff' , 232 , 255 ] " blackestgravel & snow 6 | let s:N2 = [ '#ffffff' , '#44403a' , 255, 238 ] " snow & deepgravel 7 | let s:N3 = [ '#90a680' , '#2e2d2a' , 64, 235 ] " dilutedpaint & darkgravel 8 | let s:N4 = [ '#777470' , 240 ] " gravel 9 | 10 | " Insert mode 11 | let s:I1 = [ '#1a1a18' , '#1693a5' , 232 , 62 ] " blackestgravel & crystallake 12 | let s:I2 = [ '#515744' , '#44403a' , 101 , 238 ] " lichen & deepgravel 13 | let s:I3 = [ '#1693a5' , '#2e2d2a' , 39 , 235 ] " crystallake & darkgravel 14 | 15 | " Visual mode 16 | let s:V1 = [ '#1a1a18' , '#ab3e5d' , 232 , 161 ] " blackestgravel & raspberry 17 | let s:V2 = [ '#000000' , '#908571' , 16 , 252 ] " coal & winterterrain 18 | let s:V3 = [ '#ab3e5d' , '#8c7f77' , 161 , 245 ] " raspberry & wetcoldterrain 19 | let s:V4 = [ '#515744' , 101 ] " lichen 20 | 21 | " Replace mode 22 | let s:RE = [ '#233e09' , 22 ] " oakleaf 23 | 24 | " Paste mode 25 | let s:PA = [ '#ab3e5d' , 161 ] " raspberry 26 | 27 | let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3], s:N3[3] , '' ] 28 | 29 | 30 | let g:airline#themes#laederon#palette = {} 31 | 32 | let g:airline#themes#laederon#palette.accents = { 33 | \ 'red': [ '#ef393d' , '' , 196 , '' , '' ] 34 | \ } 35 | 36 | let g:airline#themes#laederon#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 37 | let g:airline#themes#laederon#palette.normal_modified = { 38 | \ 'airline_a' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] , 39 | \ 'airline_c' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] } 40 | 41 | 42 | let g:airline#themes#laederon#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 43 | let g:airline#themes#laederon#palette.insert_modified = { 44 | \ 'airline_c' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] } 45 | let g:airline#themes#laederon#palette.insert_paste = { 46 | \ 'airline_a' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] } 47 | 48 | 49 | let g:airline#themes#laederon#palette.replace = copy(airline#themes#laederon#palette.insert) 50 | let g:airline#themes#laederon#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ] 51 | let g:airline#themes#laederon#palette.replace_modified = g:airline#themes#laederon#palette.insert_modified 52 | 53 | 54 | let g:airline#themes#laederon#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) 55 | let g:airline#themes#laederon#palette.visual_modified = { 56 | \ 'airline_c' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] } 57 | 58 | 59 | let g:airline#themes#laederon#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) 60 | let g:airline#themes#laederon#palette.inactive_modified = { 61 | \ 'airline_c' : [ s:V1[1] , '' , s:V1[3] , '' , '' ] } 62 | 63 | --------------------------------------------------------------------------------