Fix nvimremote for sway desktop

main
Ensar Sarajčić 2022-10-23 09:50:58 +02:00
parent 091e323694
commit f85fea99a0
1 changed files with 7 additions and 1 deletions

View File

@ -9,7 +9,13 @@ LINE=$4
COLUMN=$5 COLUMN=$5
if test -S $SERVER_NAME; then if test -S $SERVER_NAME; then
/usr/bin/wmctrl -a "$WINDOW_NAME" if [ "$XDG_SESSION_TYPE" = "x11" ]; then
/usr/bin/wmctrl -a "$WINDOW_NAME"
else
if [ "$XDG_SESSION_DESKTOP" = "sway" ]; then
swaymsg "[title=\"$WINDOW_NAME\"] focus"
fi
fi
~/.asdf/shims/nvim --server $SERVER_NAME --remote $2 ~/.asdf/shims/nvim --server $SERVER_NAME --remote $2
~/.asdf/shims/nvim --server $SERVER_NAME --remote-send ":call cursor($LINE, $COLUMN)<CR>" ~/.asdf/shims/nvim --server $SERVER_NAME --remote-send ":call cursor($LINE, $COLUMN)<CR>"
else else