Skip to content

Instantly share code, notes, and snippets.

@disafronov
Last active December 13, 2025 01:22
Show Gist options
  • Select an option

  • Save disafronov/8516a65f7cc4a76ad3ecca246f20b689 to your computer and use it in GitHub Desktop.

Select an option

Save disafronov/8516a65f7cc4a76ad3ecca246f20b689 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
NEOVIDE="neovide.real"
SOCKET="${XDG_RUNTIME_DIR:-/tmp}/neovide"
if [ -S "$SOCKET" ]; then
# Если есть аргументы — открываем их в существующем Neovim
if [ "$#" -gt 0 ]; then
nvim --server "$SOCKET" --remote-tab "$@"
# Поднимаем только окно Neovide (точный WM_CLASS)
if command -v wmctrl >/dev/null 2>&1; then
WIN_ID=$(wmctrl -lx | awk '$3=="neovide.neovide" {print $1}' | head -n1)
[ -n "$WIN_ID" ] && wmctrl -ia "$WIN_ID"
fi
fi
else
# Первый запуск → создаём сервер внутри Neovide
"$NEOVIDE" "$@" -- --listen "$SOCKET"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment