Skip to content

Commit 05befcb

Browse files
author
nix
committed
fox xcb only if display var is set
1 parent 08846f8 commit 05befcb

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

flake.nix

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@
8585
formatter.${system} = pkgs.nixpkgs-fmt;
8686
devShells.${system}.default = pkgs.mkShell {
8787
buildInputs = mtfgDependencies;
88-
shellHook = ''
89-
# use xwayland not wayland
90-
export QT_QPA_PLATFORM="xcb"
91-
'';
9288
};
9389
};
9490
}

funscript_editor/__main__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ def main():
2424

2525
if os.path.abspath(__file__).startswith("/nix"):
2626
# pynput does not work well with native wayland so we use xwayland to get proper keyboard inputs
27-
print("Warning: Force QT_QPA_PLATFORM=xcb")
28-
os.environ['QT_QPA_PLATFORM'] = "xcb"
27+
if os.environ.get('DISPLAY'):
28+
print("Warning: Force QT_QPA_PLATFORM=xcb for better user experience")
29+
os.environ['QT_QPA_PLATFORM'] = "xcb"
2930

3031
if not args.generator: show_editor()
3132
else: generate_funscript(args.input, args.start, args.end, args.output, args.multiaxis, args.no_tracking, args.logs, args.stdout)

0 commit comments

Comments
 (0)