From d7c523ea6038de449b1173eb37572834560cecb8 Mon Sep 17 00:00:00 2001 From: Sweetbread Date: Sun, 16 Aug 2026 22:32:58 +0300 Subject: [PATCH] wip: MTP --- modules/host.nix | 3 ++- modules/user/yazi.nix | 39 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/modules/host.nix b/modules/host.nix index 5530c44..0b4e13e 100644 --- a/modules/host.nix +++ b/modules/host.nix @@ -20,6 +20,7 @@ programs = { dconf.enable = true; hyprland.enable = true; + fuse.enable = true; }; xdg.portal = { @@ -48,7 +49,7 @@ }; services = { - udisks2.enable = true; + gvfs.enable = true; fstrim.enable = true; upower.enable = true; }; diff --git a/modules/user/yazi.nix b/modules/user/yazi.nix index 272a578..45093bc 100644 --- a/modules/user/yazi.nix +++ b/modules/user/yazi.nix @@ -250,6 +250,11 @@ in { toggle-pane ; + gvfs = { + package = gvfs; + setup = true; + }; + full-border = { package = yaziPlugin "full-border"; setup = true; @@ -300,9 +305,39 @@ in { desc = "Chmod on selected files"; } { - on = ["M"]; + on = [ "M" "b" ]; run = "plugin mount"; - desc = "Open mount menu"; + desc = "Open block-device mount menu"; + } + { + on = [ "M" "m" ]; + run = "plugin gvfs -- select-then-mount --jump"; + desc = "Mount GVFS device and jump to it"; + } + { + on = [ "M" "u" ]; + run = "plugin gvfs -- select-then-unmount"; + desc = "Unmount GVFS device"; + } + { + on = [ "M" "U" ]; + run = "plugin gvfs -- select-then-unmount --eject"; + desc = "Unmount and eject GVFS device"; + } + { + on = [ "M" "t" ]; + run = "plugin gvfs -- automount-when-cd"; + desc = "Enable GVFS automount when entering device"; + } + { + on = [ "g" "m" ]; + run = "plugin gvfs -- jump-to-device"; + desc = "Jump to mounted GVFS device"; + } + { + on = [ "`" "`" ]; + run = "plugin gvfs -- jump-back-prev-cwd"; + desc = "Jump back from GVFS device"; } { on = [ "" ];