yazi: bettr integration (waiting for home-manager stable release)
This commit is contained in:
parent
9251438253
commit
31f7c9e801
2 changed files with 33 additions and 9 deletions
|
|
@ -1,11 +1,12 @@
|
||||||
{ pkgs, lib, ... }: {
|
{ pkgs, lib, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
./nautilus.nix
|
|
||||||
# ./thunar.nix
|
|
||||||
./nemo.nix
|
|
||||||
./terminator.nix
|
|
||||||
# ./alacritty.nix
|
# ./alacritty.nix
|
||||||
./kitty.nix
|
./kitty.nix
|
||||||
|
# ./nautilus.nix
|
||||||
|
./nemo.nix
|
||||||
|
./terminator.nix
|
||||||
|
# ./thunar.nix
|
||||||
|
./yazi.nix
|
||||||
];
|
];
|
||||||
home.packages = builtins.attrValues {
|
home.packages = builtins.attrValues {
|
||||||
inherit (pkgs)
|
inherit (pkgs)
|
||||||
|
|
@ -16,8 +17,19 @@
|
||||||
let
|
let
|
||||||
primaryTerminal = "kitty";
|
primaryTerminal = "kitty";
|
||||||
secondaryTerminal = "terminator";
|
secondaryTerminal = "terminator";
|
||||||
fileManager = "nemo";
|
fileManager =
|
||||||
secondaryFileManager = "nautilus";
|
let
|
||||||
|
ya = pkgs.writeShellScript "ya" ''
|
||||||
|
tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
||||||
|
yazi --cwd-file="$tmp"
|
||||||
|
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||||
|
cd -- "$cwd"
|
||||||
|
fi
|
||||||
|
rm -f -- "$tmp"
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
"kitty -e bash ${ya}";
|
||||||
|
secondaryFileManager = "nemo";
|
||||||
emojiChooser = "rofimoji --skin-tone light -a copy";
|
emojiChooser = "rofimoji --skin-tone light -a copy";
|
||||||
windowSwitcher = "rofi -show window";
|
windowSwitcher = "rofi -show window";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,20 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
let tomlGenerate = (pkgs.formats.toml { }).generate; in
|
let
|
||||||
|
tomlGenerate = (pkgs.formats.toml { }).generate;
|
||||||
|
bashIntegration = ''
|
||||||
|
function ya() {
|
||||||
|
tmp="$(mktemp -t "yazi-cwd.XXXXX")"
|
||||||
|
yazi --cwd-file="$tmp"
|
||||||
|
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||||
|
cd -- "$cwd"
|
||||||
|
fi
|
||||||
|
rm -f -- "$tmp"
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
in
|
||||||
{
|
{
|
||||||
home.packages = [ pkgs.unstable_pkgs.yazi pkgs.ffmpegthumbnailer pkgs.exiftool pkgs.mediainfo ];
|
home.packages = [ pkgs.unstable_pkgs.yazi pkgs.ffmpegthumbnailer pkgs.exiftool pkgs.mediainfo ];
|
||||||
|
|
||||||
home.shellAliases."yz" = "yazi";
|
|
||||||
|
|
||||||
xdg.configFile."yazi/yazi.toml".source = tomlGenerate "yazi.toml" {
|
xdg.configFile."yazi/yazi.toml".source = tomlGenerate "yazi.toml" {
|
||||||
manager = {
|
manager = {
|
||||||
sort_by = "natural";
|
sort_by = "natural";
|
||||||
|
|
@ -49,5 +59,7 @@ let tomlGenerate = (pkgs.formats.toml { }).generate; in
|
||||||
# enableBashIntegration = true;
|
# enableBashIntegration = true;
|
||||||
# enableZshIntegration = true;
|
# enableZshIntegration = true;
|
||||||
# };
|
# };
|
||||||
|
programs.bash.initExtra = bashIntegration;
|
||||||
|
programs.zsh.initExtra = bashIntegration;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue