diff --git a/.config/coc/extensions/package.json b/.config/coc/extensions/package.json index c6df7d72..6e184c88 100755 --- a/.config/coc/extensions/package.json +++ b/.config/coc/extensions/package.json @@ -4,10 +4,12 @@ "coc-eslint": ">=1.5.8", "coc-git": ">=2.5.1", "coc-go": ">=1.3.0", + "coc-grammarly": ">=0.0.2", "coc-java": ">=1.5.5", "coc-java-lombok": ">=1.0.0", "coc-json": ">=1.6.1", "coc-pairs": ">=1.3.2", + "coc-prettier": ">=9.3.1", "coc-pyright": ">=1.1.266", "coc-python": ">=1.2.12", "coc-sourcekit": ">=0.0.3", diff --git a/.gitignore_global b/.gitignore_global index 3e97b51c..d14bcb04 100644 --- a/.gitignore_global +++ b/.gitignore_global @@ -7,3 +7,4 @@ tags .ycm_extra_conf.pyc .agignore docs/tags +.idea diff --git a/.gitmodules b/.gitmodules index 72ac71c1..8c660c1e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,3 +6,6 @@ [submodule "git-diff-image"] path = git-diff-image url = https://github.com/ewanmellor/git-diff-image +[submodule "alacritty-themes/dracula"] + path = alacritty-themes/dracula + url = https://github.com/dracula/alacritty diff --git a/.zshrc b/.zshrc index 32c881d3..0be2c761 100644 --- a/.zshrc +++ b/.zshrc @@ -1267,6 +1267,7 @@ git-commit-smart() { git commit -s "${args[@]}" } +alias grt='git reset' alias gtc='go clean -testcache' alias wu='wg-quick up' alias wd='wg-quick down' diff --git a/alacritty-themes/dracula b/alacritty-themes/dracula new file mode 160000 index 00000000..77aff04b --- /dev/null +++ b/alacritty-themes/dracula @@ -0,0 +1 @@ +Subproject commit 77aff04b9f2651eac10e5cfa80a3d85ce43e7985 diff --git a/bin/autoxrandr b/bin/autoxrandr index 0ec575e1..fec285da 100755 --- a/bin/autoxrandr +++ b/bin/autoxrandr @@ -4,6 +4,8 @@ has() { xrandr -q | grep "^$1 connected" } +exclusive="$1" + profile=$(cat ~/.config/profile) if [[ "$profile" == "desktop" ]]; then CENTER=DP-0 diff --git a/bin/brb b/bin/brb new file mode 100755 index 00000000..5cd8897b --- /dev/null +++ b/bin/brb @@ -0,0 +1,3 @@ +#!/bin/bash + +exec discord-status idle "brb lunch" "🍕" diff --git a/bin/browser b/bin/browser index cf8b6786..799b6624 100755 --- a/bin/browser +++ b/bin/browser @@ -19,16 +19,6 @@ if [[ -e "${url}" ]]; then url="$(readlink -f "${url}")" fi -if [[ "$url" =~ "open.spotify.com" ]]; then - spotify_uri=$(grep -Po 'open.spotify.com/\K\w+/[^?]+' <<< "$url" | sed 's@/@:@') - exec dbus-send \ - --type=method_call \ - --dest=org.mpris.MediaPlayer2.spotify\ - /org/mpris/MediaPlayer2 \ - org.mpris.MediaPlayer2.Player.OpenUri \ - string:"spotify:$spotify_uri" -fi - browser="chromium" if [[ "$url" ]]; then diff --git a/bin/discord-status b/bin/discord-status new file mode 100755 index 00000000..7c831651 --- /dev/null +++ b/bin/discord-status @@ -0,0 +1,34 @@ +#!/bin/bash + +token=$(cat ~/.config/discord.token) + +:set-status() { + curl -X PATCH \ + -H 'Content-Type: application/json' \ + -H "authorization: $token" \ + --data '{"status": "'$1'"}' \ + https://discord.com/api/v9/users/@me/settings +} + +:custom-status() { + local status=$1 + local text=$2 + local emoji=$3 + + curl -X PATCH \ + -H 'Content-Type: application/json' \ + -H "authorization: $token" \ + --data '{"status": "'$status'", "custom_status": {"text": "'"$text"'", "emoji_name": "'"$emoji"'"}}' \ + https://discord.com/api/v9/users/@me/settings +} + +status="${1:-online}" +text="${2:-}" +emoji="${3:-}" + +if [[ ! "$text" ]]; then + :set-status "${status}" + exit 0 +fi + +:custom-status "${status}" "${text}" "${emoji}" diff --git a/bin/k8s-labels b/bin/k8s-labels new file mode 100755 index 00000000..3eece6b9 --- /dev/null +++ b/bin/k8s-labels @@ -0,0 +1,15 @@ +#!/bin/env python3 +# vim: ft=python ts=4 sw=4 et ai + +import sys +import re + +header_index = -1 +for line in sys.stdin: + chunks = re.split(r'\s+', line.strip()) + chunks = filter(lambda x: x.count(',') > 2, chunks) + if len(list(chunks)) == 0: + print(line, end='') + continue + + print(line, end='') diff --git a/bin/online b/bin/online new file mode 100755 index 00000000..d4689249 --- /dev/null +++ b/bin/online @@ -0,0 +1,3 @@ +#!/bin/bash + +exec discord-status online Available "⌨️" diff --git a/bin/wg-peer-status b/bin/wg-peer-status new file mode 100755 index 00000000..4f6dfe24 --- /dev/null +++ b/bin/wg-peer-status @@ -0,0 +1,9 @@ +#!/bin/bash + +peer="${1}" + +if sudo wg show all peers | grep -q "$peer"; then + echo " ${peer}" +else + echo " ${peer}" +fi diff --git a/bin/wg-status b/bin/wg-status index 30f808c0..cfa250f3 100755 --- a/bin/wg-status +++ b/bin/wg-status @@ -1,6 +1,6 @@ #!/bin/bash -peer=$(sudo wg show all peers | awk '{print $1}') +peer=$(sudo wg show all peers | awk '{print $1}' | paste -sd' ') if [[ ! "$peer" ]]; then echo ' insecure' else diff --git a/bin/xdg-open b/bin/xdg-open new file mode 100755 index 00000000..7b16e790 --- /dev/null +++ b/bin/xdg-open @@ -0,0 +1,17 @@ +#!/bin/bash + +[ -n "$_LOCK" ] || _LOCK=x exec flock -n $0 $0 "$@" + +url="$1" + +if [[ "$url" =~ "open.spotify.com" ]]; then + spotify_uri=$(grep -Po 'open.spotify.com/\K\w+/[^?]+' <<< "$url" | sed 's@/@:@') + exec dbus-send \ + --type=method_call \ + --dest=org.mpris.MediaPlayer2.spotify\ + /org/mpris/MediaPlayer2 \ + org.mpris.MediaPlayer2.Player.OpenUri \ + string:"spotify:$spotify_uri" +fi + +/bin/xdg-open "$url" diff --git a/vim.d/01-plugins.vim b/vim.d/01-plugins.vim index abab96e5..3dfe3b52 100644 --- a/vim.d/01-plugins.vim +++ b/vim.d/01-plugins.vim @@ -7,6 +7,7 @@ Plug 'scrooloose/nerdcommenter' Plug 'kovetskiy/vim-hacks' Plug 'kovetskiy/synta' Plug 'fatih/vim-go', {'for': ['template']} + "let g:go_def_mapping_enabled = 0 Plug 'vim-scripts/l9' Plug 'sirver/ultisnips', { 'frozen': 1 } Plug 'tpope/vim-surround' @@ -130,6 +131,8 @@ Plug 'HerringtonDarkholme/yats.vim' Plug 'MaxMEllon/vim-jsx-pretty' Plug 'github/copilot.vim' + imap