2024-04-20 13:42:06 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
{
|
2022-05-30 17:18:18 +00:00
|
|
|
|
2022-12-21 21:18:03 +00:00
|
|
|
options = {
|
|
|
|
nautilus = {
|
|
|
|
enable = lib.mkEnableOption {
|
|
|
|
description = "Enable Nautilus file manager.";
|
|
|
|
default = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-05-30 17:18:18 +00:00
|
|
|
# Install Nautilus file manager
|
2022-12-21 21:18:03 +00:00
|
|
|
config = lib.mkIf (config.gui.enable && config.nautilus.enable) {
|
2023-06-03 00:10:45 +00:00
|
|
|
|
|
|
|
# Quick preview with spacebar
|
|
|
|
services.gnome.sushi.enable = true;
|
2024-08-05 01:03:38 +00:00
|
|
|
environment.systemPackages = [ pkgs.nautilus ];
|
2023-06-03 00:10:45 +00:00
|
|
|
|
2022-05-30 17:18:18 +00:00
|
|
|
home-manager.users.${config.user} = {
|
2022-11-14 15:35:16 +00:00
|
|
|
|
2023-07-31 00:26:23 +00:00
|
|
|
# Quick button for launching nautilus
|
2023-04-04 01:54:53 +00:00
|
|
|
xsession.windowManager.i3.config.keybindings = {
|
|
|
|
"${
|
|
|
|
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
|
2024-08-05 01:03:38 +00:00
|
|
|
}+n" = "exec --no-startup-id ${pkgs.nautilus}/bin/nautilus";
|
2023-04-04 01:54:53 +00:00
|
|
|
};
|
2023-02-17 23:14:57 +00:00
|
|
|
|
2023-07-31 00:26:23 +00:00
|
|
|
# Generates a QR code and previews it with sushi
|
2022-11-14 15:35:16 +00:00
|
|
|
programs.fish.functions = {
|
|
|
|
qr = {
|
2024-08-05 01:03:38 +00:00
|
|
|
body = "${pkgs.qrencode}/bin/qrencode $argv[1] -o /tmp/qr.png | ${pkgs.sushi}/bin/sushi /tmp/qr.png";
|
2022-11-14 15:35:16 +00:00
|
|
|
};
|
|
|
|
};
|
2023-04-04 01:54:53 +00:00
|
|
|
|
2023-07-31 00:26:23 +00:00
|
|
|
# Set Nautilus as default for opening directories
|
2023-04-04 01:54:53 +00:00
|
|
|
xdg.mimeApps = {
|
|
|
|
associations.added."inode/directory" = [ "org.gnome.Nautilus.desktop" ];
|
2024-04-20 13:42:06 +00:00
|
|
|
defaultApplications."inode/directory" = lib.mkBefore [ "org.gnome.Nautilus.desktop" ];
|
2023-04-04 01:54:53 +00:00
|
|
|
};
|
2022-05-30 17:18:18 +00:00
|
|
|
};
|
2023-02-28 05:11:59 +00:00
|
|
|
|
2023-07-18 02:24:41 +00:00
|
|
|
# Delete Trash files older than 1 week
|
|
|
|
systemd.user.services.empty-trash = {
|
|
|
|
description = "Empty Trash on a regular basis";
|
|
|
|
wantedBy = [ "default.target" ];
|
|
|
|
script = "${pkgs.trash-cli}/bin/trash-empty 7";
|
|
|
|
};
|
2022-05-30 17:18:18 +00:00
|
|
|
};
|
|
|
|
}
|