gnome.gnome-flashback: Add mkWmApplication

Having this in environment.systemPackages shouldn't be worse than
adding as XDG_DATA_DIRS in gnome-session.
This commit is contained in:
Bobby Rong 2023-10-06 17:56:38 +08:00
parent f6345cd259
commit 21f5cd377a
No known key found for this signature in database
2 changed files with 22 additions and 19 deletions

View File

@ -311,7 +311,9 @@ in
(gnome-panel-with-modules.override {
panelModulePackages = cfg.flashback.panelModulePackages;
})
];
]
# For /share/applications/${wmName}.desktop
++ (map (wm: gnome-flashback.mkWmApplication { inherit (wm) wmName wmLabel wmCommand; }) flashbackWms);
})
(mkIf serviceCfg.core-os-services.enable {

View File

@ -128,25 +128,26 @@ let
versionPolicy = "odd-unstable";
};
mkWmApplication = { wmName, wmLabel, wmCommand }:
writeTextFile {
name = "gnome-flashback-${wmName}-wm";
destination = "/share/applications/${wmName}.desktop";
text = ''
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=${wmLabel}
Exec=${wmCommand}
NoDisplay=true
X-GNOME-WMName=${wmLabel}
X-GNOME-Autostart-Phase=WindowManager
X-GNOME-Provides=windowmanager
X-GNOME-Autostart-Notify=false
'';
};
mkSessionForWm = { wmName, wmLabel, wmCommand, enableGnomePanel }:
let
wmApplication = writeTextFile {
name = "gnome-flashback-${wmName}-wm";
destination = "/share/applications/${wmName}.desktop";
text = ''
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=${wmLabel}
Exec=${wmCommand}
NoDisplay=true
X-GNOME-WMName=${wmLabel}
X-GNOME-Autostart-Phase=WindowManager
X-GNOME-Provides=windowmanager
X-GNOME-Autostart-Notify=false
'';
};
gnomeSession = writeTextFile {
name = "gnome-flashback-${wmName}-gnome-session";
destination = "/share/gnome-session/sessions/gnome-flashback-${wmName}.session";
@ -174,7 +175,7 @@ let
makeWrapper ${gnome-session}/bin/gnome-session $out \
--add-flags "--session=gnome-flashback-${wmName} --builtin" \
--set-default XDG_CURRENT_DESKTOP 'GNOME-Flashback:GNOME' \
--prefix XDG_DATA_DIRS : '${lib.makeSearchPath "share" [ wmApplication gnomeSession gnome-flashback ]}'
--prefix XDG_DATA_DIRS : '${lib.makeSearchPath "share" [ gnomeSession gnome-flashback ]}'
'';
};