aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Morales2015-11-29 22:39:04 +0100
committerFelipe Morales2015-11-29 22:39:04 +0100
commit992b462d6348747d5f7a8209acde68c7b0dafbff (patch)
tree4e69997096c32e55ddd5b82b3816b974dabe2946
parentee13be8995e71fdc7ec9b72b98c5e3d8ba9fa1e9 (diff)
parent6fac2460b711b5f3a8aaa38b47c517b3e635565c (diff)
downloadaur-992b462d6348747d5f7a8209acde68c7b0dafbff.tar.gz
Merge pull request #9 from synaptiko/master
Possibility to passthrough command-line options for gnome-terminal
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD4
-rwxr-xr-xnvim-wrapper33
3 files changed, 34 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 294e4e61f940..49e0a6608000 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = neovim-gnome-terminal-wrapper
pkgdesc = A wrapper for running neovim in a separate instance of gnome-terminal
pkgver = 2
- pkgrel = 3
+ pkgrel = 4
url = http://github.com/fmoralesc/
arch = any
license = GPL
@@ -12,7 +12,7 @@ pkgbase = neovim-gnome-terminal-wrapper
source = nvim-wrapper
source = neovim.svg
md5sums = c5b9b5db24db814376b6925ce0f9ad52
- md5sums = 6a2aa98a447d3aa661e39c9b31c4aa7b
+ md5sums = cec92568d2f1cb5ea889bdc784c82a74
md5sums = 2b271742492f200bcac78dbfe33caa3c
pkgname = neovim-gnome-terminal-wrapper
diff --git a/PKGBUILD b/PKGBUILD
index b12efabccca0..fe539c4ddcc8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Felipe Morales <hel.sheep@gmail.com>
pkgname=neovim-gnome-terminal-wrapper
pkgver=2
-pkgrel=3
+pkgrel=4
pkgdesc="A wrapper for running neovim in a separate instance of gnome-terminal"
arch=(any)
url="http://github.com/fmoralesc/"
@@ -12,7 +12,7 @@ source=('neovim.desktop'
'nvim-wrapper'
'neovim.svg')
md5sums=('c5b9b5db24db814376b6925ce0f9ad52'
- '6a2aa98a447d3aa661e39c9b31c4aa7b'
+ 'cec92568d2f1cb5ea889bdc784c82a74'
'2b271742492f200bcac78dbfe33caa3c')
package() {
diff --git a/nvim-wrapper b/nvim-wrapper
index af4be8527b39..327803f25a3b 100755
--- a/nvim-wrapper
+++ b/nvim-wrapper
@@ -38,7 +38,30 @@ TERM_CMD = [
'-x',
'nvim',
]
+GTERM_PASSTHROUGH_OPTIONS = [
+ '--full-screen',
+ '--maximize',
+ '--profile',
+ '--working-directory',
+ '--display'
+]
+
+def processArgv():
+ argv = sys.argv[1:]
+ gtermOptions = []
+ nvimOptions = []
+
+ for arg in argv:
+ argParts = arg.split('=', 1)
+ if argParts[0] in GTERM_PASSTHROUGH_OPTIONS:
+ gtermOptions.append(arg)
+ else:
+ nvimOptions.append(arg)
+ return {
+ 'gterm': gtermOptions,
+ 'nvim': nvimOptions
+ }
def main():
"""Run nvim inside gnome-terminal"""
@@ -56,11 +79,15 @@ def main():
pass
# launch nvim in a gnome-terminal instance
if session_bus.name_has_owner(APP_ID):
+ options = processArgv()
+ cmd = [] + TERM_CMD[:-2] + options['gterm'] + TERM_CMD[-2:] + options['nvim']
env = os.environ.copy()
- env['NVIM_TUI_ENABLE_CURSOR_SHAPE'] = '1'
- env['NVIM_TUI_ENABLE_TRUE_COLOR'] = '1'
+ if 'NVIM_TUI_ENABLE_CURSOR_SHAPE' not in env:
+ env['NVIM_TUI_ENABLE_CURSOR_SHAPE'] = '1'
+ if 'NVIM_TUI_ENABLE_TRUE_COLOR' not in env:
+ env['NVIM_TUI_ENABLE_TRUE_COLOR'] = '1'
with open(os.devnull, 'wb') as fnull:
- subprocess.Popen(TERM_CMD + sys.argv[1:],
+ subprocess.Popen(cmd,
stdout=fnull,
stderr=fnull,
env=env)