feature(xdg): Include file picker configuration
This commit is contained in:
parent
29b5237c28
commit
fb2507afe7
4 changed files with 55 additions and 21 deletions
|
|
@ -71,6 +71,7 @@
|
|||
nautilus
|
||||
sushi
|
||||
nautilus-python
|
||||
nautilus-open-any-terminal
|
||||
];
|
||||
in
|
||||
lib.mkIf config.mods.nautilus.enable packages;
|
||||
|
|
|
|||
|
|
@ -140,15 +140,6 @@ in {
|
|||
Please note, plugins tend to break VERY often.
|
||||
'';
|
||||
};
|
||||
filePickerPortal = lib.mkOption {
|
||||
default = "gtk";
|
||||
example = "kde";
|
||||
type = with lib.types; (enum ["gnome" "kde" "gtk" "disable"]);
|
||||
description = ''
|
||||
The file picker portal to use with Hyprland.
|
||||
Disable removes the config, allowing you to set it yourself.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mods.hypr.hyprland.enable (
|
||||
|
|
@ -160,22 +151,15 @@ in {
|
|||
slurp
|
||||
satty
|
||||
xdg-desktop-portal-gtk
|
||||
xdg-desktop-portal-gnome
|
||||
kdePackages.xdg-desktop-portal-kde
|
||||
xdg-desktop-portal-shana
|
||||
copyq
|
||||
wl-clipboard
|
||||
hyprcursor
|
||||
hyprpicker
|
||||
(lib.mkIf (config.mods.hypr.hyprland.filePickerPortal == "kde") xdg-desktop-portal-kde)
|
||||
(lib.mkIf (config.mods.hypr.hyprland.filePickerPortal == "gnome") xdg-desktop-portal-gnome)
|
||||
];
|
||||
|
||||
xdg.configFile."xdg-desktop-portal/portals.conf" = lib.mkIf (config.mods.hypr.hyprland.filePickerPortal != "none") {
|
||||
text = ''
|
||||
[preferred]
|
||||
default = hyprland;gtk
|
||||
org.freedesktop.impl.portal.FileChooser = ${config.mods.hypr.hyprland.filePickerPortal}
|
||||
'';
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
package = mkDashDefault pkgs.hyprland;
|
||||
|
|
|
|||
|
|
@ -36,8 +36,46 @@
|
|||
special services configuration to be added which require an services.something notation.
|
||||
'';
|
||||
};
|
||||
filePickerPortal = lib.mkOption {
|
||||
default = "Term";
|
||||
example = "Gnome";
|
||||
type = with lib.types; oneOf [(enum ["Gnome" "Kde" "Lxqt" "Gtk" "Term" "Default"]) string];
|
||||
description = ''
|
||||
The file picker portal to use (set with shana).
|
||||
Default removes the config, allowing you to set it yourself.
|
||||
'';
|
||||
};
|
||||
termFileChooserConfig = lib.mkOption {
|
||||
default = {
|
||||
cmd = "${pkgs.xdg-desktop-portal-termfilechooser}/share/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh";
|
||||
default_dir = "$HOME";
|
||||
};
|
||||
example = {};
|
||||
type = with lib.types; attrsOf anything;
|
||||
description = ''
|
||||
Termfilechooser config
|
||||
'';
|
||||
};
|
||||
};
|
||||
config = lib.optionalAttrs (options ? home.packages) {
|
||||
xdg.configFile."xdg-desktop-portal-termfilechooser/config" = lib.mkIf (config.mods.media.filePickerPortal != "Term") {
|
||||
source = (pkgs.formats.ini {}).generate "termchooser" {
|
||||
filechooser = config.mods.media.termFileChooserConfig;
|
||||
};
|
||||
};
|
||||
xdg.configFile."xdg-desktop-portal-shana/config.toml" = lib.mkIf (config.mods.media.filePickerPortal != "Default") {
|
||||
source = let
|
||||
name =
|
||||
if (config.mods.media.filePickerPortal == "Term")
|
||||
then "org.freedesktop.impl.portal.desktop.termfilechooser"
|
||||
else config.mods.media.filePickerPortal;
|
||||
in
|
||||
(pkgs.formats.toml {}).generate "shana" {
|
||||
open_file = name;
|
||||
save_file = name;
|
||||
save_files = name;
|
||||
};
|
||||
};
|
||||
home.packages =
|
||||
if config.mods.media.useBasePackages
|
||||
then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue