-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
nixos/gnome3: add GNOME Flashback sessions option #53695
Conversation
I'm not totally sure about the organization. Maybe |
9fc5304
to
6d66fb1
Compare
e26a011
to
4842da7
Compare
Done, please take a look |
export XDG_CURRENT_DESKTOP="GNOME-Flashback:GNOME" | ||
fi | ||
|
||
exec ${gnome3.gnome-session}/bin/gnome-session --session=gnome-flashback-${wmName} "$@" |
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.
Maybe add an option for extra arguments like the acceleration disablement.
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.
It works for me without it and it's not a documented gnome-session
flag so I think we should add it if someone needs it.
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 is a (commit adding this flag](https://gitlab.gnome.org/GNOME/gnome-flashback/commit/39dbfd09d4a7e16d5ca41319a62f173b8c79ca79) and a relevant bug.
4842da7
to
6f18572
Compare
Hmm on my desktop it doesn't work yet because |
That should go to preFixup = ''
gappsWrapperArgs+=(
# Session file requirements (for finding desktop files)
--prefix XDG_DATA_DIRS : "${gnome-panel}/share"
)
''; would do. But that is pretty pointless use of I suggest that you just add the |
6f18572
to
f25a7c0
Compare
OK, please take a look. |
f25a7c0
to
1552624
Compare
cat << EOF > $out/libexec/gnome-flashback-${wmName} | ||
#!${bash}/bin/sh | ||
|
||
if [ -z \$XDG_CURRENT_DESKTOP ]; then |
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.
Using lib.writeScript
would allow us to avoid the need to escape this.
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.
How would we put $out
into it with writeScript
?
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.
It produces output which can be copied or linked.
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 know but we want to add $out/share
into XDG_DATA_DIRS
, but we can't use $out
in a writeScript
.
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.
let
sessionScript = lib.writeScript ...;
in stdenv.mkDerivation {
buildCommand = ''
…
mkdir -p $out/libexec
cp ${sessionScript} $out/libexec/gnome-flashback-${wmName}
…
'';
}
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.
Again, I understand that. The question is how you would do the following in the writeScript
given that $out
is not available:
export XDG_DATA_DIRS=$out/share:...
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.
Hmm, sorry, you are right. I was thinking about passing a placeholder but those do not really work with writeScript
, I think.
1552624
to
f143ca7
Compare
I got it working with |
f143ca7
to
869245c
Compare
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 fine to me.
I tried running { pkgs, config, ... }: {
services.xserver = {
displayManager.gdm = {
enable = true;
debug = true;
};
desktopManager.gnome3 = {
enable = true;
debug = true;
flashback.enableMetacity = true;
};
};
} in a VM and found two issues:
|
It also might be nice to be enable gnome-flashback without gnome-shell. Maybe we could move most of the |
preFixup = ''
gappsWrapperArgs+=(
--prefix XDG_DATA_DIRS : "${gnome-menus}/share:${gnome-flashback}/share"
--prefix XDG_CONFIG_DIRS : "${gnome-menus}/etc/xdg:${gnome-flashback}/etc/xdg"
)
''; seems to fix it. |
I'm working on packaging |
869245c
to
8759716
Compare
OK I got it working with |
# Find out where the session service file goes | ||
# The sad sed hack is recomended by section 27.10 of the automake manual. | ||
-DBUS_SESSION_SERVICE_DIR=`pkg-config --variable session_bus_services_dir dbus-1 | sed -e 's,/usr/share,${datarootdir},g'` | ||
+DBUS_SESSION_SERVICE_DIR=${datarootdir}/dbus-1/services |
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.
You can use PKG_CONFIG_DBUS_1_SESSION_BUS_SERVICES_DIR = "${placeholder "out"}/share/dbus-1/services";
in the expression.
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 don't understand what that's for, I want to set the path directly instead of using the sed hack.
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.
The sed hack will not do anything on Nix, as we do not use /usr/share
prefix. Instead, we can override the path returned by pkg-config --variable session_bus_services_dir dbus-1
using the aforementioned environment variable, avoiding the need to patch the configure script.
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.
The pkgconfig + sed hack is introduced by the Ubuntu patch that adds the dbus service. As you said it doesn't work, so I just replace it with the correct path directly. I don't see why changing what pkg-config returns would help.
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 don't understand why pkg-config needs to be involved at all. This is the original patch:
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.
Well, the sed will not bother us with the environment variable set:
$ env PKG_CONFIG_DBUS_1_SESSION_BUS_SERVICES_DIR='${placeholder "out"}/share/dbus-1/services' pkg-config --variable session_bus_services_dir dbus-1 | sed -e 's,/usr/share,${datarootdir},g'
${placeholder "out"}/share/dbus-1/services
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.
OK, in that case isn't it best to patch in the correct solution you described? I've pushed that now.
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.
That would work too, though I would prefer to minimize the number of patches. It is messy enough as is, and there are much more patches than other distros have:
https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/gnome-screensaver
https://salsa.debian.org/gnome-team/gnome-screensaver/tree/debian/master/debian/patches
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 guess we might want to switch to Arch’s patchset, as it is much closer to our philosophy. With Ubuntu, it is hard to tell which patches are Ubuntu specific, only needed due to patches of some other component (24 looks like that).
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.
24 is also in the Arch patches: https://git.archlinux.org/svntogit/community.git/tree/trunk/use-screensaver-background.patch?h=packages/gnome-screensaver
The enabled Ubuntu patches all seem to be bugfixes not present in the other distros, I think it would be a good idea to have them. I think if we want to really get it right we should support xscreensaver since this package is old and deprecated, but let's do that in another PR.
Creating a DBus interface for |
8759716
to
c5cd572
Compare
Let's just do what upstream does with |
c5cd572
to
cca2643
Compare
By the way, do we care about running Flashback without having GNOME Shell installed? |
cca2643
to
b25095b
Compare
I guess it could be useful, but I'd like to merge this first since it works now and separating the two would be quite a big change. If there's demand for it we can make another PR. |
Works for me, thanks for your work. |
Motivation for this change
This allows you to enable GNOME Flashback sessions with a custom window manager.
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)