Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use absolute paths to load gobject, pango and cairo. * Add xcb-cursor support (also with absolute path) * Avoid tainting child processes environment: Save PATH and PYTHONPATH in wrapper, and restore them in python code. * Alter restart process, using $0 saved in wrapper, which allow user to restart qtile after system rebuild to upgrade it.
- Loading branch information
Showing
5 changed files
with
152 additions
and
25 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
pkgs/applications/window-managers/qtile/0001-Substitution-vars-for-absolute-paths.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
From 00c5af939567429d40877845dc52b54fde2d8a50 Mon Sep 17 00:00:00 2001 | ||
From: "Alexander V. Nikolaev" <avn@avnik.info> | ||
Date: Thu, 26 Nov 2015 10:53:12 +0200 | ||
Subject: [PATCH 1/3] Substitution vars for absolute paths | ||
|
||
--- | ||
libqtile/pangocffi.py | 6 +++--- | ||
libqtile/xcursors.py | 2 +- | ||
2 files changed, 4 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/libqtile/pangocffi.py b/libqtile/pangocffi.py | ||
index 27691d1..25f690d 100644 | ||
--- a/libqtile/pangocffi.py | ||
+++ b/libqtile/pangocffi.py | ||
@@ -58,9 +58,9 @@ except ImportError: | ||
else: | ||
raise ImportError("No module named libqtile._ffi_pango, be sure to run `python ./libqtile/ffi_build.py`") | ||
|
||
-gobject = ffi.dlopen('libgobject-2.0.so.0') | ||
-pango = ffi.dlopen('libpango-1.0.so.0') | ||
-pangocairo = ffi.dlopen('libpangocairo-1.0.so.0') | ||
+gobject = ffi.dlopen('@glib@/lib/libgobject-2.0.so.0') | ||
+pango = ffi.dlopen('@pango@/lib/libpango-1.0.so.0') | ||
+pangocairo = ffi.dlopen('@pango@/lib/libpangocairo-1.0.so.0') | ||
|
||
|
||
def CairoContext(cairo_t): | ||
diff --git a/libqtile/xcursors.py b/libqtile/xcursors.py | ||
index e0e55e1..59b6428 100644 | ||
--- a/libqtile/xcursors.py | ||
+++ b/libqtile/xcursors.py | ||
@@ -114,7 +114,7 @@ class Cursors(dict): | ||
|
||
def _setup_xcursor_binding(self): | ||
try: | ||
- xcursor = ffi.dlopen('libxcb-cursor.so') | ||
+ xcursor = ffi.dlopen('@xcb-cursor@/lib/libxcb-cursor.so') | ||
except OSError: | ||
self.log.warning("xcb-cursor not found, fallback to font pointer") | ||
return False | ||
-- | ||
2.6.3 | ||
|
67 changes: 67 additions & 0 deletions
67
pkgs/applications/window-managers/qtile/0002-Restore-PATH-and-PYTHONPATH.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
From f299a0aa0eefcf16bb4990f00ac3946727f43ef3 Mon Sep 17 00:00:00 2001 | ||
From: "Alexander V. Nikolaev" <avn@avnik.info> | ||
Date: Fri, 27 Nov 2015 10:49:48 +0200 | ||
Subject: [PATCH 2/3] Restore PATH and PYTHONPATH | ||
|
||
--- | ||
bin/qtile | 1 + | ||
bin/qtile-run | 1 + | ||
bin/qtile-session | 2 ++ | ||
libqtile/utils.py | 7 +++++++ | ||
4 files changed, 11 insertions(+) | ||
|
||
diff --git a/bin/qtile b/bin/qtile | ||
index 66034fe..ce3fcd1 100755 | ||
--- a/bin/qtile | ||
+++ b/bin/qtile | ||
@@ -131,6 +131,7 @@ def make_qtile(): | ||
|
||
|
||
if __name__ == "__main__": | ||
+ __import__("importlib").import_module("libqtile.utils").restore_os_environment() | ||
rename_process() | ||
q = make_qtile() | ||
try: | ||
diff --git a/bin/qtile-run b/bin/qtile-run | ||
index ccedb96..646a476 100755 | ||
--- a/bin/qtile-run | ||
+++ b/bin/qtile-run | ||
@@ -50,6 +50,7 @@ def main(): | ||
proc.wait() | ||
|
||
if __name__ == "__main__": | ||
+ __import__("importlib").import_module("libqtile.utils").restore_os_environment() | ||
try: | ||
main() | ||
except KeyboardInterrupt: | ||
diff --git a/bin/qtile-session b/bin/qtile-session | ||
index 84f6a2d..da31b12 100755 | ||
--- a/bin/qtile-session | ||
+++ b/bin/qtile-session | ||
@@ -25,6 +25,8 @@ | ||
Qtile session manager. | ||
""" | ||
|
||
+__import__("importlib").import_module("libqtile.utils").restore_os_environment() | ||
+ | ||
from libqtile.log_utils import init_log | ||
import logging | ||
import os | ||
diff --git a/libqtile/utils.py b/libqtile/utils.py | ||
index d5f975b..0fdb080 100644 | ||
--- a/libqtile/utils.py | ||
+++ b/libqtile/utils.py | ||
@@ -208,3 +208,10 @@ def get_cache_dir(): | ||
if not os.path.exists(cache_directory): | ||
os.makedirs(cache_directory) | ||
return cache_directory | ||
+ | ||
+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 | ||
-- | ||
2.6.3 | ||
|
25 changes: 25 additions & 0 deletions
25
pkgs/applications/window-managers/qtile/0003-Restart-executable.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From b560c11078fecc35df2c62f34beda06c4e80a10d Mon Sep 17 00:00:00 2001 | ||
From: "Alexander V. Nikolaev" <avn@avnik.info> | ||
Date: Fri, 27 Nov 2015 10:54:35 +0200 | ||
Subject: [PATCH 3/3] Restart executable | ||
|
||
--- | ||
libqtile/manager.py | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/libqtile/manager.py b/libqtile/manager.py | ||
index b1a38e2..110f7d8 100644 | ||
--- a/libqtile/manager.py | ||
+++ b/libqtile/manager.py | ||
@@ -1339,7 +1339,7 @@ class Qtile(command.CommandObject): | ||
argv = [s for s in argv if not s.startswith('--with-state')] | ||
argv.append('--with-state=' + buf.getvalue().decode()) | ||
|
||
- self.cmd_execute(sys.executable, argv) | ||
+ self.cmd_execute(os.environ.get("QTILE_WRAPPER", "@out@/bin/qtile"), argv[1:]) | ||
|
||
def cmd_spawn(self, cmd): | ||
""" | ||
-- | ||
2.6.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
pkgs/applications/window-managers/qtile/restart_executable.patch
This file was deleted.
Oops, something went wrong.