Browse Source

Spotify blocklet controls, build main.scss

ranger icons.
red-hat-laptop
Kevin Mok 6 years ago
parent
commit
79ef30f09b
Signed by: Kevin-Mok GPG Key ID: AEA75288DC135CF5
  1. 48
      aliases/key_aliases
  2. 18
      fish/.config/fish/completions/watson.fish
  3. 1
      fish/.config/fish/functions/cd.fish
  4. 4
      i3/.config/i3/config
  5. 2
      i3blocks/.config/i3blocks/i3blocks.conf
  6. 4
      i3blocks/.config/i3blocks/sam-i3blocks.conf
  7. 6
      i3blocks/.config/i3blocks/scripts/spotify
  8. 0
      ranger/.config/ranger/plugins/__init__.py
  9. BIN
      ranger/.config/ranger/plugins/__pycache__/__init__.cpython-37.opt-1.pyc
  10. BIN
      ranger/.config/ranger/plugins/__pycache__/devicons.cpython-37.opt-1.pyc
  11. BIN
      ranger/.config/ranger/plugins/__pycache__/devicons_linemode.cpython-37.opt-1.pyc
  12. 232
      ranger/.config/ranger/plugins/devicons.py
  13. 19
      ranger/.config/ranger/plugins/devicons_linemode.py
  14. 3
      ranger/.config/ranger/rc.conf
  15. 3
      scripts/shuffler
  16. 2
      txt/ideas.md
  17. 2
      txt/ideas.txt
  18. 1
      txt/key_dirs.txt
  19. 6
      txt/key_files.txt
  20. 10
      vim/.vimrc

48
aliases/key_aliases

@ -17,7 +17,7 @@ vgb "sni /etc/default/grub"
mkgb "sudo grub-mkconfig -o /boot/grub/grub.cfg" mkgb "sudo grub-mkconfig -o /boot/grub/grub.cfg"
grep "grep --color=auto -n" grep "grep --color=auto -n"
rg "grep -r"
grr "grep -r"
# pk "pkill -f" # pk "pkill -f"
cld "colordiff -y --suppress-common-lines" cld "colordiff -y --suppress-common-lines"
@ -47,8 +47,9 @@ udub "udisksctl unmount -b /dev/sdc2"
to "touch" to "touch"
# directory-related {{{ # # directory-related {{{ #
l "ls -a"
ll "ls -alFh"
ls "lsd"
l "lsd -a"
ll "lsd -al"
smv "sudo mv" smv "sudo mv"
f "cd" f "cd"
fz "fzf" fz "fzf"
@ -130,31 +131,30 @@ pipes "pipes.sh -t 3"
# silent="> /dev/null 2>&1& " # silent="> /dev/null 2>&1& "
chr "google-chrome" 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" hc "htop -s PERCENT_CPU"
r "ranger"
# h "htop -s PERCENT_MEM"
kd "killall Discord && killall Discord"
mra "man ranger" mra "man ranger"
clc "cloc ."
n "nvim" n "nvim"
nd "node"
p3 "python3"
py "python"
r "ranger"
rx "redshift -x"
sn "sudo nvim" sn "sudo nvim"
fh "feh"
sx "sxiv" sx "sxiv"
sxa "sxiv -a" sxa "sxiv -a"
wg "wego" wg "wego"
wp "grep wallpaper ~/.cache/wal/colors.sh" wp "grep wallpaper ~/.cache/wal/colors.sh"
kd "killall Discord && killall Discord"
# rsl "java -jar ~/Downloads/RuneLite.jar" # rsl "java -jar ~/Downloads/RuneLite.jar"
# swex "sudo nohup ~/Downloads/swex.appimage $silent" # swex "sudo nohup ~/Downloads/swex.appimage $silent"
cv "cava"
rx "redshift -x"
gpe "gpg --encrypt --recipient"
gpd "gpg --decrypt"
# pass {{{ # # pass {{{ #
ps "pass" ps "pass"
@ -171,19 +171,19 @@ yu "echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard"
# }}} pass # # }}} pass #
p3 "python3"
py "python"
# watson {{{ # # watson {{{ #
w "watson" w "watson"
wa "watson start" wa "watson start"
wae "watson start && watson edit"
we "watson edit" we "watson edit"
wl "watson log --day" wl "watson log --day"
wlw "watson log"
ww "watson log"
# wlm "watson log --project coding --tag mfs" # 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" wse "watson stop && watson edit"
wsl "watson stop && watson log --day" wsl "watson stop && watson log --day"
wt "watson status" wt "watson status"
@ -206,6 +206,7 @@ gbm "git branch --merged"
# }}} branch # # }}} branch #
gr "git remote" gr "git remote"
gro "git remote show origin"
# add/remove {{{ # # add/remove {{{ #
@ -223,7 +224,7 @@ grmfc "git rm -f --cached"
# diff/log {{{ # # diff/log {{{ #
gd "git diff -w" gd "git diff -w"
gdc "git diff --cached"
gdc "git diff --cached -w"
gds "git diff --stat" gds "git diff --stat"
gdt "git difftool --tool=vimdiff" gdt "git difftool --tool=vimdiff"
gl "git log" gl "git log"
@ -370,5 +371,6 @@ hl "valgrind --tool=helgrind ./carsim light 10 20"
# 309 # 309
0ht "cd ~/school/309-proj && python3 -m http.server" 0ht "cd ~/school/309-proj && python3 -m http.server"
v0c "cd /home/kevin/school/309-proj/css && nvim main.scss"
# }}} school # # }}} school #

