aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/applications/window-managers/qtile/0002-Restore-PATH-and-PYTHONPATH.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/window-managers/qtile/0002-Restore-PATH-and-PYTHONPATH.patch')
-rw-r--r--nixpkgs/pkgs/applications/window-managers/qtile/0002-Restore-PATH-and-PYTHONPATH.patch31
1 files changed, 21 insertions, 10 deletions
diff --git a/nixpkgs/pkgs/applications/window-managers/qtile/0002-Restore-PATH-and-PYTHONPATH.patch b/nixpkgs/pkgs/applications/window-managers/qtile/0002-Restore-PATH-and-PYTHONPATH.patch
index a01f14062f1..1eaa5b84174 100644
--- a/nixpkgs/pkgs/applications/window-managers/qtile/0002-Restore-PATH-and-PYTHONPATH.patch
+++ b/nixpkgs/pkgs/applications/window-managers/qtile/0002-Restore-PATH-and-PYTHONPATH.patch
@@ -1,5 +1,5 @@
diff --git a/bin/qshell b/bin/qshell
-index 2ba7e61c..0ac2a2ef 100755
+index 5c652b7a..2d169eb2 100755
--- a/bin/qshell
+++ b/bin/qshell
@@ -28,5 +28,6 @@ base_dir = os.path.abspath(os.path.join(this_dir, ".."))
@@ -10,7 +10,7 @@ index 2ba7e61c..0ac2a2ef 100755
from libqtile.scripts import qshell
qshell.main()
diff --git a/bin/qtile b/bin/qtile
-index 3e82814d..335b5cea 100755
+index ebc8fab5..08a965ef 100755
--- a/bin/qtile
+++ b/bin/qtile
@@ -29,5 +29,6 @@ base_dir = os.path.abspath(os.path.join(this_dir, ".."))
@@ -20,8 +20,19 @@ index 3e82814d..335b5cea 100755
+ __import__("importlib").import_module("libqtile.utils").restore_os_environment()
from libqtile.scripts import qtile
qtile.main()
+diff --git a/bin/qtile-cmd b/bin/qtile-cmd
+index a2136ee6..3d37a6d9 100755
+--- a/bin/qtile-cmd
++++ b/bin/qtile-cmd
+@@ -8,5 +8,6 @@ base_dir = os.path.abspath(os.path.join(this_dir, ".."))
+ sys.path.insert(0, base_dir)
+
+ if __name__ == '__main__':
++ __import__("importlib").import_module("libqtile.utils").restore_os_environment()
+ from libqtile.scripts import qtile_cmd
+ qtile_cmd.main()
diff --git a/bin/qtile-run b/bin/qtile-run
-index e4b121be..1c203bc9 100755
+index ac4cb1fd..74c589cb 100755
--- a/bin/qtile-run
+++ b/bin/qtile-run
@@ -8,5 +8,6 @@ base_dir = os.path.abspath(os.path.join(this_dir, ".."))
@@ -32,7 +43,7 @@ index e4b121be..1c203bc9 100755
from libqtile.scripts import qtile_run
qtile_run.main()
diff --git a/bin/qtile-top b/bin/qtile-top
-index 5316e0e7..272c6430 100755
+index a6251f27..0d524b1d 100755
--- a/bin/qtile-top
+++ b/bin/qtile-top
@@ -8,5 +8,6 @@ base_dir = os.path.abspath(os.path.join(this_dir, ".."))
@@ -43,14 +54,13 @@ index 5316e0e7..272c6430 100755
from libqtile.scripts import qtile_top
qtile_top.main()
diff --git a/libqtile/utils.py b/libqtile/utils.py
-index 550ed02677e..1358a66f3df 100644
+index 2628c898..05117be7 100644
--- a/libqtile/utils.py
+++ b/libqtile/utils.py
-@@ -272,3 +272,11 @@ def safe_import(module_names, class_name, globals_, fallback=None):
- logger.debug("%s", traceback.format_exc())
- if fallback:
- globals_[class_name] = fallback(module_path, class_name, error)
-+
+@@ -270,3 +270,10 @@ def guess_terminal():
+ return terminal
+
+ logger.error('Default terminal has not been found.')
+
+def restore_os_environment():
+ pythonpath = os.environ.pop("QTILE_SAVED_PYTHONPATH", "")
@@ -58,3 +68,4 @@ index 550ed02677e..1358a66f3df 100644
+ path = os.environ.pop("QTILE_SAVED_PATH", None)
+ if path:
+ os.environ["PATH"] = path
+