yazi only with hotkey

This commit is contained in:
Lennart J. Kurzweg (Nx2)
2024-09-27 21:42:29 +02:00
parent 5a40c8e1f9
commit f422551ac3
4 changed files with 72 additions and 48 deletions

View File

@@ -15,6 +15,7 @@
hyprswitch = { url = "github:h3rmt/hyprswitch/release"; }; hyprswitch = { url = "github:h3rmt/hyprswitch/release"; };
# firefox-addons = { url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs.nixpkgs.follows = "nixpkgs"; }; # firefox-addons = { url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs.nixpkgs.follows = "nixpkgs"; };
yazi.url = "github:sxyazi/yazi";
zen-browser.url = "github:MarceColl/zen-browser-flake"; zen-browser.url = "github:MarceColl/zen-browser-flake";
}; };

View File

@@ -91,6 +91,8 @@ lib.mkIf (user != "tv")
if not set -q IN_NIX_SHELL if not set -q IN_NIX_SHELL
nxfetch nxfetch
# yazi # yazi
if set -q SESSION_FROM_DE
set -e SESSION_FROM_DE
set tmp (mktemp -t "yazi-cwd.XXXXX") set tmp (mktemp -t "yazi-cwd.XXXXX")
yazi $argv --cwd-file="$tmp" yazi $argv --cwd-file="$tmp"
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
@@ -98,6 +100,7 @@ lib.mkIf (user != "tv")
end end
rm -f -- "$tmp" rm -f -- "$tmp"
end end
end
''; '';
functions = { functions = {
# gpg = ''; # gpg = '';

View File

@@ -385,7 +385,7 @@ lib.mkIf (user != "tv")
"SUPER, R, exec, rofi -show drun" "SUPER, R, exec, rofi -show drun"
# "SUPER, T, exec, alacritty" # "SUPER, T, exec, alacritty"
# "SUPER SHIFT, T, exec, alacritty -e sh -c "ssh nxace"" # "SUPER SHIFT, T, exec, alacritty -e sh -c "ssh nxace""
"SUPER, T, exec, kitty" "SUPER, T, exec, SESSION_FROM_DE=TRUE kitty"
"SUPER SHIFT, T, exec, kitty -e sh -c 'ssh nxace'" "SUPER SHIFT, T, exec, kitty -e sh -c 'ssh nxace'"
# "SUPER, Z, " # "SUPER, Z, "
"SUPER, U, exec, thunderbird " "SUPER, U, exec, thunderbird "

View File

@@ -1,16 +1,16 @@
{ pkgs, lib, user, rice, ... }: { pkgs, lib, system, user, rice, inputs, ... }:
lib.mkIf (user != "tv") lib.mkIf (user != "tv")
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
yazi # yazi
dragon dragon
unar unar
]; ];
programs.yazi = { programs.yazi = {
enable = true; enable = true;
# package = inputs.yazi.packages.${system}.default; package = inputs.yazi.packages.${system}.default;
enableFishIntegration = true; enableFishIntegration = true;
settings = { settings = {
manager = { manager = {
@@ -28,59 +28,80 @@ lib.mkIf (user != "tv")
]; ];
}; };
opener = { opener = {
edit = [ "edit" = [
{ run = ''hx "$@"''; desc = "helix"; block = true;} { run = ''hx "$@"''; desc = "helix"; block = true;}
{ run = ''codium "$@"''; orphan = true;} { run = ''codium "$@"''; orphan = true;}
{ run = ''nano "$@"''; desc = "nano"; block = true;} { run = ''nano "$@"''; desc = "nano"; block = true;}
]; ];
play = [ "play" = [
{ run = ''mpv "$@"''; } { run = ''mpv "$@"''; }
{ run = ''mediainfo "$1"; echo "Press enter to exit"; read''; block = true; desc = "Show mediainfo";} { run = ''mediainfo "$1"; echo "Press enter to exit"; read''; block = true; desc = "Show mediainfo";}
]; ];
archive = [ "archive" = [
{ run = ''unar "$1"''; desc = "Extract here"; } { run = ''unar "$1"''; desc = "Extract here"; }
{ run = ''tar -x "$1"''; desc = "tar -x"; }
{ run = ''unzip "$1"''; desc = "unzip"; }
]; ];
image = [ "image" = [
{ run = ''imv "$@"''; desc = "imv";} { run = ''imv "$@"''; desc = "imv";}
{ run = ''gimp "$@"''; desc = "gimp";} { run = ''gimp "$@"''; desc = "gimp";}
{ run = ''swww img --transition-type wipe --transition-angle 60 --transition-step 120 --transition-fps 120 "$@"''; desc = "swww wallpaper";} { run = ''swww img --transition-type wipe --transition-angle 60 --transition-step 120 --transition-fps 120 "$@"''; desc = "swww wallpaper";}
]; ];
font = [ "svg" = [
{ run = ''fontpreview "$@"''; desc = "fontpreview"; } { run = ''inkscape "$@"''; desc = "inkscape";}
{ run = ''firefoc "$@"''; desc = "firefox";}
]; ];
document = [ "font" = [
{ run = ''fontpreview "$@"''; desc = "fontpreview"; }
{ run = ''fontforge "$@"''; desc = "fortforge"; }
];
"document" = [
{ run = ''zathura "$@"''; desc = "zathura"; } { run = ''zathura "$@"''; desc = "zathura"; }
{ run = ''xournal "$@"''; desc = "xournal"; } { run = ''xournal "$@"''; desc = "xournal"; }
{ run = ''firefox "$@"''; desc = "firefox"; } { run = ''firefox "$@"''; desc = "firefox"; }
]; ];
browser = [ "browser" = [
{ run = ''firefox "$@"''; desc = "firefox"; } { run = ''firefox "$@"''; desc = "firefox"; }
{ run = ''zen "$@"''; desc = "zen"; }
{ run = ''chromium --enable-features=UseOzonePlatform --ozone-platform=wayland "$@"''; desc = "chromium"; }
{ run = ''w3m "$@"''; desc = "w3m"; }
{ run = ''lynx "$@"''; desc = "lynx"; }
]; ];
office = [ "office" = [
{ run = ''libreoffice "$@"''; desc = "libreoffice"; } { run = ''libreoffice "$@"''; desc = "libreoffice"; }
{ run = ''libreoffice --view "$@"''; desc = "libreoffice read-only"; } { run = ''libreoffice --view "$@"''; desc = "libreoffice read-only"; }
]; ];
shell = [ "shell" = [
{ run = ''sh -c "$@"''; desc = "sh -c"; }
{ run = ''bash -c "$@"''; desc = "bash -c"; } { run = ''bash -c "$@"''; desc = "bash -c"; }
{ run = ''fish -c "$@"''; desc = "fish -c"; }
{ run = ''sh -c "$@"''; desc = "sh -c"; }
]; ];
python = [ "python" = [
{ run = ''python "$@"''; desc = "python"; } { run = ''python "$@"''; desc = "python"; }
]; ];
"directory" = [
{ run = ''lazygit "$@"''; desc = "python"; }
];
}; };
open.rules = [ open.rules = [
{ mime = "text/*"; use = "edit"; }
{ mime = "text/plain"; use = "edit"; }
{ mime = "text/html"; use = ["edit" "browser"]; } { mime = "text/html"; use = ["edit" "browser"]; }
{ mime = "text/htm"; use = ["edit" "browser"]; } { mime = "text/htm"; use = ["edit" "browser"]; }
{ mime = "text/x-python"; use = "python"; }
{ mime = "text/*"; use = "edit"; }
{ mine = "inode/x-empty"; use = "edit"; }
{ mine = "inode/directory"; use = "edit"; }
{ mime = "image/*"; use = "image"; }
{ mime = "image/svg"; use = ["image" "edit"]; }
{ mime = "video/*"; use = "video"; }
{ mime = "application/x-httpd-php"; use = ["edit" "browser"]; } { mime = "application/x-httpd-php"; use = ["edit" "browser"]; }
{ mime = "application/json"; use = "edit"; } { mime = "application/json"; use = "edit"; }
{ mime = "application/ld+json"; use = "edit"; } { mime = "application/ld+json"; use = "edit"; }
{ mime = "image/*"; use = "image"; }
{ mime = "image/svg"; use = ["image" "edit"]; }
{ mime = "application/pdf"; use = "document"; } { mime = "application/pdf"; use = "document"; }
{ mime = "application/epub"; use = "document"; } { mime = "application/epub"; use = "document"; }
{ mime = "video/*"; use = "video"; }
{ mime = "application/vnd.oasis.opendocument.*"; use = "office"; } { mime = "application/vnd.oasis.opendocument.*"; use = "office"; }
{ mime = "application/vnd.ms-powerpoint"; use = "office"; } { mime = "application/vnd.ms-powerpoint"; use = "office"; }
{ mime = "application/vnd.ms-excel"; use = "office"; } { mime = "application/vnd.ms-excel"; use = "office"; }
@@ -88,7 +109,6 @@ lib.mkIf (user != "tv")
{ mime = "application/rtf"; use = "office"; } { mime = "application/rtf"; use = "office"; }
{ mime = "application/x-sh"; use = ["edit" "shell"]; } { mime = "application/x-sh"; use = ["edit" "shell"]; }
{ mime = "application/x-python-code"; use = "python"; } { mime = "application/x-python-code"; use = "python"; }
{ mime = "text/x-python"; use = "python"; }
{ mime = "application/xml"; use = "edit"; } { mime = "application/xml"; use = "edit"; }
{ mime = "application/xul"; use = "edit"; } { mime = "application/xul"; use = "edit"; }
{ mime = "application/x-bzip"; use = "archive"; } { mime = "application/x-bzip"; use = "archive"; }