18
fish/.config/fish/completions/watson.fish

@ -49,21 +49,23 @@ end
function __fish_watson_get_projects -d "return a list of projects" function __fish_watson_get_projects -d "return a list of projects"
__fish_watson_set_cache_vars __fish_watson_set_cache_vars
__fish_watson_check_if_refresh_cache $_watson_projects_cache __fish_watson_check_if_refresh_cache $_watson_projects_cache
if test $status -eq 1
command watson projects | tee $_watson_projects_cache
else
# if test $status -eq 1
# command watson projects | tee $_watson_projects_cache
# else
# cat $_watson_projects_cache
# end
cat $_watson_projects_cache cat $_watson_projects_cache
end
end end
function __fish_watson_get_tags -d "return a list of tags" function __fish_watson_get_tags -d "return a list of tags"
__fish_watson_set_cache_vars __fish_watson_set_cache_vars
__fish_watson_check_if_refresh_cache $_watson_tags_cache __fish_watson_check_if_refresh_cache $_watson_tags_cache
if test $status -eq 1
command watson tags | tee $_watson_tags_cache
else
# if test $status -eq 1
# command watson tags | tee $_watson_tags_cache
# else
# cat $_watson_tags_cache
# end
cat $_watson_tags_cache cat $_watson_tags_cache
end
end end
function __fish_watson_get_frames -d "return a list of frames" #TODO, use watson logs to get more info function __fish_watson_get_frames -d "return a list of frames" #TODO, use watson logs to get more info

1
fish/.config/fish/functions/cd.fish

@ -44,6 +44,7 @@ function cd --description "Change directory"
set -g -a dirprev $previous set -g -a dirprev $previous
set -e dirnext set -e dirnext
set -g __fish_cd_direction prev set -g __fish_cd_direction prev
set -U last_dir $PWD set -U last_dir $PWD
ls -a ls -a
end end

4
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+u exec echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard
bindsym Mod4+$mod+u exec pass -c uoft/acorn bindsym Mod4+$mod+u exec pass -c uoft/acorn
bindsym Mod4+w exec notify-send "watson status" "$(watson status)" 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 $swex
bindsym Mod4+x exec xmodmap ~/.Xmodmap && xset r rate 200 70 bindsym Mod4+x exec xmodmap ~/.Xmodmap && xset r rate 200 70
bindsym Mod4+z exec cliqz bindsym Mod4+z exec cliqz
@ -493,7 +495,7 @@ font pango:$sb_font 11
# media keys {{{ # # media keys {{{ #
bindsym control+d exec ~/linux-config/scripts/change-sink dac 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 control+o exec ~/linux-config/scripts/change-sink line-out
bindsym XF86AudioRaiseVolume exec amixer -q -D pulse sset Master 5%+ && pkill -RTMIN+1 i3blocks bindsym XF86AudioRaiseVolume exec amixer -q -D pulse sset Master 5%+ && pkill -RTMIN+1 i3blocks

2
i3blocks/.config/i3blocks/i3blocks.conf

@ -23,7 +23,7 @@ color=#cbe4ff
[volume] [volume]
interval=once interval=once
signal=1 signal=1
interval=10
interval=60
[calendar] [calendar]
interval=30 interval=30

4
i3blocks/.config/i3blocks/sam-i3blocks.conf

@ -18,12 +18,12 @@ label=
# color=#198c19 # color=#198c19
# aqua # aqua
# color=#2d7272 # color=#2d7272
interval=10
interval=5
[volume] [volume]
interval=once interval=once
signal=1 signal=1
interval=10
interval=60
[time_short] [time_short]
# label=🕓 # label=🕓

6
i3blocks/.config/i3blocks/scripts/spotify

@ -1,4 +1,10 @@
#!/bin/bash #!/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" . "/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" printf "$(spotify-now -i '%artist - %title' -p '' -e '')\n$(spotify-now -i '%title' -p '' -e '')\n%s\n" "$color7"

0
ranger/.config/ranger/plugins/__init__.py

BIN
ranger/.config/ranger/plugins/__pycache__/__init__.cpython-37.opt-1.pyc

BIN
ranger/.config/ranger/plugins/__pycache__/devicons.cpython-37.opt-1.pyc

BIN
ranger/.config/ranger/plugins/__pycache__/devicons_linemode.cpython-37.opt-1.pyc

232
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, ''))

19
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

