-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
sway-beta module: add missing pieces #49687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are comments on why these changes needed.
|
||
swayWrapped = pkgs.writeShellScriptBin "sway" '' | ||
${cfg.extraSessionCommands} | ||
exec ${pkgs.dbus.dbus-launch} --exit-with-session ${swayPackage}/bin/sway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to make dbus dependend programs to work (like libnotify notifications). Also official wiki recommends launching via dbus-launch for one particular case https://github.com/swaywm/sway/wiki#im-not-using-logind-but-still-want-dbuspolkitpower-management-to-work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just packaged mako
in my overlay an hour ago and just noticed it wasn't working.
This patch fixes it. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@colemickens In case of X program you would also need exec dbus-update-activation-environment DISPLAY
in your sway config
export SDL_VIDEODRIVER=wayland | ||
# needs qt5.qtwayland in systemPackages | ||
export QT_QPA_PLATFORM=wayland | ||
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to prepare environment. xkb options moved to sway config in sway-beta, so add another example here. Also mentioned in official wiki https://github.com/swaywm/sway/wiki#disabling-client-side-qt-decorations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xkb options moved to sway config in sway-beta, so add another example here
what do you mean "so add another example here" since it's no longer in the env vars?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@colemickens I mean instead of example provided in main module https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/programs/sway.nix#L33
extraPackages = mkOption { | ||
type = with types; listOf package; | ||
default = with pkgs; [ | ||
xwayland dmenu | ||
xwayland rxvt_unicode dmenu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rxvt_unicode
is needed for use with stock config. See ${pkgs.sway-beta}/etc/sway/config
LGTM. Fixes at least one problem for me and likely more I didn't know about. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks :)
export SDL_VIDEODRIVER=wayland | ||
# needs qt5.qtwayland in systemPackages | ||
export QT_QPA_PLATFORM=wayland | ||
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind adding the following or something similar to the examples (https://github.com/swaywm/sway/wiki/Running-programs-natively-under-wayland#java-under-xwayland)?:
# Fix for some Java AWT applications (e.g. Android Studio),
# use this if they aren't displayed properly:
export _JAVA_AWT_WM_NONREPARENTING=1
Without this e.g. Android-Studio won't be displayed properly (no content is shown after opening a project, only the window itself is visible). (We could also add it to the defaults but I'm not sure if there are any drawbacks.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@primeos Sure, done!
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" | ||
# Fix for some Java AWT applications (e.g. Android Studio), | ||
# use this if they aren't displayed properly: | ||
export _JAVA_AWT_WM_NONREPARENTING=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to not be doing GDK_BACKEND=wayland
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@colemickens Should be picked by default https://github.com/swaywm/sway/wiki/Running-programs-natively-under-wayland#gtk-30
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm okay. It seems like emersion's most recent edit means that the QT_WAYLAND_DISABLE_WINDOWDECORATION
isn't needed either. Or have you observed that it is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@colemickens Tested on nixos-unstable. Both settings are still needed:
https://github.com/swaywm/sway/wiki#disabling-client-side-qt-decorations
Don't know why its strikethrough there https://github.com/swaywm/sway/wiki/Running-programs-natively-under-wayland#qt5 Maybe that setting is no more required with recent Qt release we don't have.
Thanks again :) BTW: I just noticed that I forgot to check the commit message, according to CONTRIBUTING.md#submitting-changes it should've been "nixos/sway-beta: ...", but it's not really enforced in nixpkgs AFAIK (at least there are many commits without the "nixos/" prefix). It might be something to keep in mind for the next time though (for the consistency). |
@primeos Got it, thanks! |
Motivation for this change
Add missing pieces from main module. See comments below.
cc @colemickens @primeos
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)