-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get back to spotify, add git diff image, use grammarous instead of le…
…xical
- Loading branch information
Showing
10 changed files
with
66 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/home/operator/sources/gitlab.com/reconquest/wrap/wrap |
Submodule git-diff-image
added at
dee6a1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters