summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2019-10-07 13:21:27 +0200
committertoonn <toonn@toonn.io>2019-10-07 13:21:27 +0200
commit22a6f6d89db9d19277c44fde3752a9530277bd28 (patch)
tree7f22dd1c3bb51442c7e49d88f50030c0b24e02a8 /ranger
parent1032e55a1f21386cdd0bd7c5305cff5fbbf5092b (diff)
parent3098fd36cd717646e48768f6cdd48cd6f0167d80 (diff)
downloadranger-22a6f6d89db9d19277c44fde3752a9530277bd28.tar.gz
Merge branch 'swalladge-support-wayland'
Diffstat (limited to 'ranger')
-rw-r--r--ranger/config/rifle.conf2
-rw-r--r--ranger/core/runner.py2
-rwxr-xr-xranger/ext/rifle.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/ranger/config/rifle.conf b/ranger/config/rifle.conf
index f04d1031..c269cfc4 100644
--- a/ranger/config/rifle.conf
+++ b/ranger/config/rifle.conf
@@ -26,7 +26,7 @@
 #   directory      | $1 is a directory
 #   number <n>     | change the number of this command to n
 #   terminal       | stdin, stderr and stdout are connected to a terminal
-#   X              | $DISPLAY is not empty (i.e. Xorg runs)
+#   X              | A graphical environment is available (darwin, Xorg, or Wayland)
 #
 # There are also pseudo-conditions which have a "side effect":
 #   flag <flags>  | Change how the program is run. See below.
diff --git a/ranger/core/runner.py b/ranger/core/runner.py
index f38b026a..efb307da 100644
--- a/ranger/core/runner.py
+++ b/ranger/core/runner.py
@@ -214,7 +214,7 @@ class Runner(object):  # pylint: disable=too-few-public-methods
             toggle_ui = True
             context.wait = True
         if 't' in context.flags:
-            if 'DISPLAY' not in os.environ:
+            if not ('WAYLAND_DISPLAY' in os.environ or sys.platform == 'darwin' or 'DISPLAY' in os.environ):
                 return self._log("Can not run with 't' flag, no display found!")
             term = get_term()
             if isinstance(action, str):
diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py
index a55e14c7..cdf0d729 100755
--- a/ranger/ext/rifle.py
+++ b/ranger/ext/rifle.py
@@ -237,7 +237,7 @@ class Rifle(object):  # pylint: disable=too-many-instance-attributes
             self._app_flags = argument
             return True
         elif function == 'X':
-            return sys.platform == 'darwin' or 'DISPLAY' in os.environ
+            return 'WAYLAND_DISPLAY' in os.environ or sys.platform == 'darwin' or 'DISPLAY' in os.environ
         elif function == 'env':
             return bool(os.environ.get(argument))
         elif function == 'else':