Last active
December 13, 2025 01:22
-
-
Save disafronov/8516a65f7cc4a76ad3ecca246f20b689 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/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