qtile: restore restart patch

Fixes #139568
This commit is contained in:
Joel 2022-02-02 12:10:03 +10:00 committed by Jonathan Ringer
parent 852bd9392a
commit 7951311643
2 changed files with 26 additions and 0 deletions

View file

@ -12,6 +12,10 @@ let
sha256 = "TRmul3t//izJRdViTvxFz29JZeGYsWc7WsJjagQ35nw=";
};
patches = [
./fix-restart.patch # https://github.com/NixOS/nixpkgs/issues/139568
];
postPatch = ''
substituteInPlace libqtile/pangocffi.py \
--replace libgobject-2.0.so.0 ${glib.out}/lib/libgobject-2.0.so.0 \

View file

@ -0,0 +1,22 @@
diff --git a/libqtile/core/lifecycle.py b/libqtile/core/lifecycle.py
index 0d4d119d..c37d1799 100644
--- a/libqtile/core/lifecycle.py
+++ b/libqtile/core/lifecycle.py
@@ -25,7 +25,7 @@ class LifeCycle:
def _atexit(self) -> None:
if self.behavior is Behavior.RESTART:
- argv = [sys.executable] + sys.argv
+ argv = sys.argv
if "--no-spawn" not in argv:
argv.append("--no-spawn")
argv = [s for s in argv if not s.startswith("--with-state")]
@@ -33,7 +33,7 @@ class LifeCycle:
argv.append("--with-state=" + self.state_file)
logger.warning("Restarting Qtile with os.execv(...)")
# No other code will execute after the following line does
- os.execv(sys.executable, argv)
+ os.execv(sys.argv[0], argv)
elif self.behavior is Behavior.TERMINATE:
logger.warning("Qtile will now terminate")
elif self.behavior is Behavior.NONE: