From 1b8649f6fc9b7514f191d4cd2708b3fe411138b4 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Thu, 16 May 2024 00:07:16 +0530 Subject: [PATCH] use xdg-open as fallback for opening files use xdg-open for opening everything --- home/programs/files.nix | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/home/programs/files.nix b/home/programs/files.nix index bdb1447..0cdf179 100644 --- a/home/programs/files.nix +++ b/home/programs/files.nix @@ -1,4 +1,4 @@ -{ config, ... }: { +{ config, pkgs, ... }: { programs = { fd = { enable = true; @@ -19,24 +19,22 @@ image_quality = 90; }; opener = { - open-image = [ - { run = "${config.programs.imv.package}/bin/imv-dir $0"; orphan = true; } - ]; edit-text = [ { run = "${config.programs.neovim.package}/bin/nvim $0"; block = true; } ]; - play = [ - { run = "${config.programs.mpv.package}/bin/mpv $0"; orphan = true; } - ]; terminal = [ { run = "${config.programs.kitty.package}/bin/kitty --class=yazi -d=$0"; orphan = true; } ]; + open = [ + { run = "${pkgs.xdg-utils}/bin/xdg-open $0"; orphan = true; } + ]; }; open.rules = [ - { mime = "image/*"; use = "open-image"; } { mime = "text/*"; use = [ "edit-text" ]; } - { mime = "video/*"; use = [ "play" ]; } + { mime = "application/json"; use = [ "edit-text" ]; } { mime = "inode/directory"; use = [ "terminal" ]; } + { mime = "*"; use = [ "open" ]; } + { name = "*"; use = [ "open" ]; } ]; }; };