diff --git a/aliases/key_aliases b/aliases/key_aliases index 4abcdc8..3e72f1b 100644 --- a/aliases/key_aliases +++ b/aliases/key_aliases @@ -17,7 +17,7 @@ vgb "sni /etc/default/grub" mkgb "sudo grub-mkconfig -o /boot/grub/grub.cfg" grep "grep --color=auto -n" -rg "grep -r" +grr "grep -r" # pk "pkill -f" cld "colordiff -y --suppress-common-lines" @@ -47,8 +47,9 @@ udub "udisksctl unmount -b /dev/sdc2" to "touch" # directory-related {{{ # -l "ls -a" -ll "ls -alFh" +ls "lsd" +l "lsd -a" +ll "lsd -al" smv "sudo mv" f "cd" fz "fzf" @@ -130,31 +131,30 @@ pipes "pipes.sh -t 3" # silent="> /dev/null 2>&1& " chr "google-chrome" -# h "htop -s PERCENT_MEM" +clc "cloc ." +cv "cava" +fh "feh" +gpd "gpg --decrypt" +gpe "gpg --encrypt --recipient" hc "htop -s PERCENT_CPU" -r "ranger" +# h "htop -s PERCENT_MEM" +kd "killall Discord && killall Discord" mra "man ranger" -clc "cloc ." n "nvim" +nd "node" +p3 "python3" +py "python" +r "ranger" +rx "redshift -x" sn "sudo nvim" -fh "feh" sx "sxiv" sxa "sxiv -a" wg "wego" wp "grep wallpaper ~/.cache/wal/colors.sh" -kd "killall Discord && killall Discord" - # rsl "java -jar ~/Downloads/RuneLite.jar" # swex "sudo nohup ~/Downloads/swex.appimage $silent" -cv "cava" - -rx "redshift -x" - -gpe "gpg --encrypt --recipient" -gpd "gpg --decrypt" - # pass {{{ # ps "pass" @@ -171,19 +171,19 @@ yu "echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard" # }}} pass # -p3 "python3" -py "python" - # watson {{{ # w "watson" wa "watson start" +wae "watson start && watson edit" we "watson edit" wl "watson log --day" -wlw "watson log" +ww "watson log" # wlm "watson log --project coding --tag mfs" -wr "watson report" -ws "watson stop" +wr "watson report --day" +wrw "watson report" +wre "watson restart" +ws "watson status && watson stop" wse "watson stop && watson edit" wsl "watson stop && watson log --day" wt "watson status" @@ -206,6 +206,7 @@ gbm "git branch --merged" # }}} branch # gr "git remote" +gro "git remote show origin" # add/remove {{{ # @@ -223,7 +224,7 @@ grmfc "git rm -f --cached" # diff/log {{{ # gd "git diff -w" -gdc "git diff --cached" +gdc "git diff --cached -w" gds "git diff --stat" gdt "git difftool --tool=vimdiff" gl "git log" @@ -370,5 +371,6 @@ hl "valgrind --tool=helgrind ./carsim light 10 20" # 309 0ht "cd ~/school/309-proj && python3 -m http.server" +v0c "cd /home/kevin/school/309-proj/css && nvim main.scss" # }}} school # diff --git a/fish/.config/fish/completions/watson.fish b/fish/.config/fish/completions/watson.fish index ad1318c..9dcf1ce 100644 --- a/fish/.config/fish/completions/watson.fish +++ b/fish/.config/fish/completions/watson.fish @@ -49,21 +49,23 @@ end function __fish_watson_get_projects -d "return a list of projects" __fish_watson_set_cache_vars __fish_watson_check_if_refresh_cache $_watson_projects_cache - if test $status -eq 1 - command watson projects | tee $_watson_projects_cache - else - cat $_watson_projects_cache - end + # if test $status -eq 1 + # command watson projects | tee $_watson_projects_cache + # else + # cat $_watson_projects_cache + # end + cat $_watson_projects_cache end function __fish_watson_get_tags -d "return a list of tags" __fish_watson_set_cache_vars __fish_watson_check_if_refresh_cache $_watson_tags_cache - if test $status -eq 1 - command watson tags | tee $_watson_tags_cache - else - cat $_watson_tags_cache - end + # if test $status -eq 1 + # command watson tags | tee $_watson_tags_cache + # else + # cat $_watson_tags_cache + # end + cat $_watson_tags_cache end function __fish_watson_get_frames -d "return a list of frames" #TODO, use watson logs to get more info diff --git a/fish/.config/fish/functions/cd.fish b/fish/.config/fish/functions/cd.fish index 7327d8a..84e899d 100644 --- a/fish/.config/fish/functions/cd.fish +++ b/fish/.config/fish/functions/cd.fish @@ -44,8 +44,9 @@ function cd --description "Change directory" set -g -a dirprev $previous set -e dirnext set -g __fish_cd_direction prev - set -U last_dir $PWD - ls -a + + set -U last_dir $PWD + ls -a end return $cd_status diff --git a/i3/.config/i3/config b/i3/.config/i3/config index 83fe29e..7f97e04 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -52,6 +52,8 @@ bindsym Mod4+t exec xclip -selection clipboard ~/.password-store/social/trapbot bindsym Mod4+u exec echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard bindsym Mod4+$mod+u exec pass -c uoft/acorn bindsym Mod4+w exec notify-send "watson status" "$(watson status)" +bindsym Mod4+$mod+w exec notify-send "watson stop" "$(watson status && watson stop)" +bindsym control+$mod+w exec urxvt -e nvim /home/kevin/.config/watson/state.tmp # bindsym Mod4+x exec $swex bindsym Mod4+x exec xmodmap ~/.Xmodmap && xset r rate 200 70 bindsym Mod4+z exec cliqz @@ -493,7 +495,7 @@ font pango:$sb_font 11 # media keys {{{ # bindsym control+d exec ~/linux-config/scripts/change-sink dac -bindsym control+shift+d exec ~/linux-config/scripts/change-sink dac2 +# bindsym control+shift+d exec ~/linux-config/scripts/change-sink dac2 bindsym control+o exec ~/linux-config/scripts/change-sink line-out bindsym XF86AudioRaiseVolume exec amixer -q -D pulse sset Master 5%+ && pkill -RTMIN+1 i3blocks diff --git a/i3blocks/.config/i3blocks/i3blocks.conf b/i3blocks/.config/i3blocks/i3blocks.conf index b2c1292..441933f 100644 --- a/i3blocks/.config/i3blocks/i3blocks.conf +++ b/i3blocks/.config/i3blocks/i3blocks.conf @@ -23,7 +23,7 @@ color=#cbe4ff [volume] interval=once signal=1 -interval=10 +interval=60 [calendar] interval=30 diff --git a/i3blocks/.config/i3blocks/sam-i3blocks.conf b/i3blocks/.config/i3blocks/sam-i3blocks.conf index ef24bb6..b9e12fa 100644 --- a/i3blocks/.config/i3blocks/sam-i3blocks.conf +++ b/i3blocks/.config/i3blocks/sam-i3blocks.conf @@ -18,12 +18,12 @@ label= # color=#198c19 # aqua # color=#2d7272 -interval=10 +interval=5 [volume] interval=once signal=1 -interval=10 +interval=60 [time_short] # label=πŸ•“ diff --git a/i3blocks/.config/i3blocks/scripts/spotify b/i3blocks/.config/i3blocks/scripts/spotify index cc8918f..7e0e4f0 100755 --- a/i3blocks/.config/i3blocks/scripts/spotify +++ b/i3blocks/.config/i3blocks/scripts/spotify @@ -1,4 +1,10 @@ #!/bin/bash +case "$BLOCK_BUTTON" in + 1) dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause ;; + 2) dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous ;; + 3) dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next ;; +esac + . "/home/kevin/.cache/wal/colors.sh" printf "$(spotify-now -i '%artist - %title' -p '' -e '')\n$(spotify-now -i '%title' -p '' -e '')\n%s\n" "$color7" diff --git a/ranger/.config/ranger/plugins/__init__.py b/ranger/.config/ranger/plugins/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ranger/.config/ranger/plugins/__pycache__/__init__.cpython-37.opt-1.pyc b/ranger/.config/ranger/plugins/__pycache__/__init__.cpython-37.opt-1.pyc new file mode 100644 index 0000000..6d57f76 Binary files /dev/null and b/ranger/.config/ranger/plugins/__pycache__/__init__.cpython-37.opt-1.pyc differ diff --git a/ranger/.config/ranger/plugins/__pycache__/devicons.cpython-37.opt-1.pyc b/ranger/.config/ranger/plugins/__pycache__/devicons.cpython-37.opt-1.pyc new file mode 100644 index 0000000..86bd455 Binary files /dev/null and b/ranger/.config/ranger/plugins/__pycache__/devicons.cpython-37.opt-1.pyc differ diff --git a/ranger/.config/ranger/plugins/__pycache__/devicons_linemode.cpython-37.opt-1.pyc b/ranger/.config/ranger/plugins/__pycache__/devicons_linemode.cpython-37.opt-1.pyc new file mode 100644 index 0000000..101a934 Binary files /dev/null and b/ranger/.config/ranger/plugins/__pycache__/devicons_linemode.cpython-37.opt-1.pyc differ diff --git a/ranger/.config/ranger/plugins/devicons.py b/ranger/.config/ranger/plugins/devicons.py new file mode 100755 index 0000000..dd37008 --- /dev/null +++ b/ranger/.config/ranger/plugins/devicons.py @@ -0,0 +1,232 @@ +#!/usr/bin/python +# coding=UTF-8 +# These glyphs, and the mapping of file extensions to glyphs +# has been copied from the vimscript code that is present in +# https://github.com/ryanoasis/vim-devicons +import re; +import os; + +# all those glyphs will show as weird squares if you don't have the correct patched font +# My advice is to use NerdFonts which can be found here: +# https://github.com/ryanoasis/nerd-fonts +file_node_extensions = { + '7z' : '', + 'ai' : '', + 'apk' : '', + 'avi' : 'ο€ˆ', + 'bat' : 'ξ˜•', + 'bmp' : '', + 'bz2' : '', + 'c' : '', + 'c++' : '', + 'cab' : '', + 'cbr' : '', + 'cbz' : '', + 'cc' : '', + 'clj' : '', + 'cljc' : '', + 'cljs' : 'ξͺ', + 'coffee' : 'ξ˜›', + 'conf' : 'ξ˜•', + 'cp' : '', + 'cpio' : '', + 'cpp' : '', + 'css' : 'ξ˜”', + 'cxx' : '', + 'd' : '', + 'dart' : '', + 'db' : 'ξœ†', + 'deb' : '', + 'diff' : '', + 'dump' : 'ξœ†', + 'edn' : 'ξͺ', + 'ejs' : '', + 'epub' : 'ο€­', + 'erl' : '', + 'exe' : '', + 'f#' : '', + 'fish' : 'ξž•', + 'flac' : '', + 'flv' : 'ο€ˆ', + 'fs' : '', + 'fsi' : '', + 'fsscript' : '', + 'fsx' : '', + 'gem' : '', + 'gif' : '', + 'go' : '', + 'gz' : '', + 'gzip' : '', + 'hbs' : '', + 'hrl' : '', + 'hs' : '', + 'htm' : '', + 'html' : '', + 'ico' : '', + 'ini' : 'ξ˜•', + 'java' : '', + 'jl' : '', + 'jpeg' : '', + 'jpg' : '', + 'js' : '', + 'json' : 'ξ˜‹', + 'jsx' : '', + 'less' : 'ξ˜”', + 'lha' : '', + 'lhs' : '', + 'log' : 'ο‡ͺ', + 'lua' : '', + 'lzh' : '', + 'lzma' : '', + 'markdown' : 'ξ˜‰', + 'md' : 'ξ˜‰', + 'mkv' : 'ο€ˆ', + 'ml' : 'Ξ»', + 'mli' : 'Ξ»', + 'mov' : 'ο€ˆ', + 'mp3' : '', + 'mp4' : 'ο€ˆ', + 'mpeg' : 'ο€ˆ', + 'mpg' : 'ο€ˆ', + 'mustache' : '', + 'ogg' : '', + 'pdf' : 'ο€­', + 'php' : '', + 'pl' : '', + 'pm' : '', + 'png' : '', + 'psb' : '', + 'psd' : '', + 'py' : 'ξ˜†', + 'pyc' : 'ξ˜†', + 'pyd' : 'ξ˜†', + 'pyo' : 'ξ˜†', + 'rar' : '', + 'rb' : 'ξž‘', + 'rc' : 'ξ˜•', + 'rlib' : '', + 'rpm' : '', + 'rs' : '', + 'rss' : 'ξ˜™', + 'scala' : '', + 'scss' : 'ξ˜ƒ', + 'sh' : 'ξž•', + 'slim' : '', + 'sln' : '', + 'sql' : 'ξœ†', + 'styl' : 'ξ˜€', + 'suo' : '', + 't' : '', + 'tar' : '', + 'tgz' : '', + 'ts' : '', + 'twig' : '', + 'vim' : 'ξŸ…', + 'vimrc' : 'ξŸ…', + 'wav' : '', + 'webm' : 'ο€ˆ', + 'xml' : '', + 'xul' : '', + 'xz' : '', + 'yml' : 'ξ˜•', + 'zip' : '', +} + +dir_node_exact_matches = { +# English + '.git' : 'ξ—»', + 'Desktop' : 'ο„ˆ', + 'Documents' : '', + 'Downloads' : 'ο’˜', + 'Dropbox' : 'ξœ‡', + 'Music' : 'ο€₯', + 'Pictures' : '', + 'Public' : '', + 'Templates' : 'οƒ…', + 'Videos' : '', +# Spanish + 'Escritorio' : 'ο„ˆ', + 'Documentos' : '', + 'Descargas' : 'ο’˜', + 'MΓΊsica' : 'ο€₯', + 'ImΓ‘genes' : '', + 'PΓΊblico' : '', + 'Plantillas' : 'οƒ…', + 'VΓ­deos' : '', +# French + 'Bureau' : 'ο„ˆ', + 'Documents' : '', + 'Images' : '', + 'Musique' : 'ο€₯', + 'Publique' : '', + 'TΓ©lΓ©chargements' : 'ο’˜', + 'VidΓ©os' : '', +# Portuguese + 'Documentos' : '', + 'Imagens' : '', + 'Modelos' : 'οƒ…', + 'MΓΊsica' : 'ο€₯', + 'PΓΊblico' : '', + 'VΓ­deos' : '', + 'Área de trabalho' : 'ο„ˆ', +# Italian + 'Documenti' : '', + 'Immagini' : '', + 'Modelli' : 'οƒ…', + 'Musica' : 'ο€₯', + 'Pubblici' : '', + 'Scaricati' : 'ο’˜', + 'Scrivania' : 'ο„ˆ', + 'Video' : '', +# German + 'Bilder' : '', + 'Dokumente' : '', + 'Musik' : 'ο€₯', + 'Schreibtisch' : 'ο„ˆ', + 'Vorlagen' : 'οƒ…', + 'Γ–ffentlich' : '', +} + +file_node_exact_matches = { + '.Xdefaults' : 'ξ˜•', + '.Xresources' : 'ξ˜•', + '.bashprofile' : 'ξ˜•', + '.bashrc' : 'ξ˜•', + '.dmrc' : 'ξ˜•', + '.ds_store' : 'ξ˜•', + '.fasd' : 'ξ˜•', + '.gitconfig' : 'ξ˜•', + '.gitignore' : 'ξ˜•', + '.jack-settings' : 'ξ˜•', + '.mime.types' : 'ξ˜•', + '.nvidia-settings-rc' : 'ξ˜•', + '.pam_environment' : 'ξ˜•', + '.profile' : 'ξ˜•', + '.recently-used' : 'ξ˜•', + '.selected_editor' : 'ξ˜•', + '.vimrc' : 'ξŸ…', + '.xinputrc' : 'ξ˜•', + 'config' : 'ξ˜•', + 'dropbox' : 'ξœ‡', + 'exact-match-case-sensitive-1.txt' : 'X1', + 'exact-match-case-sensitive-2' : 'X2', + 'favicon.ico' : '', + 'gruntfile.coffee' : 'ξ˜‘', + 'gruntfile.js' : 'ξ˜‘', + 'gruntfile.ls' : 'ξ˜‘', + 'gulpfile.coffee' : '', + 'gulpfile.js' : '', + 'gulpfile.ls' : '', + 'ini' : 'ξ˜•', + 'ledger' : 'ο…•', + 'license' : '', + 'mimeapps.list' : 'ξ˜•', + 'node_modules' : '', + 'procfile' : 'ξ˜‡', + 'react.jsx' : 'ξ˜₯', + 'user-dirs.dirs' : 'ξ˜•', +} + +def devicon(file): + if file.is_directory: return dir_node_exact_matches.get(file.relative_path, 'ξ—Ώ') + return file_node_exact_matches.get(file.relative_path, file_node_extensions.get(file.extension, 'ξ˜’')) diff --git a/ranger/.config/ranger/plugins/devicons_linemode.py b/ranger/.config/ranger/plugins/devicons_linemode.py new file mode 100755 index 0000000..d826330 --- /dev/null +++ b/ranger/.config/ranger/plugins/devicons_linemode.py @@ -0,0 +1,19 @@ +import ranger.api +from ranger.core.linemode import LinemodeBase +from plugins.devicons import * + +@ranger.api.register_linemode +class DevIconsLinemode(LinemodeBase): + name = "devicons" + + uses_metadata = False + + def filetitle(self, file, metadata): + return devicon(file) + ' ' + file.relative_path + +@ranger.api.register_linemode +class DevIconsLinemodeFile(LinemodeBase): + name = "filename" + + def filetitle(self, file, metadata): + return devicon(file) + ' ' + file.relative_path diff --git a/ranger/.config/ranger/rc.conf b/ranger/.config/ranger/rc.conf index 0d6857d..cc460f5 100644 --- a/ranger/.config/ranger/rc.conf +++ b/ranger/.config/ranger/rc.conf @@ -695,3 +695,6 @@ source /home/kevin/.config/ranger/key_mappings.conf map dg shell dragon-drag-and-drop -a -x %p # map shell dragon-drag-and-drop -a -x %p +# a plugin that adds file glyphs / icon support to Ranger: +# https://github.com/alexanderjeurissen/ranger_devicons +default_linemode devicons diff --git a/scripts/shuffler b/scripts/shuffler index 82e5af3..71714cf 100755 --- a/scripts/shuffler +++ b/scripts/shuffler @@ -53,8 +53,7 @@ fi # rebuild shuffle cache if regen_flag, doesn't exist or file empty if [[ "$regen_flag" -eq 1 ]] || [[ ! -f "$dir"/"$shuffle_cache" ]] || \ - [[ $(wc -l "$dir"/"$shuffle_cache" | awk '{print $1}') -eq 0 ]]; then -# if [[ "$regen_flag" -eq 1 ]]; then + [[ "$(head -n 1 "$dir"/"$shuffle_cache")" = "" ]]; then find "$dir"/* ! -name "$shuffle_cache" -type f | shuf > "$dir"/"$shuffle_cache" fi head -n 1 "$dir"/"$shuffle_cache" diff --git a/txt/ideas.md b/txt/ideas.md new file mode 100644 index 0000000..18ffdb9 --- /dev/null +++ b/txt/ideas.md @@ -0,0 +1,2 @@ +- nnn +- spotify blocklet - escape chars. diff --git a/txt/ideas.txt b/txt/ideas.txt deleted file mode 100644 index 0ef75d7..0000000 --- a/txt/ideas.txt +++ /dev/null @@ -1,2 +0,0 @@ -- nnn -- set (control+)alt+w to choose brightness/editing diff --git a/txt/key_dirs.txt b/txt/key_dirs.txt index fd7af3c..0a13c77 100644 --- a/txt/key_dirs.txt +++ b/txt/key_dirs.txt @@ -42,6 +42,7 @@ wo /home/kevin/Documents/workout-logs/11 # sch {{{ * sc /home/kevin/school +0c /home/kevin/school/309-proj/css 0d /home/kevin/school/309 0p /home/kevin/school/309-proj e2 /home/kevin/school/309/e2 diff --git a/txt/key_files.txt b/txt/key_files.txt index 6827b28..df6080c 100644 --- a/txt/key_files.txt +++ b/txt/key_files.txt @@ -32,15 +32,17 @@ ne /home/kevin/linux-config/configs/neofetch/config.conf re README.md td todo.md tm /home/kevin/.vim/plugged/vim-snippets/UltiSnips/texmath.snippets +wh /home/kevin/Documents/journal/work-habit.md wt /home/kevin/.config/watson/state.tmp # }}} cdn * # sch {{{ * -0c /home/kevin/school/309-proj/main.scss 0h /home/kevin/school/309-proj/index.html -0j /home/kevin/school/309-proj/main.js +0m /home/kevin/school/309-proj/js/main.js +0f /home/kevin/school/309-proj/js/food.js +0s /home/kevin/school/309-proj/js/stores.js 0k /home/kevin/school/309-proj/txt/kevin.md # }}} sch * diff --git a/vim/.vimrc b/vim/.vimrc index 8fcdf48..37f627a 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -64,9 +64,9 @@ autocmd BufNewFile,BufRead watson*.fish set tabstop=2 shiftwidth=2 expandtab autocmd BufRead commit-msg.txt set filetype=gitcommit tw=72 autocmd BufWritePost key_* !sync-shortcuts -autocmd BufNewFile,BufRead main.scss map :silent !sass main.scss main.css +autocmd BufNewFile,BufRead main.scss map :silent !sass %:p %:p:h/main.css " map :autocmd BufWritePost main.scss silent !sass main.scss main.css -autocmd BufNewFile,BufRead main.scss map :autocmd BufWritePost main.scss silent !sass main.scss main.css +autocmd BufNewFile,BufRead main.scss map :autocmd BufWritePost main.scss silent !sass %:p %:p:h/main.css autocmd BufNewFile,BufRead main.scss map :autocmd! BufWritePost main.scss " }}} commands for specific files " @@ -235,6 +235,9 @@ nnoremap | " leader mappings {{{ " let mapleader="\" + +" find alias +nnoremap a /^ " replace until end of line nnoremap c c$ " delete entire buffer @@ -247,8 +250,6 @@ nnoremap D "+dd nnoremap DA "+ggdG " find copied text nnoremap f q/p -" find alias -nnoremap fa /^ " find merge conflicts nnoremap fc /[<>=\|]\{7\} " reload folds @@ -289,7 +290,6 @@ vnoremap r q:is///g3ha nnoremap rv :source $MYVIMRC " replace in entire file nnoremap R q:i%s///g2F/i -" sort lines until end of file vnoremap s :sort nnoremap sc :set spell spelllang=en_us " run current file in shell