forked from foxora/nix
init
This commit is contained in:
commit
a07bd5fd9b
66 changed files with 6115 additions and 0 deletions
86
homes/modules/programs/yazi/yazi.nix
Normal file
86
homes/modules/programs/yazi/yazi.nix
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
{ config, inputs, lib, pkgs, ... }:
|
||||
{
|
||||
# optional dependencies can be found here:
|
||||
# https://yazi-rs.github.io/docs/installation/
|
||||
home.packages = with pkgs; [ # dependencies
|
||||
ripdrag
|
||||
];
|
||||
|
||||
programs.yazi = {
|
||||
enable = true;
|
||||
enableZshIntegration = false; # i mod"if"ied the script in my .zshrc
|
||||
|
||||
settings = {
|
||||
mgr = {
|
||||
show_hidden = true;
|
||||
};
|
||||
log = {
|
||||
enabled = false;
|
||||
};
|
||||
};
|
||||
|
||||
keymap = {
|
||||
mgr.prepend_keymap = [
|
||||
# drag and drop!!
|
||||
{ on = [ "<S-c>" ]; run = ''shell "ripdrag -x -a \"$@\"" --confirm''; }
|
||||
# copy hovered file to clipboard
|
||||
{ on = [ "<S-y>" ]; run = ''shell -- path=%h; echo "file://$path" | wl-copy -t text/uri-list''; }
|
||||
];
|
||||
};
|
||||
|
||||
# they changed it to custom colors, i don't like that, so this is the config
|
||||
# i did like:
|
||||
# https://github.com/sxyazi/yazi/blob/97d0c6bb23df413f4add8b888071233c912c49a3/yazi-config/preset/theme-dark.toml
|
||||
theme = {
|
||||
icon = {
|
||||
dirs = [
|
||||
{ name = ".config"; text = ""; fg = "red"; }
|
||||
{ name = ".git"; text = ""; fg = "blue"; }
|
||||
{ name = ".github"; text = ""; fg = "blue"; }
|
||||
{ name = ".npm"; text = ""; fg = "blue"; }
|
||||
{ name = "Desktop"; text = ""; fg = "magenta"; }
|
||||
{ name = "Documents"; text = ""; fg = "magenta"; }
|
||||
{ name = "Downloads"; text = ""; fg = "red"; }
|
||||
{ name = "Library"; text = ""; fg = "magenta"; }
|
||||
{ name = "Movies"; text = ""; fg = "magenta"; }
|
||||
{ name = "Music"; text = ""; fg = "magenta"; }
|
||||
{ name = "Pictures"; text = ""; fg = "magenta"; }
|
||||
{ name = "Public"; text = ""; fg = "magenta"; }
|
||||
{ name = "Videos"; text = ""; fg = "red"; }
|
||||
];
|
||||
conds = [
|
||||
# special files
|
||||
{ "if" = "orphan"; text = ""; }
|
||||
{ "if" = "link"; text = ""; }
|
||||
{ "if" = "block"; text = ""; }
|
||||
{ "if" = "char"; text = ""; }
|
||||
{ "if" = "fifo"; text = ""; }
|
||||
{ "if" = "sock"; text = ""; }
|
||||
{ "if" = "sticky"; text = ""; }
|
||||
{ "if" = "dummy"; text = ""; }
|
||||
|
||||
# fallback
|
||||
{ "if" = "dir"; text = ""; fg = "blue"; }
|
||||
{ "if" = "exec"; text = ""; }
|
||||
{ "if" = "!dir"; text = ""; }
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# helped me fix it not working:
|
||||
# https://github.com/hunkyburrito/xdg-desktop-portal-termfilechooser/issues/56
|
||||
# also, the portal must be enabled in configuration.nix
|
||||
# i can't seem to get it working any other way
|
||||
xdg.configFile."xdg-desktop-portal-termfilechooser/config" = {
|
||||
force = true;
|
||||
text = ''
|
||||
[filechooser]
|
||||
cmd=${pkgs.xdg-desktop-portal-termfilechooser}/share/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh
|
||||
default_dir=$HOME
|
||||
env=TERMCMD='kitty --title filechooser'
|
||||
open_mode=suggested
|
||||
save_mode=last
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue