Skip to content

Commit

Permalink
get back to spotify, add git diff image, use grammarous instead of le…
Browse files Browse the repository at this point in the history
…xical
  • Loading branch information
kovetskiy committed Jul 17, 2020
1 parent ae50895 commit efb6d64
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 120 deletions.
1 change: 1 addition & 0 deletions .config/coc/extensions/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"dependencies": {
"coc-css": ">=1.2.4",
"coc-git": ">=1.7.13",
"coc-go": ">=0.7.0",
"coc-java": ">=1.4.11",
Expand Down
19 changes: 18 additions & 1 deletion .gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
[core]
;editor = vim
excludesfile = /home/operator/.gitignore_global
attributesfile = ~/.gitattributes
[color]
ui = auto
ui = true
[pager]
diff = diff-so-fancy | less --tabs=4 -RFX
show = diff-so-fancy | less --tabs=4 -RFX
Expand Down Expand Up @@ -43,3 +44,19 @@
insteadOf = https://bitbucket.org/
[http]
cookiefile = /home/operator/.gitcookies
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = white bold 52
newNormal = green bold
newHighlight = red bold 22
[color "diff"]
meta = 11
frag = magenta bold
commit = yellow bold
old = red bold
new = white bold 22
whitespace = red reverse
[alias]
diff-image = "!f() { cd -- \"${GIT_PREFIX:-.}\"; GIT_DIFF_IMAGE_ENABLED=1 git diff \"$@\"; }; f"
[diff "image"]
command = /home/operator/dotfiles/git-diff-image/git_diff_image
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
url = [email protected]:reconquest/rex
branch = master
ignore = all
[submodule "git-diff-image"]
path = git-diff-image
url = https://github.com/ewanmellor/git-diff-image
13 changes: 8 additions & 5 deletions .xbindkeysrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
"REPO=~/reconquest/secrets carcosa-new-password"
Mod3 + 6

"carcosa-new-password"
Mod3 + 5
"baton-volume down 5"
Mod3 + j

"baton-volume up 5"
Mod3 + k

"music pause"
Mod3 + p
Expand All @@ -13,10 +16,10 @@
"music prev"
Mod3 + h

"music like"
"music save"
Mod3 + m

"music dislike"
"music remove"
Mod3 + n

"music status"
Expand All @@ -25,5 +28,5 @@
"with-lock kuake-bottom"
Mod3 + t

"screen-lock"
"xsecurelock"
Mod3 + g
99 changes: 23 additions & 76 deletions bin/music
Original file line number Diff line number Diff line change
@@ -1,93 +1,40 @@
#!/bin/bash

get_status() {
for window in $(windows); do
title=$(xdotool getwindowname $window)
echo 🎵 $title
done
get-status() {
status=$(baton status)
artist=$(grep -P "^Artist:" <<< "$status" | cut -d: -f2-)
track=$(grep -P "^Track" <<< "$status" | cut -d: -f2-)
echo 🎵 $artist$track
}

_get_windows() {
for window in $(xdotool search --class youtube-music-desktop-app); do
title=$(xdotool getwindowname $window)
if [[ "$title" == "youtube-music-desktop-app" ]]; then
continue
fi

echo $window
done
}

windows() {
if [[ ! "$_windows" ]]; then
_windows=$(_get_windows)
fi
echo "$_windows"
}

send() {
local key=$1
active=$(xdotool getactivewindow)
for window in $(windows); do
xdotool windowactivate --sync $window
xdotool key --clearmodifiers --window $window $key
done
xdotool windowactivate $active
}

status=$(get_status)

icon=""
case "$1" in
next)
icon="⏭️"
send j
;;

prev)
icon="⏮️"
send k
;;
next)
icon="⏭️"
;;

pause)
icon="⏯️"
send space
;;
prev)
icon="⏮️"
;;

like)
icon=""
send plus
;;
pause)
icon="⏯️"
;;

dislike)
icon=""
send underscore
;;
save)
icon=""
;;

*)
icon="${1}"
;;
*)
icon="${1}"
;;
esac

if [[ "$1" == "status" ]]; then
notify-replace music "" "$status"
notify music "" "$(get-status)"
exit
fi

i=0
while :; do
i=$((i + 1))
if [[ "$i" == "10" ]]; then
break
fi

new_status=$(get_status)
if [[ "$status" != "$new_status" ]]; then
status="$new_status"
break
fi
sleep 0.1
done

notify-replace music "" "${icon}"
notify-replace music "" "$status"
baton "${@}"
notify-replace music "" "$(get-status)"
1 change: 1 addition & 0 deletions bin/wrap
1 change: 1 addition & 0 deletions git-diff-image
Submodule git-diff-image added at dee6a1
3 changes: 3 additions & 0 deletions vim.d/01-plugins.vim
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ Plug 'ddrscott/vim-side-search'
Plug 'matze/vim-move'
Plug 'kovetskiy/neovim-move', { 'do' : ':UpdateRemotePlugins' }

Plug 'rhysd/vim-grammarous'

if $BACKGROUND == "dark"
Plug 'reconquest/vim-colorscheme'
func! _setup_colorscheme()
Expand Down Expand Up @@ -126,4 +128,5 @@ if $BACKGROUND == "light"
endfunc!
endif


call plug#end()
43 changes: 6 additions & 37 deletions vim.d/41-lexical.vim
Original file line number Diff line number Diff line change
@@ -1,37 +1,6 @@
augroup lexical
autocmd!
"autocmd FileType markdown,md call _lexical_init()
augroup END

if empty(glob('~/.vim/thesaurus/mthesaur.txt'))
silent !mkdir -p ~/.vim/thesaurus/
silent !curl -fLo ~/.vim/thesaurus/mthesaur.txt
\ https://raw.githubusercontent.com/zeke/moby/master/words.txt
autocmd VimEnter * PlugInstall
endif

func! _lexical_init()
if expand('%:p') =~ 'coc:'
return
endif

call lexical#init()
let b:_lexical = '1'
endfunc!

func! _lexical_toggle()
if !exists('b:_lexical') || b:_lexical == '0'
:call _lexical_init()
else
setlocal spelllang=
setlocal spellfile=
setlocal nospell
setlocal thesaurus=
setlocal dictionary=
let b:_lexical = '0'
endif
endfunc!

let g:lexical#spell_key = '<leader><leader>s'

nmap <leader>el :call _lexical_toggle()<CR>
nmap <Leader>gn <Plug>(grammarous-move-to-next-error)
nmap <Leader>gp <Plug>(grammarous-move-to-previous-error)
nmap <Leader>gf <Plug>(grammarous-fixit)
nmap <Leader>go <Plug>(grammarous-open-info-window)
nmap <Leader>gc <Plug>(grammarous-close-info-window)
nmap <Leader>gg :GrammarousCheck --preview<CR>
3 changes: 2 additions & 1 deletion vim.d/45-visual-multi.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ let g:VM_custom_remaps = {'<c-p>': '[', '<c-s>': 'q'}
let g:VM_no_meta_mappings = 1
let g:VM_maps = {
\ 'Select All': '<C-A>',
\ }
\ "Add Cursor At Pos": '<C-Z>'
\ }

let g:VM_leader = "\\"

Expand Down

0 comments on commit efb6d64

Please sign in to comment.