3
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 dg shell dragon-drag-and-drop -a -x %p
# map <C-d> shell dragon-drag-and-drop -a -x %p # map <C-d> 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

3
scripts/shuffler

@ -53,8 +53,7 @@ fi
# rebuild shuffle cache if regen_flag, doesn't exist or file empty # rebuild shuffle cache if regen_flag, doesn't exist or file empty
if [[ "$regen_flag" -eq 1 ]] || [[ ! -f "$dir"/"$shuffle_cache" ]] || \ 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" find "$dir"/* ! -name "$shuffle_cache" -type f | shuf > "$dir"/"$shuffle_cache"
fi fi
head -n 1 "$dir"/"$shuffle_cache" head -n 1 "$dir"/"$shuffle_cache"

2
txt/ideas.md

@ -0,0 +1,2 @@
- nnn
- spotify blocklet - escape chars.

2
txt/ideas.txt

@ -1,2 +0,0 @@
- nnn
- set (control+)alt+w to choose brightness/editing

1
txt/key_dirs.txt

@ -42,6 +42,7 @@ wo /home/kevin/Documents/workout-logs/11
# sch {{{ * # sch {{{ *
sc /home/kevin/school sc /home/kevin/school
0c /home/kevin/school/309-proj/css
0d /home/kevin/school/309 0d /home/kevin/school/309
0p /home/kevin/school/309-proj 0p /home/kevin/school/309-proj
e2 /home/kevin/school/309/e2 e2 /home/kevin/school/309/e2

6
txt/key_files.txt

@ -32,15 +32,17 @@ ne /home/kevin/linux-config/configs/neofetch/config.conf
re README.md re README.md
td todo.md td todo.md
tm /home/kevin/.vim/plugged/vim-snippets/UltiSnips/texmath.snippets 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 wt /home/kevin/.config/watson/state.tmp
# }}} cdn * # }}} cdn *
# sch {{{ * # sch {{{ *
0c /home/kevin/school/309-proj/main.scss
0h /home/kevin/school/309-proj/index.html 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 0k /home/kevin/school/309-proj/txt/kevin.md
# }}} sch * # }}} sch *

10
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 BufRead commit-msg.txt set filetype=gitcommit tw=72
autocmd BufWritePost key_* !sync-shortcuts autocmd BufWritePost key_* !sync-shortcuts
autocmd BufNewFile,BufRead main.scss map <F1> :silent !sass main.scss main.css<CR>
autocmd BufNewFile,BufRead main.scss map <F1> :silent !sass %:p %:p:h/main.css<CR>
" map <leader><F2> :autocmd BufWritePost main.scss silent !sass main.scss main.css<CR> " map <leader><F2> :autocmd BufWritePost main.scss silent !sass main.scss main.css<CR>
autocmd BufNewFile,BufRead main.scss map <F2> :autocmd BufWritePost main.scss silent !sass main.scss main.css<CR>
autocmd BufNewFile,BufRead main.scss map <F2> :autocmd BufWritePost main.scss silent !sass %:p %:p:h/main.css<CR>
autocmd BufNewFile,BufRead main.scss map <F3> :autocmd! BufWritePost main.scss<CR> autocmd BufNewFile,BufRead main.scss map <F3> :autocmd! BufWritePost main.scss<CR>
" }}} commands for specific files " " }}} commands for specific files "
@ -235,6 +235,9 @@ nnoremap <C-w> <C-W>|
" leader mappings {{{ " " leader mappings {{{ "
let mapleader="\<Space>" let mapleader="\<Space>"
" find alias
nnoremap <leader>a /^ <Left>
" replace until end of line " replace until end of line
nnoremap <leader>c c$ nnoremap <leader>c c$
" delete entire buffer " delete entire buffer
@ -247,8 +250,6 @@ nnoremap <leader>D "+dd
nnoremap <leader>DA "+ggdG nnoremap <leader>DA "+ggdG
" find copied text " find copied text
nnoremap <leader>f q/p<CR> nnoremap <leader>f q/p<CR>
" find alias
nnoremap <leader>fa /^ <Left>
" find merge conflicts " find merge conflicts
nnoremap <leader>fc /[<>=\|]\{7\}<CR> nnoremap <leader>fc /[<>=\|]\{7\}<CR>
" reload folds " reload folds
@ -289,7 +290,6 @@ vnoremap <leader>r q:is///g<ESC>3ha
nnoremap <leader>rv :source $MYVIMRC<CR> nnoremap <leader>rv :source $MYVIMRC<CR>
" replace in entire file " replace in entire file
nnoremap <leader>R q:i%s///g<ESC>2F/i nnoremap <leader>R q:i%s///g<ESC>2F/i
" sort lines until end of file
vnoremap <leader>s :sort<CR> vnoremap <leader>s :sort<CR>
nnoremap <leader>sc :set spell spelllang=en_us<CR> nnoremap <leader>sc :set spell spelllang=en_us<CR>
" run current file in shell " run current file in shell

Loading…
Cancel
Save