diff options
Diffstat (limited to 'nvim-wrapper')
-rwxr-xr-x | nvim-wrapper | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nvim-wrapper b/nvim-wrapper index 18de932dc81c..df381352e4e1 100755 --- a/nvim-wrapper +++ b/nvim-wrapper @@ -8,7 +8,8 @@ import dbus session_bus = dbus.SessionBus() # launch the terminal server with a custom app-id and window class (so the .desktop file gets associated) -Popen("/usr/lib/gnome-terminal/gnome-terminal-server --app-id org.neovim --class=neovim".split()) +if not session_bus.name_has_owner('org.neovim'): + Popen("/usr/lib/gnome-terminal/gnome-terminal-server --app-id org.neovim --class=neovim".split()) # wait until the name is registered, or 2 seconds pass (when launching from cold cache it might more time) timeout = time() + 2 while not session_bus.name_has_owner('org.neovim') and time() <= timeout: |