diff --git a/config/bin/godot b/config/bin/godot new file mode 100755 index 0000000..9b32b4d --- /dev/null +++ b/config/bin/godot @@ -0,0 +1,56 @@ +#!/usr/bin/env zsh +# +# getting Godot + External vim working requires a little work... +# +# so this script shadows godot, and handles the spin-up of everything needed! +# +# After starting `godot`, connect to the `godot` tmux session (and DON'T close the vim over there) +# + +GODOT_EXECUTABLE=/usr/bin/godot +TMUX_SESSION=godot + +echo.helper() { + notify-send 'godot' "${@:2}" + echo "${@}\\033[0m" >&2 +} + +echo.info() { echo.helper "\\033[1;32m" "INFO : ${@}" >&2; } +echo.error() { echo.helper "\\033[1;31m" "ERROR : ${@}" >&2; return 1 } +echo.warning() { echo.helper "\\033[1;33m" "WARNING : ${@}" >&2; } + +tmux.has-session () { + tmux has-session -t "${TMUX_SESSION}" &>/dev/null +} + +tmux.has-session && { + echo.error "tmux session '${TMUX_SESSION}' already exists; refusing to start godot" + exit 1 +} + +tmux new-session -d -s "${TMUX_SESSION}" -n vim \ + 'sleep 3; while tmux list-windows -t godot -F "#{window_name}" | grep -q lsp-proxy; do vim; echo "vim closed, restarting..."; sleep 1; done' + +tmux new-window -t "${TMUX_SESSION}" -n lsp-proxy \ + 'while true; do ~/.wryn/config/bin/godot-lsp-proxy.py; echo "proxy died, restarting in 2s..."; sleep 2; done' + +tmux select-window -t "${TMUX_SESSION}:0" + +echo.info "godot editor session running on tmux '${TMUX_SESSION}'; connect with tmux.godot" + +"${GODOT_EXECUTABLE}" "$@" +GODOT_STATUS=$? + +# godot relaunches itself when opening a project; so we wait for all godot instances to fully exit +sleep 3 +while pgrep -x godot &>/dev/null; do sleep 3; done + +tmux kill-window -t "${TMUX_SESSION}:lsp-proxy" +tmux send-keys -t "${TMUX_SESSION}" Escape ':qa' Enter +sleep 3 + +tmux.has-session && { + echo.warning "tmux session '${TMUX_SESSION}' still exists; please connect, save, and close for next connection" +} + +exit ${GODOT_STATUS} diff --git a/config/bin/godot-lsp-proxy.py b/config/bin/godot-lsp-proxy.py new file mode 100755 index 0000000..c590e09 --- /dev/null +++ b/config/bin/godot-lsp-proxy.py @@ -0,0 +1,184 @@ +#!/usr/bin/env python3 +# +# godot-lsp-proxy +# +# TCP proxy that sits between vim (YCM) and Godot's built-in GDScript +# language server, rewriting malformed file URIs on the fly. +# +# THE PROBLEM +# +# YCM (ycmd) sends LSP document URIs without any slash in protocol: +# +# file:/home/user/project/script.gd +# ^^^^^ +# prefix 'file:' +# +# The LSP spec (RFC 3986) requires two slashes after protocol: +# +# file:///home/user/project/script.gd +# ^^^^^^^ +# prefix 'file://' +# +# Most language servers are lenient about this, but Godot 4.5+ is +# strict and rejects single-slash URIs with: +# +# ERROR: LSP: The language server only supports the file protocol +# +# This causes the LSP handshake to fail and Godot drops the +# connection. YCM then reports "godotCompleter not running" and you +# get zero autocompletion, jump-to-definition, or diagnostics. +# +# As of 2025-04, there is no config on either side to fix this: +# - YCM has no setting to control URI format +# - Godot has no setting to relax URI validation +# +# THE FIX +# +# This proxy listens on a local port (default 6015), and for every +# LSP message FROM the editor TO Godot, rewrites: +# +# "file:/home/... -> "file:///home/... +# +# Messages are parsed as proper LSP (Content-Length header + JSON +# body), so the Content-Length is recalculated after rewriting to +# keep the protocol valid. +# +# Messages from Godot back to the editor are passed through +# unmodified (Godot sends correct triple-slash URIs). +# +# USAGE +# +# godot-lsp-proxy [listen_port] [godot_port] +# +# defaults: listen on 6015, forward to 6005 +# +# Point YCM at the proxy port (6015) instead of Godot's port (6005) +# in your vim config: +# +# let g:ycm_language_server += [ +# \ { 'name': 'godot', +# \ 'filetypes': ['gdscript'], +# \ 'project_root_files': ['project.godot'], +# \ 'port': 6015 } +# \ ] +# +# REMOVAL +# +# When YCM or Godot fixes the URI handling on their end, delete +# this script and point YCM back at port 6005 directly. +# +import socket +import threading +import re +import sys + +LISTEN_PORT = int(sys.argv[1]) if len(sys.argv) > 1 else 6015 +GODOT_PORT = int(sys.argv[2]) if len(sys.argv) > 2 else 6005 + + +def fix_uri(data: bytes) -> bytes: + return re.sub(rb'"file:/([^/])', rb'"file:///\1', data) + + +def read_message(sock): + header = b'' + while b'\r\n\r\n' not in header: + chunk = sock.recv(1) + if not chunk: + return None + header += chunk + + match = re.search(rb'Content-Length: (\d+)', header) + if not match: + return None + length = int(match.group(1)) + + body = b'' + while len(body) < length: + chunk = sock.recv(length - len(body)) + if not chunk: + return None + body += chunk + + return body + + +def send_message(sock, body: bytes): + header = f'Content-Length: {len(body)}\r\n\r\n'.encode() + sock.sendall(header + body) + + +def relay(src, dst, label='', transform=None): + try: + while True: + body = read_message(src) + if body is None: + break + if transform: + body = transform(body) + send_message(dst, body) + except Exception as e: + print(f' [{label}] connection closed ({e})') + finally: + try: + src.close() + except Exception: + pass + try: + dst.close() + except Exception: + pass + print(f' [{label}] relay stopped') + + +def print_banner(): + print() + print(' godot-lsp-proxy') + print(' ===============') + print() + print(' Workaround for YCM sending malformed file URIs to Godot.') + print() + print(f' vim (YCM) -> :{LISTEN_PORT} [rewrite file: -> file://] -> :{GODOT_PORT} (Godot LSP)') + print(f' vim (YCM) <- :{LISTEN_PORT} [passthrough] <- :{GODOT_PORT} (Godot LSP)') + print() + print(' Waiting for YCM to connect...') + print() + + +def main(): + server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + server.bind(('127.0.0.1', LISTEN_PORT)) + server.listen(1) + + print_banner() + + while True: + client, addr = server.accept() + print(f' YCM connected from {addr[0]}:{addr[1]}') + + try: + godot = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + godot.connect(('127.0.0.1', GODOT_PORT)) + print(f' Connected to Godot LSP on :{GODOT_PORT}') + print(' Proxying LSP messages (ctrl-c to stop)') + print() + except ConnectionRefusedError: + print(f' ERROR: Godot LSP not available on :{GODOT_PORT}') + print(f' Is Godot running with the project open?') + print() + client.close() + continue + + threading.Thread( + target=relay, args=(client, godot, 'ycm->godot', fix_uri), + daemon=True, + ).start() + threading.Thread( + target=relay, args=(godot, client, 'godot->ycm'), + daemon=True, + ).start() + + +if __name__ == '__main__': + main() diff --git a/config/bin/i3-utils b/config/bin/i3-utils index 3d0dc15..64ce6b1 100755 --- a/config/bin/i3-utils +++ b/config/bin/i3-utils @@ -44,24 +44,30 @@ case $1 in local PROGRAM local ARGS=() case $2 in - messages ) PROGRAM=slack ARGS+=(-c Slack --has-statusbar-icon) ;; - voice ) PROGRAM=google-voice-desktop ;; - ytmusic ) PROGRAM=youtube-music-desktop-app ARGS+=(-c '"YouTube Music Desktop App"' --has-statusbar-icon) ;; + ( messages ) PROGRAM=slack ARGS+=(-c slack --has-statusbar-icon) ;; + ( voice ) PROGRAM=google-voice-desktop ;; + ( ytmusic ) PROGRAM=youtube-music-desktop-app ARGS+=(-c '"YouTube Music Desktop App"' --has-statusbar-icon) ;; + ( signal ) PROGRAM=signal ;; - 1pass ) PROGRAM=1password ARGS+=(-c 1Password) ;; - discord ) PROGRAM=discord ARGS+=(--has-statusbar-icon) ;; - obs ) PROGRAM=obs ARGS+=(-c '^obs' -n -l --has-statusbar-icon) ;; - pavuctrl ) PROGRAM=pavucontrol ARGS+=(-s 0.5 -c '^Pavucontrol') ;; - scrcpy ) PROGRAM=scrcpy ARGS+=(-n -l) ;; - spotify ) PROGRAM=youtube-music-desktop-app ARGS+=(-c '"YouTube Music Desktop App"' --has-statusbar-icon) ;; + ( 1pass ) PROGRAM=1password ARGS+=(-c 1Password) ;; + ( discord ) PROGRAM=fluxer ARGS+=(-c Fluxer) ;; + ( obs ) PROGRAM=obs ARGS+=(-c '^obs' -n -l --has-statusbar-icon) ;; + ( pavuctrl ) PROGRAM=pavucontrol ARGS+=(-s 0.5 -c '^Pavucontrol') ;; + ( scrcpy ) PROGRAM=scrcpy ARGS+=(-n -l) ;; + ( spotify ) PROGRAM=youtube-music-desktop-app ARGS+=(-c '"YouTube Music Desktop App"' --has-statusbar-icon) ;; - * ) PROGRAM=$2 ;; + ( * ) PROGRAM=$2 ;; esac scwrypts i3 launch or show -- $PROGRAM ${ARGS[@]} ;; ( screenshot ) command -v flameshot || notify-send "I3 UTILS" "screenshot application 'flameshot' not available" - flameshot gui + + # v13 and below + #flameshot gui + + # v14 complicated af + flameshot screen --edit --number "$(xdotool getmouselocation | sed 's/^.*screen:\([0-9]\+\) .*$/\1/')" ;; esac diff --git a/config/colorschemes/active/default.yaml b/config/colorschemes/active/default.yaml index d36e768..ce6e819 100644 --- a/config/colorschemes/active/default.yaml +++ b/config/colorschemes/active/default.yaml @@ -1,4 +1,5 @@ ---- # yamllint disable rule:colons +--- +# yamllint disable rule:colons ansi: red: regular: .material.base.error diff --git a/config/i3.conf b/config/i3.conf index 3adea3e..a310c97 100644 --- a/config/i3.conf +++ b/config/i3.conf @@ -34,7 +34,7 @@ bindsym $mod+Shift+m $UTILS launch messages bindsym $mod+Shift+d $UTILS launch discord bindsym $mod+c $UTILS launch voice bindsym $mod+m $UTILS launch ytmusic -bindsym $mod+Shift+s $UTILS launch spotify +bindsym $mod+Shift+s $UTILS launch signal bindsym $mod+a $UTILS launch pavuctrl bindsym $mod+Shift+p $UTILS launch scrcpy bindsym $mod+Shift+o $UTILS launch obs diff --git a/config/i3.config.yaml b/config/i3.config.yaml index a927b84..ad56049 100644 --- a/config/i3.config.yaml +++ b/config/i3.config.yaml @@ -1,4 +1,5 @@ ---- # used by scwrypts i3 generate config (override at ~/.config/i3/local.yaml) +--- +# used by scwrypts i3 generate config (override at ~/.config/i3/local.yaml) font: size: 14 family: >- diff --git a/config/local/altaria/bin/beeg-game b/config/local/altaria/bin/beeg-game index 4ad8b1f..36c8f37 100755 --- a/config/local/altaria/bin/beeg-game +++ b/config/local/altaria/bin/beeg-game @@ -2,8 +2,9 @@ [ $1 ] && RESOLUTION=$1 || RESOLUTION=4k source ${0:a:h}/xorg.zsh ${RESOLUTION} ${@:2} -#DISABLE+=(splitter) +DISABLE+=(splitter) DISABLE+=(desk) +#DISABLE+=(zapdos) XRANDR_OFF ${DISABLE[@]} diff --git a/config/local/altaria/bin/default b/config/local/altaria/bin/default index 8c46c34..5c6dc7b 100755 --- a/config/local/altaria/bin/default +++ b/config/local/altaria/bin/default @@ -1,6 +1,6 @@ #!/bin/zsh -[ $1 ] && RESOLUTION=$1 || RESOLUTION=2k -source ${0:a:h}/xorg.zsh ${RESOLUTION} ${@:2} +[[ "${1}" ]] && RESOLUTION="${1}" || RESOLUTION=4k +source "${0:a:h}/xorg.zsh" "${RESOLUTION}" "${@:2}" case $MONITOR_CONFIGURATION in ( home ) @@ -12,7 +12,7 @@ case $MONITOR_CONFIGURATION in --sound-effect login \ --background ${I3_DEFAULT_THEME_BACKGROUND} \ ${XRANDR_ARGS__desk[@]} --pos 0x0 --primary \ - ${XRANDR_ARGS__splitter[@]} --pos 0x0 \ + ${XRANDR_ARGS__zapdos[@]} --pos 0x0 \ ;; ( unknown ) diff --git a/config/local/altaria/bin/emergency-screen b/config/local/altaria/bin/emergency-screen new file mode 100755 index 0000000..a2efa4b --- /dev/null +++ b/config/local/altaria/bin/emergency-screen @@ -0,0 +1,13 @@ +#!/bin/zsh +[ $1 ] && RESOLUTION=$1 || RESOLUTION=4k +source ${0:a:h}/xorg.zsh ${RESOLUTION} ${@:2} + +[[ "${XRANDR_OUTPUT__server_rack}" ]] || { + echo "sorry; can't find server rack screen" + exit 1 +} + +case "$(xrandr | grep "^${XRANDR_OUTPUT__server_rack} connected [0-9]")" in + ( *connected* ) xrandr --output "${XRANDR_OUTPUT__server_rack}" --off ;; + ( * ) xrandr --output "${XRANDR_OUTPUT__server_rack}" --auto ;; +esac diff --git a/config/local/altaria/bin/smol-game b/config/local/altaria/bin/smol-game index 7aa1ab4..f97103f 100755 --- a/config/local/altaria/bin/smol-game +++ b/config/local/altaria/bin/smol-game @@ -2,13 +2,8 @@ [ $1 ] && RESOLUTION=$1 || RESOLUTION=4k source ${0:a:h}/xorg.zsh ${RESOLUTION} ${@:2} -DISABLE+=(splitter) -#DISABLE+=(desk) - -XRANDR_OFF ${DISABLE[@]} - XRANDR_SET \ - --compositing enable \ + --compositing disable \ --screen-blank disable \ --sound-effect gamedock \ ${XRANDR_ARGS__desk[@]} --pos 0x0 --primary \ diff --git a/config/local/altaria/bin/xorg.zsh b/config/local/altaria/bin/xorg.zsh index b1a3c23..5293351 100644 --- a/config/local/altaria/bin/xorg.zsh +++ b/config/local/altaria/bin/xorg.zsh @@ -1,8 +1,36 @@ #!/bin/zsh ##################################################################### -XRANDR_OUTPUT__splitter='HDMI-0' -XRANDR_OUTPUT__desk='DP-4' +graphics_cards_detected="$(xrandr | sed -n 's/\(DP-[0-9]-\).*$/\1/p' | sort -u | wc -l)" + +case "${graphics_cards_detected}" in + ( 1 ) # sometimes the graphics card on the motherboard is detected and becomes primary + XRANDR_OUTPUT__splitter='HDMI-1-0' + XRANDR_OUTPUT__desk='unknown -> probably wont come up but future me needs to put this in manually' + XRANDR_OUTPUT__house='DP-1-4' + XRANDR_OUTPUT__zapdos='DP-1-0' + XRANDR_OUTPUT__server_rack='HDMI2' + ;; + + ( 0 | * ) # default: just the dedicated graphics card detected + XRANDR_OUTPUT__splitter='HDMI-0' + XRANDR_OUTPUT__desk='DP-2' + XRANDR_OUTPUT__zapdos='DP-0' + XRANDR_OUTPUT__server_rack='DP-4' + ;; +esac + +XRANDR_OUTPUTS=() +for XRANDR_OUTPUT in \ + splitter \ + desk \ + zapdos \ + server_rack \ + ; +do + XRANDR_OUTPUT_var=XRANDR_OUTPUT__${XRANDR_OUTPUT} + XRANDR_OUTPUTS+=("${(P)XRANDR_OUTPUT_var}") +done I3_DEFAULT_THEME_BACKGROUND=$(scwrypts -n get theme).png @@ -12,7 +40,7 @@ MONITOR_CONFIGURATION=unknown && xrandr --query | grep -q "^${XRANDR_OUTPUT__splitter} connected" \ && MONITOR_CONFIGURATION=home \ ; - #&& xrandr --query | grep -q "^${XRANDR_OUTPUT__desk} connected" \ + #&& xrandr --query | grep -q "^${XRANDR_OUTPUT__house} connected" \ ##################################################################### @@ -24,17 +52,20 @@ case $1 in EXTRA_ARGS__splitter=() EXTRA_ARGS__desk=() + EXTRA_ARGS__house=() + EXTRA_ARGS__zapdos=() I3_BACKGROUND=link-vs-gdizz.jpg ;; - ( 1440 | 1440p | 2k ) + ( 1440 | 1440p | 2k | guild-wars-2 ) XRANDR_MODE=(--mode 2560x1440) XRANDR_OFFSET_X=2560 XRANDR_OFFSET_Y=1440 - EXTRA_ARGS__splitter=(--rate 120.00) - EXTRA_ARGS__desk=(--rate 120.00) + EXTRA_ARGS__splitter=() + EXTRA_ARGS__desk=() + EXTRA_ARGS__zapdos=(--rate 120.00) I3_BACKGROUND=roy-art.jpg ;; @@ -44,12 +75,22 @@ case $1 in XRANDR_OFFSET_X=3840 XRANDR_OFFSET_Y=2160 - EXTRA_ARGS__splitter=(--rate 120.00) - EXTRA_ARGS__desk=(--rate 120.00) + EXTRA_ARGS__splitter=(--rate 119.88) + EXTRA_ARGS__desk=(--rate 119.88) # make it match + EXTRA_ARGS__house=() + #EXTRA_ARGS__zapdos=(--rate 143.99) # I thought this was a bad cable... apparently this is a MANUFACTURERS error -> they messed up the OS software and I'm big mad at LG I3_BACKGROUND=${I3_DEFAULT_THEME_BACKGROUND[@]} ;; + ( max ) # use only for desk gaming + XRANDR_MODE=(--mode 3840x2160) + XRANDR_OFFSET_X=3840 + XRANDR_OFFSET_Y=2160 + + EXTRA_ARGS__desk=(--rate 239.99) + ;; + ( * ) echo "error : unknown resolution '$1'" exit 1 @@ -58,7 +99,9 @@ esac XRANDR_ARGS__splitter=(--output ${XRANDR_OUTPUT__splitter[@]} ${XRANDR_MODE[@]} ${EXTRA_ARGS__splitter[@]}) -XRANDR_ARGS__desk=(--output ${XRANDR_OUTPUT__desk[@]} ${XRANDR_MODE[@]} ${EXTRA_ARGS__desk[@]}) +XRANDR_ARGS__desk=(--output ${XRANDR_OUTPUT__desk[@]} ${XRANDR_MODE[@]} ${EXTRA_ARGS__desk}) +XRANDR_ARGS__house=(--output ${XRANDR_OUTPUT__house[@]} ${XRANDR_MODE[@]} ${EXTRA_ARGS__house[@]}) +XRANDR_ARGS__zapdos=(--output ${XRANDR_OUTPUT__zapdos[@]} ${XRANDR_MODE[@]} ${EXTRA_ARGS__zapdos[@]}) ########################################## @@ -67,17 +110,6 @@ export DISPLAY=:0 ############################################################################### -XRANDR_OFF() { - local MONITOR ARGS=() - for MONITOR in $@ - do - MONITOR="XRANDR_OUTPUT__${MONITOR}" - ARGS+=(--output ${(P)MONITOR} --off) - done - - xrandr ${ARGS[@]} -} - XRANDR_SET() { local ERRORS=0 @@ -87,6 +119,8 @@ XRANDR_SET() { local SOUND_EFFECT=login local XRANDR_ARGS=() + local enable_server_rack=false + while [[ $# -gt 0 ]] do case $1 in @@ -95,22 +129,44 @@ XRANDR_SET() { ( --background ) BACKGROUND="$2" ; shift 1 ;; ( --sound-effect ) SOUND_EFFECT="$2" ; shift 1 ;; + ( --server-rack ) enabled_server_rack=true ;; + ( * ) XRANDR_ARGS+=($1) ; esac shift 1 done - case ${COMPOSITING} in + local xrandr_output xrandr_output_should_turn_off + for xrandr_output in "${XRANDR_OUTPUTS[@]}" + do + [[ "${XRANDR_ARGS[(re)${xrandr_output}]}" == "${xrandr_output}" ]] \ + && xrandr_output_should_turn_off=false \ + || xrandr_output_should_turn_off=true \ + ; + + [[ "${xrandr_output_should_turn_off}" == true ]] \ + && XRANDR_ARGS+=(--output "${xrandr_output}" --off) + done + + if [[ "${XRANDR_OUTPUT__server_rack}" ]] + then + case "${enable_server_rack}" in + ( true ) XRANDR_ARGS+=(--output "${XRANDR_OUTPUT__server_rack}" --auto) ;; + ( false ) XRANDR_ARGS+=(--output "${XRANDR_OUTPUT__server_rack}" --off) ;; + esac + fi + + case "${COMPOSITING}" in ( enable ) (pkill compton; sleep 1; compton;) & ;; ( disable ) pkill compton ;; - * ) + ( * ) echo "ERROR : invalid setting '${COMPOSITING}' for compositing" >&2 return 1 esac - case ${SCREEN_BLANK} in - enable | disable ) ;; - * ) + case "${SCREEN_BLANK}" in + ( enable | disable ) ;; + ( * ) echo "ERROR : invalid setting '${SCREEN_BLANK}' for screen blank" >&2 return 1 esac diff --git a/config/scwrypts/config.zsh b/config/scwrypts/config.zsh index 5eeb321..ec464bc 100644 --- a/config/scwrypts/config.zsh +++ b/config/scwrypts/config.zsh @@ -12,6 +12,7 @@ SCWRYPTS_GENERATOR__SHOW_HELP=false [ ${DOTWRYN} ] || source "${HOME}/.zshrc" SCWRYPTS_GROUP_DIRS+=( "${DOTWRYN}/scwrypts" + "${XDG_DATA_HOME:-${HOME}/.local/share}/project-source-code/gizmos" "${XDG_DATA_HOME:-${HOME}/.local/share}/project-source-code/yage/home" "${XDG_DATA_HOME:-${HOME}/.local/share}/project-source-code/yage/ttf-pokemoji" ) diff --git a/config/user/code-activator-zsh/settings.zsh b/config/user/code-activator-zsh/settings.zsh index 0026c04..1ac4712 100644 Binary files a/config/user/code-activator-zsh/settings.zsh and b/config/user/code-activator-zsh/settings.zsh differ diff --git a/config/user/compton/compton.conf b/config/user/compton/compton.conf index df9830a..cba984b 100644 --- a/config/user/compton/compton.conf +++ b/config/user/compton/compton.conf @@ -59,9 +59,7 @@ mark-ovredir-focused = true; use-ewmh-active-win = true; detect-rounded-corners = true; detect-client-opacity = true; -refresh-rate = 0; dbe = false; -glx-no-stencil = true; glx-copy-from-front = false; unredir-if-possible = false; focus-exclude = [ diff --git a/config/user/flameshot/flameshot.ini b/config/user/flameshot/flameshot.ini index be84e60..445925e 100644 --- a/config/user/flameshot/flameshot.ini +++ b/config/user/flameshot/flameshot.ini @@ -2,18 +2,19 @@ contrastOpacity=188 contrastUiColor=#11bb98 disabledTrayIcon=false -drawColor=#d11455 -drawFontSize=13 +drawColor=#aa44ff +drawFontSize=24 drawMarkerSize=18 -drawThickness=4 +drawThickness=8 filenamePattern=%Y-%m-%d_%I%H.SCREENSHOT saveAsFileExtension=png -savePath=/home/w0ryn/Pictures/screenshot +savePath=/home/w0ryn/Pictures/Screenshots showSidePanelButton=false showStartupLaunchMessage=false uiColor=#490099 undoLimit=100 uploadClientSecret= +useX11LegacyScreenshot=true userColors=picker, #aa44ff, #6911aa, #220069, #44dddd, #00aa79, #006922, #c80064, #ff44ff, #d0f0f0 [Shortcuts] diff --git a/config/user/systemd/user/i3-session.target b/config/user/systemd/user/i3-session.target new file mode 100644 index 0000000..83ee812 --- /dev/null +++ b/config/user/systemd/user/i3-session.target @@ -0,0 +1,5 @@ +[Unit] +Description=i3 session +BindsTo=graphical-session.target +Wants=graphical-session-pre.target +After=graphical-session-pre.target diff --git a/config/user/xdg-desktop-portal/portals.conf b/config/user/xdg-desktop-portal/portals.conf new file mode 100644 index 0000000..80d1469 --- /dev/null +++ b/config/user/xdg-desktop-portal/portals.conf @@ -0,0 +1,2 @@ +[preferred] +default=gtk diff --git a/config/xinitrc.i3wm b/config/xinitrc.i3wm index 9fc2ad4..43ec976 100644 --- a/config/xinitrc.i3wm +++ b/config/xinitrc.i3wm @@ -1,5 +1,12 @@ #!/bin/zsh source "${DOTWRYN}/config/xinitrc.common" -export DESKTOP_SESSION=i3wm -cd; exec i3 +export DESKTOP_SESSION=i3 +export XDG_CURRENT_DESKTOP=i3 + +dbus-update-activation-environment --systemd DISPLAY XAUTHORTIY XDG_CURRENT_DESKTOP +systemctl --user import-environment DISPLAY XAUTHORTIY XDG_CURRENT_DESKTOP + +systemctl --user start i3-session.target +cd; i3 +systemctl --user stop i3-session.target diff --git a/setup/os-dependencies/arch.txt b/setup/os-dependencies/arch.txt index bff9552..83d7f25 100644 --- a/setup/os-dependencies/arch.txt +++ b/setup/os-dependencies/arch.txt @@ -40,6 +40,7 @@ python-pip python-pylint python-rtmidi python-virtualenv +rage-encryption ripgrep rofi rustup diff --git a/vim/rc.d/00.plugin-vundle.vim b/vim/rc.d/00.plugin-vundle.vim index a1cee08..b2572ed 100644 --- a/vim/rc.d/00.plugin-vundle.vim +++ b/vim/rc.d/00.plugin-vundle.vim @@ -25,6 +25,7 @@ call vundle#begin("$VIM_PLUGIN_DIR") Plugin 'rrethy/vim-hexokinase' " 09.plugin-vim-hexokinase.vim Plugin 'fatih/vim-go' " 10.plugin-vim-go.vim Plugin 'rust-lang/rust.vim' " 11.plugin-rust.vim + Plugin 'habamax/vim-godot' " 12.plugin-vim-godot.vim " --------------------------------------------------------------------- call vundle#end() diff --git a/vim/rc.d/01.plugin-youcompleteme.vim b/vim/rc.d/01.plugin-youcompleteme.vim index 1dd9c92..a7ae516 100644 --- a/vim/rc.d/01.plugin-youcompleteme.vim +++ b/vim/rc.d/01.plugin-youcompleteme.vim @@ -1,5 +1,8 @@ if g:plugins_ok != 1 | finish | endif " ------------------------------------------------------------------- +if !has_key( g:, 'ycm_language_server' ) + let g:ycm_language_server = [] +endif let g:ycm_autoclose_preview_window_after_insertion = 1 let g:ycm_goto_buffer_command = 'new-tab' diff --git a/vim/rc.d/12.plugin-vim-godot.vim b/vim/rc.d/12.plugin-vim-godot.vim new file mode 100644 index 0000000..23dffec --- /dev/null +++ b/vim/rc.d/12.plugin-vim-godot.vim @@ -0,0 +1,53 @@ +if g:plugins_ok != 1 | finish | endif +" ------------------------------------------------------------------- + +" --- language server ---------------------- + +" note: YCM is pointing at 6015 instead of 6005; see ../../config/bin/godot-lsp-proxy.py +let g:ycm_language_server += [ + \ { + \ 'name': 'godot', + \ 'filetypes': [ 'gdscript' ], + \ 'project_root_files': [ 'project.godot' ], + \ 'port': 6015, + \ } + \ ] + +" --- linter (gdlint) ---------------------- + +let g:ale_linters['gdscript'] = ['gdlint'] + +function! GdlintHandle(buffer, lines) abort + let l:pattern = '\v^[^:]+:(\d+): (Error|Warning): (.+) \(([^)]+)\)$' + let l:output = [] + + for l:match in ale#util#GetMatches(a:lines, l:pattern) + call add(l:output, { + \ 'lnum': l:match[1] + 0, + \ 'type': l:match[2] ==# 'Error' ? 'E' : 'W', + \ 'text': l:match[3] . ' [' . l:match[4] . ']', + \}) + endfor + + return l:output +endfunction + +call ale#linter#Define('gdscript', { + \ 'name': 'gdlint', + \ 'executable': 'gdlint', + \ 'cwd': '%s:h', + \ 'command': 'gdlint %s', + \ 'callback': function('GdlintHandle'), + \ 'output_stream': 'stderr', + \}) + + +" --- formatter (gdformat) ----------------- + +function! GdformatFix(buffer) abort + return { 'command': 'gdformat -' } +endfunction + +let g:ale_fixers['gdscript'] = [function('GdformatFix')] + +call ale#Set('gdscript_gdformat_executable', 'gdformat') diff --git a/vim/rc.d/41.file-formatting.vim b/vim/rc.d/41.file-formatting.vim index 100398c..c5995d9 100644 --- a/vim/rc.d/41.file-formatting.vim +++ b/vim/rc.d/41.file-formatting.vim @@ -56,9 +56,10 @@ augroup filetype_specific_formatting autocmd FileType go call FormatFileType(4, v:false, 'manual', 99, v:false) autocmd FileType json call FormatFileType(2, v:false, 'indent', 99, v:false) autocmd FileType smarty call FormatFileType(2, v:true, 'indent', 99, v:false) + autocmd FileType gdscript call FormatFileType(8, v:false, 'indent', 99, v:false) augroup end -let g:markdown_fenced_languages = ['javascript', 'json', 'python', 'bash', 'yaml', 'shell=zsh', 'sql'] +let g:markdown_fenced_languages = ['javascript', 'json', 'python', 'bash', 'yaml', 'shell=zsh', 'sql', 'gdscript'] " }}} syntax on diff --git a/zsh/plugins/fzf-tab b/zsh/plugins/fzf-tab index 7fed01a..24105b1 160000 --- a/zsh/plugins/fzf-tab +++ b/zsh/plugins/fzf-tab @@ -1 +1 @@ -Subproject commit 7fed01afba9392b6392408b9a0cf888522ed7a10 +Subproject commit 24105b15714bfec37989ed5c5b6e60f572253019 diff --git a/zsh/rc.d/30.utils-dd.zsh b/zsh/rc.d/30.utils-dd.zsh new file mode 100644 index 0000000..3f76cbd --- /dev/null +++ b/zsh/rc.d/30.utils-dd.zsh @@ -0,0 +1,47 @@ +command -v dd &>/dev/null || return 0 + +utils.dd() { + local ARGS=() + + # "byte size" dd default is 512-bytes, but 4M is modern sweet spot + local bs=4M + + # show the progress bar (I can never remember to include this) + local status=progress + + # By default, dd goes through kernel write cache which means dd could + # report "Done" but the kernel is still flushing data to the USB in + # the background. Disconnecting the USB drive at that point will + # corrupt the image + # + # synchronous mosde is slower, but forces each write to hit the + # physical device before dd moves on to the next block + # + # tl;dr "synchronous" mode = Done means Done + local oflag=sync + + local _S + while [[ ${#} -gt 0 ]] + do + _S=1 + case ${1} in + ( bs=* ) bs='' ; ARGS+=(${1}) ;; + ( status=* ) status='' ; ARGS+=(${1}) ;; + ( oflag=* ) oflag='' ; ARGS+=(${1}) ;; + ( * ) ARGS+=(${1}) ;; + esac + + shift ${_S} || { + echo "ERROR missing argument for '${1}'" + return 1 + } + done + + local my_default + for my_default in bs status oflag + do + [ "${(P)my_default}" ] && ARGS+=("${my_default}=${(P)my_default}") + done + + dd ${ARGS[@]} +}