diff --git a/home-modules/firefox.nix b/home-modules/firefox.nix index bfe0ca2..d72b9d0 100644 --- a/home-modules/firefox.nix +++ b/home-modules/firefox.nix @@ -2,6 +2,9 @@ # browser.tabs.allow_transparent_browser # https://www.reddit.com/r/FirefoxCSS/comments/1dqws4b/firefox_128_will_allow_the_main_browser_content/ { + programs.firefox.profiles."{hyper.user}".settings = { + "widget.use-xdg-desktop-portal.file-picker" = 1; + }; home = { packages = with pkgs; [ firefox diff --git a/home-modules/hyprland.nix b/home-modules/hyprland.nix index 76fec0f..19e49d3 100644 --- a/home-modules/hyprland.nix +++ b/home-modules/hyprland.nix @@ -63,23 +63,16 @@ let }; }; in { - home.packages = (with pkgs; [ - # hyprland itself is a system package + home.packages = with pkgs; [ hyprland-protocols hyprlock hypridle hyprshot hyprpicker hyprcursor - grim slurp - - # ]) ++ (with pkgs-unstable; [ - - # ]) ++ (with inputs; [ - # hyprswitch.packages.x86_64-linux.default - ]); + ]; wayland.windowManager.hyprland = { @@ -324,6 +317,11 @@ in { "tile, class:^(sent)$" "workspace 100, class:^(gamescope)$" + + "float, title:^(terminal-file-picker)$" + "dimaround, title:^(terminal-file-picker)$" + "center, title:^(terminal-file-picker)$" + "size 80% 80%, title:^(terminal-file-picker)$" ]; diff --git a/home-modules/yazi.nix b/home-modules/yazi.nix index ffd8872..5afc36f 100644 --- a/home-modules/yazi.nix +++ b/home-modules/yazi.nix @@ -10,7 +10,27 @@ package = inputs.yazi.packages.${hyper.system}.default; enableFishIntegration = true; shellWrapperName = "ya"; - # plugins = with inputs.yazi-plugins.packages.${hyper.system}; { }; + initLua = /* lua */ '' + require("zoxide"):setup { + update_db = true, + } + Status:children_add(function() + local h = cx.active.current.hovered + if not h or ya.target_family() ~= "unix" then + return "" + end + + return ui.Line { + ui.Span(ya.user_name(h.cha.uid) or tostring(h.cha.uid)):fg("magenta"), + ":", + ui.Span(ya.group_name(h.cha.gid) or tostring(h.cha.gid)):fg("magenta"), + " ", + } + end, 500, Status.RIGHT) + ''; + plugins = with pkgs; { + inherit glow git; + }; # initLua = /* lua */ '' ''; keymap = { mgr.keymap = [ @@ -69,6 +89,8 @@ { on = "O"; run = "open --interactive"; desc = "Open selected files interactively"; } { on = ""; run = "open"; desc = "Open selected files"; } { on = ""; run = "open --interactive"; desc = "Open selected files interactively"; } + { on = "y"; run = [ ''shell -- for path in "$@"; do echo "file://$path"; done | wl-copy -t text/uri-list'' + "yank" ]; desc = "Yank selected files (copy)"; } { on = "y"; run = "yank"; desc = "Yank selected files (copy)"; } { on = "x"; run = "yank --cut"; desc = "Yank selected files (cut)"; } { on = "p"; run = "paste"; desc = "Paste yanked "; } @@ -373,4 +395,26 @@ }; }; }; + xdg = { + configFile."xdg-desktop-portal-termfilechooser/config".text = lib.mkIf config.programs.yazi.enable '' + [filechooser] + cmd=${pkgs.xdg-desktop-portal-termfilechooser}/share/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh + env=TERMCMD=ghostty --title="terminal-file-picker -e" + default_dir=$HOME + open_mode=suggested + save_mode=last + ''; + portal = { + enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-termfilechooser ]; + config = { + common = { + "org.freedesktop.impl.portal.FileChooser" = "termfilechooser"; + }; + }; + }; + }; + home.sessionVariables = { + GTK_USE_PORTAL = "1"; + }; }