2018-01-31 19:58:52 +01:00
|
|
|
diff --git a/bin/qshell b/bin/qshell
|
2020-07-25 17:51:57 +02:00
|
|
|
index 5c652b7a..2d169eb2 100755
|
2018-01-31 19:58:52 +01:00
|
|
|
--- a/bin/qshell
|
|
|
|
+++ b/bin/qshell
|
|
|
|
@@ -28,5 +28,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 qshell
|
|
|
|
qshell.main()
|
2015-12-01 12:46:18 +01:00
|
|
|
diff --git a/bin/qtile b/bin/qtile
|
2020-07-25 17:51:57 +02:00
|
|
|
index ebc8fab5..08a965ef 100755
|
2015-12-01 12:46:18 +01:00
|
|
|
--- a/bin/qtile
|
|
|
|
+++ b/bin/qtile
|
2018-01-31 19:58:52 +01:00
|
|
|
@@ -29,5 +29,6 @@ base_dir = os.path.abspath(os.path.join(this_dir, ".."))
|
|
|
|
sys.path.insert(0, base_dir)
|
2015-12-01 12:46:18 +01:00
|
|
|
|
2018-01-31 19:58:52 +01:00
|
|
|
if __name__ == '__main__':
|
2015-12-01 12:46:18 +01:00
|
|
|
+ __import__("importlib").import_module("libqtile.utils").restore_os_environment()
|
2018-01-31 19:58:52 +01:00
|
|
|
from libqtile.scripts import qtile
|
|
|
|
qtile.main()
|
2020-07-25 17:51:57 +02:00
|
|
|
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()
|
2015-12-01 12:46:18 +01:00
|
|
|
diff --git a/bin/qtile-run b/bin/qtile-run
|
2020-07-25 17:51:57 +02:00
|
|
|
index ac4cb1fd..74c589cb 100755
|
2015-12-01 12:46:18 +01:00
|
|
|
--- a/bin/qtile-run
|
|
|
|
+++ b/bin/qtile-run
|
2018-01-31 19:58:52 +01:00
|
|
|
@@ -8,5 +8,6 @@ base_dir = os.path.abspath(os.path.join(this_dir, ".."))
|
|
|
|
sys.path.insert(0, base_dir)
|
2015-12-01 12:46:18 +01:00
|
|
|
|
2018-01-31 19:58:52 +01:00
|
|
|
if __name__ == '__main__':
|
2015-12-01 12:46:18 +01:00
|
|
|
+ __import__("importlib").import_module("libqtile.utils").restore_os_environment()
|
2018-01-31 19:58:52 +01:00
|
|
|
from libqtile.scripts import qtile_run
|
|
|
|
qtile_run.main()
|
|
|
|
diff --git a/bin/qtile-top b/bin/qtile-top
|
2020-07-25 17:51:57 +02:00
|
|
|
index a6251f27..0d524b1d 100755
|
2018-01-31 19:58:52 +01:00
|
|
|
--- a/bin/qtile-top
|
|
|
|
+++ b/bin/qtile-top
|
|
|
|
@@ -8,5 +8,6 @@ base_dir = os.path.abspath(os.path.join(this_dir, ".."))
|
|
|
|
sys.path.insert(0, base_dir)
|
2015-12-01 12:46:18 +01:00
|
|
|
|
2018-01-31 19:58:52 +01:00
|
|
|
if __name__ == '__main__':
|
|
|
|
+ __import__("importlib").import_module("libqtile.utils").restore_os_environment()
|
|
|
|
from libqtile.scripts import qtile_top
|
|
|
|
qtile_top.main()
|
2015-12-01 12:46:18 +01:00
|
|
|
diff --git a/libqtile/utils.py b/libqtile/utils.py
|
2020-07-25 17:51:57 +02:00
|
|
|
index 2628c898..05117be7 100644
|
2015-12-01 12:46:18 +01:00
|
|
|
--- a/libqtile/utils.py
|
|
|
|
+++ b/libqtile/utils.py
|
2020-07-25 17:51:57 +02:00
|
|
|
@@ -270,3 +270,10 @@ def guess_terminal():
|
|
|
|
return terminal
|
|
|
|
|
|
|
|
logger.error('Default terminal has not been found.')
|
2015-12-01 12:46:18 +01:00
|
|
|
+
|
|
|
|
+def restore_os_environment():
|
|
|
|
+ pythonpath = os.environ.pop("QTILE_SAVED_PYTHONPATH", "")
|
|
|
|
+ os.environ["PYTHONPATH"] = pythonpath
|
|
|
|
+ path = os.environ.pop("QTILE_SAVED_PATH", None)
|
|
|
|
+ if path:
|
|
|
|
+ os.environ["PATH"] = path
|
2020-07-25 17:51:57 +02:00
|
|
|
|