lf toogle
This commit is contained in:
parent
d444b47af8
commit
0d3d654659
@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
smayzy.webapps.enable = true;
|
smayzy.webapps.enable = true;
|
||||||
|
|
||||||
|
smayzy.lf.enable = true;
|
||||||
|
|
||||||
home.username = "smayzy";
|
home.username = "smayzy";
|
||||||
home.homeDirectory = "/home/smayzy";
|
home.homeDirectory = "/home/smayzy";
|
||||||
home.stateVersion = "25.05";
|
home.stateVersion = "25.05";
|
||||||
|
|||||||
@ -1,75 +1,86 @@
|
|||||||
{ pkgs, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf mkOption types;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
xdg.configFile."lf/icons".source = ./icons;
|
options.smayzy.lf.enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "set to true if you want to use a nvidia GC";
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
programs.lf = {
|
config = mkIf config.smayzy.lf.enable {
|
||||||
enable = true;
|
xdg.configFile."lf/icons".source = ./icons;
|
||||||
commands = {
|
|
||||||
dragon-out = ''%${pkgs.xdragon}/bin/xdragon -a -x "$fx"'';
|
programs.lf = {
|
||||||
editor-open = ''$$EDITOR $f'';
|
enable = true;
|
||||||
mkdir = ''
|
commands = {
|
||||||
''${{
|
dragon-out = ''%${pkgs.xdragon}/bin/xdragon -a -x "$fx"'';
|
||||||
printf "Directory Name: "
|
editor-open = ''$$EDITOR $f'';
|
||||||
read DIR
|
mkdir = ''
|
||||||
mkdir $DIR
|
''${{
|
||||||
}}
|
printf "Directory Name: "
|
||||||
'';
|
read DIR
|
||||||
};
|
mkdir $DIR
|
||||||
|
}}
|
||||||
keybindings = {
|
'';
|
||||||
|
};
|
||||||
"\\\"" = "";
|
|
||||||
o = "";
|
keybindings = {
|
||||||
c = "mkdir";
|
|
||||||
"." = "set hidden!";
|
"\\\"" = "";
|
||||||
"`" = "mark-load";
|
o = "";
|
||||||
"\\'" = "mark-load";
|
c = "mkdir";
|
||||||
"<enter>" = "open";
|
"." = "set hidden!";
|
||||||
|
"`" = "mark-load";
|
||||||
do = "dragon-out";
|
"\\'" = "mark-load";
|
||||||
|
"<enter>" = "open";
|
||||||
"g~" = "cd";
|
|
||||||
gh = "cd";
|
|
||||||
"g/" = "/";
|
|
||||||
|
|
||||||
ee = "editor-open";
|
|
||||||
V = ''$${pkgs.bat}/bin/bat --paging=always --theme=gruvbox "$f"'';
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
preview = true;
|
|
||||||
hidden = true;
|
|
||||||
drawbox = true;
|
|
||||||
icons = true;
|
|
||||||
ignorecase = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
extraConfig =
|
|
||||||
let
|
|
||||||
previewer =
|
|
||||||
pkgs.writeShellScriptBin "pv.sh" ''
|
|
||||||
file=$1
|
|
||||||
w=$2
|
|
||||||
h=$3
|
|
||||||
x=$4
|
|
||||||
y=$5
|
|
||||||
|
|
||||||
if [[ "$( ${pkgs.file}/bin/file -Lb --mime-type "$file")" =~ ^image ]]; then
|
do = "dragon-out";
|
||||||
${pkgs.kitty}/bin/kitty +kitten icat --silent --stdin no --transfer-mode file --place "''${w}x''${h}@''${x}x''${y}" "$file" < /dev/null > /dev/tty
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
${pkgs.pistol}/bin/pistol "$file"
|
"g~" = "cd";
|
||||||
|
gh = "cd";
|
||||||
|
"g/" = "/";
|
||||||
|
|
||||||
|
ee = "editor-open";
|
||||||
|
V = ''$${pkgs.bat}/bin/bat --paging=always --theme=gruvbox "$f"'';
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
preview = true;
|
||||||
|
hidden = true;
|
||||||
|
drawbox = true;
|
||||||
|
icons = true;
|
||||||
|
ignorecase = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig =
|
||||||
|
let
|
||||||
|
previewer =
|
||||||
|
pkgs.writeShellScriptBin "pv.sh" ''
|
||||||
|
file=$1
|
||||||
|
w=$2
|
||||||
|
h=$3
|
||||||
|
x=$4
|
||||||
|
y=$5
|
||||||
|
|
||||||
|
if [[ "$( ${pkgs.file}/bin/file -Lb --mime-type "$file")" =~ ^image ]]; then
|
||||||
|
${pkgs.kitty}/bin/kitty +kitten icat --silent --stdin no --transfer-mode file --place "''${w}x''${h}@''${x}x''${y}" "$file" < /dev/null > /dev/tty
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
${pkgs.pistol}/bin/pistol "$file"
|
||||||
|
'';
|
||||||
|
cleaner = pkgs.writeShellScriptBin "clean.sh" ''
|
||||||
|
${pkgs.kitty}/bin/kitty +kitten icat --clear --stdin no --silent --transfer-mode file < /dev/null > /dev/tty
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
''
|
||||||
|
set cleaner ${cleaner}/bin/clean.sh
|
||||||
|
set previewer ${previewer}/bin/pv.sh
|
||||||
'';
|
'';
|
||||||
cleaner = pkgs.writeShellScriptBin "clean.sh" ''
|
};
|
||||||
${pkgs.kitty}/bin/kitty +kitten icat --clear --stdin no --silent --transfer-mode file < /dev/null > /dev/tty
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
''
|
|
||||||
set cleaner ${cleaner}/bin/clean.sh
|
|
||||||
set previewer ${previewer}/bin/pv.sh
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user