1

Compare commits

..

3 Commits

3 changed files with 137 additions and 58 deletions

View File

@ -165,6 +165,10 @@ rec {
"discord" "discord"
"vesktop" "vesktop"
]; ];
"10" = [
"python3"
];
}; };
floating = [ floating = [
@ -319,6 +323,7 @@ rec {
tealdeer # very fast tldr (so readable man) tealdeer # very fast tldr (so readable man)
killall killall
atool # Archive preview atool # Archive preview
ouch # unified compression/decompression
ffmpegthumbnailer # Video thumbnails ffmpegthumbnailer # Video thumbnails
mediainfo # Media meta information mediainfo # Media meta information
file # File meta information file # File meta information
@ -655,26 +660,51 @@ rec {
''; '';
}; };
yazi = let yazi = {
yazi-plugins = pkgs.fetchFromGitHub {
owner = "yazi-rs";
repo = "plugins";
rev = "63f9650e522336e0010261dcd0ffb0bf114cf912"; # NOTE: Refresh after system updates depending on the yazi version
hash = "sha256-ZCLJ6BjMAj64/zM606qxnmzl2la4dvO/F5QFicBEYfU=";
};
yazi-starship = pkgs.fetchFromGitHub {
owner = "Rolv-Apneseth";
repo = "starship.yazi";
rev = "6a0f3f788971b155cbc7cec47f6f11aebbc148c9";
sha256 = "sha256-q1G0Y4JAuAv8+zckImzbRvozVn489qiYVGFQbdCxC98=";
};
in {
enable = true; enable = true;
enableFishIntegration = true; enableFishIntegration = true;
shellWrapperName = "y"; shellWrapperName = "y";
plugins = {
inherit (pkgs.yaziPlugins) chmod diff full-border git lazygit mount ouch rsync smart-paste starship sudo;
};
initLua = ''
-- Load plugins
require("full-border"):setup()
require("starship"):setup()
require("git"):setup()
-- Show symlink in status bar
Status:children_add(function(self)
local h = self._current.hovered
if h and h.link_to then
return " -> " .. tostring(h.link_to)
else
return ""
end
end, 3300, Status.LEFT)
-- Show user:group in status bar
Status:children_add(function()
local h = cx.active.current.hovered
if not h or ya.target_family() ~= "unix" then
return ""
end
return ui.Line {
ui.Span(ya.user_name(h.cha.uid) or tostring(h.cha.uid)):fg("magenta"),
":",
ui.Span(ya.group_name(h.cha.gid) or tostring(h.cha.gid)):fg("magenta"),
" ",
}
end, 500, Status.RIGHT)
'';
# https://yazi-rs.github.io/docs/configuration/yazi # https://yazi-rs.github.io/docs/configuration/yazi
# "$n": The n-th selected file (1...n)
# "$@": All selected files
# "$0": The hovered file
settings = { settings = {
mgr = { mgr = {
show_hidden = false; show_hidden = false;
@ -689,20 +719,26 @@ rec {
{ {
run = ''vlc "$@"''; run = ''vlc "$@"'';
orphan = true; orphan = true;
for = "unix"; desc = "Play selection";
} }
]; ];
edit = [ edit = [
{ {
run = ''$EDITOR "$@"''; run = ''$EDITOR "$@"'';
block = true; block = true;
for = "unix"; desc = "Edit selection";
} }
]; ];
open = [ open = [
{ {
run = ''xdg-open "$@"''; run = ''xdg-open "$@"'';
desc = "Open"; desc = "Open selection";
}
];
extract = [
{
run = ''ouch decompress -y "$@"'';
desc = "Extract selection";
} }
]; ];
}; };
@ -724,23 +760,39 @@ rec {
run = "git"; run = "git";
} }
]; ];
};
plugins = { plugin.prepend_previewers = [
full-border = "${yazi-plugins}/full-border.yazi"; {
starship = "${yazi-starship}"; mime = "application/*zip";
git = "${yazi-plugins}/git.yazi"; run = "ouch";
mount = "${yazi-plugins}/mount.yazi"; }
chmod = "${yazi-plugins}/chmod.yazi"; {
# toggle-pane = "${yazi-plugins}/toggle-pane.yazi"; mime = "application/x-tar";
run = "ouch";
}
{
mime = "application/x-bzip2";
run = "ouch";
}
{
mime = "application/x-7z-compressed";
run = "ouch";
}
{
mime = "application/x-rar";
run = "ouch";
}
{
mime = "application/x-xz";
run = "ouch";
}
{
mime = "application/xz";
run = "ouch";
}
];
}; };
initLua = ''
require("full-border"):setup()
require("starship"):setup()
require("git"):setup()
'';
keymap = { keymap = {
input.prepend_keymap = [ input.prepend_keymap = [
{ {
@ -753,30 +805,56 @@ rec {
mgr.prepend_keymap = [ mgr.prepend_keymap = [
{ {
on = "M"; on = ["<C-p>" "m"];
run = "plugin mount"; run = "plugin mount";
desc = "Manage device mounts"; desc = "Manage device mounts";
} }
{ {
on = ["C"]; on = ["<C-p>" "c"];
run = "plugin chmod"; run = "plugin chmod";
desc = "Chmod on selected files"; desc = "Chmod selection";
} }
{
on = ["<C-p>" "g"];
run = "plugin lazygit";
desc = "Run LazyGit";
}
{
on = ["<C-p>" "a"];
run = "plugin ouch";
desc = "Add selection to archive";
}
{
on = ["<C-p>" "d"];
run = ''shell -- ripdrag -a -n "$@"'';
desc = "Drag & drop selection";
}
{
on = ["<C-p>" "D"];
run = "plugin diff";
desc = "Diff the selected with the hovered file";
}
{
on = ["<C-p>" "r"];
run = "plugin rsync";
desc = "Copy files using rsync";
}
{ {
on = "!"; on = "!";
run = ''shell "$SHELL" --block''; run = ''shell "$SHELL" --block'';
desc = "Open $SHELL here"; desc = "Open $SHELL here";
} }
{
on = "<C-n>";
run = ''shell -- ripdrag -a -n "$@"''; # $@: all selected files, $0: the hovered file, $n: the nth selected file
desc = "Expose files in ripdrag";
}
{ {
on = "y"; on = "y";
run = [''shell -- for path in "$@"; do echo "file://$path"; done | wl-copy -t text/uri-list'' "yank"]; run = [''shell -- for path in "$@"; do echo "file://$path"; done | wl-copy -t text/uri-list'' "yank"];
desc = "Copy files to system clipboard on yank"; desc = "Copy files to system clipboard on yank";
} }
{
on = "p";
run = "plugin smart-paste";
desc = "Paste into hovered directory or CWD";
}
]; ];
}; };
}; };

View File

@ -67,6 +67,7 @@ in {
"class:^(Spotify)$" = ""; "class:^(Spotify)$" = "";
"class:^(discord)$" = ""; "class:^(discord)$" = "";
"class:^(Zotero)$" = ""; "class:^(Zotero)$" = "";
"class:^(org.zealdocs.zeal)$" = "󰞋";
}; };
# https://github.com/Jas-SinghFSU/HyprPanel/blob/master/src/configuration/modules/theme/bar/index.ts # https://github.com/Jas-SinghFSU/HyprPanel/blob/master/src/configuration/modules/theme/bar/index.ts

View File

@ -364,12 +364,6 @@ _: let
action = "<cmd>lua Snacks.picker.todo_comments()<cr>"; action = "<cmd>lua Snacks.picker.todo_comments()<cr>";
options.desc = "List TODOs"; options.desc = "List TODOs";
} }
{
mode = "n";
key = "<leader>D";
action = "<cmd>Trouble todo toggle focus=false win.position=right<cr>";
options.desc = "Toggle TODOs";
}
{ {
mode = "n"; mode = "n";
key = "<leader>/"; key = "<leader>/";
@ -588,12 +582,12 @@ _: let
leader-tabs = [ leader-tabs = [
{ {
mode = "n"; mode = "n";
key = "<leader>t"; key = "<leader>T";
action = "+tab"; action = "+tab";
} }
# { # {
# mode = "n"; # mode = "n";
# key = "<leader>tt"; # key = "<leader>Tt";
# action = "<cmd>Telescope telescope-tabs list_tabs<cr>"; # action = "<cmd>Telescope telescope-tabs list_tabs<cr>";
# options.desc = "List Tabpages"; # options.desc = "List Tabpages";
# } # }
@ -605,25 +599,25 @@ _: let
# } # }
{ {
mode = "n"; mode = "n";
key = "<leader>tn"; key = "<leader>Tn";
action = "<cmd>tabnext<cr>"; action = "<cmd>tabnext<cr>";
options.desc = "Next Tabpage"; options.desc = "Next Tabpage";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>tp"; key = "<leader>Tp";
action = "<cmd>tabprevious<cr>"; action = "<cmd>tabprevious<cr>";
options.desc = "Previous Tabpage"; options.desc = "Previous Tabpage";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>tN"; key = "<leader>TN";
action = "<cmd>tabnew<cr>"; action = "<cmd>tabnew<cr>";
options.desc = "New Tabpage"; options.desc = "New Tabpage";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>td"; key = "<leader>Td";
action = "<cmd>tabclose<cr>"; action = "<cmd>tabclose<cr>";
options.desc = "Close Tabpage"; options.desc = "Close Tabpage";
} }
@ -810,36 +804,42 @@ _: let
# Toggles # Toggles
{ {
mode = "n"; mode = "n";
key = "<leader>ct"; key = "<leader>t";
action = "+toggle"; action = "+toggle";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>ctd"; key = "<leader>td";
action = "<cmd>ToggleInlineDiagnostics<cr>"; action = "<cmd>ToggleInlineDiagnostics<cr>";
options.desc = "Inline Diagnostics"; options.desc = "Inline Diagnostics";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>ctD"; key = "<leader>tt";
action = "<cmd>Trouble diagnostics toggle focus=false win.position=bottom<cr>"; action = "<cmd>Trouble diagnostics toggle focus=false win.position=bottom<cr>";
options.desc = "Trouble Diagnostics"; options.desc = "Trouble Diagnostics";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>cts"; key = "<leader>tD";
action = "<cmd>Trouble todo toggle focus=false win.position=bottom<cr>";
options.desc = "Toggle TODOs";
}
{
mode = "n";
key = "<leader>ts";
action = "<cmd>Trouble symbols toggle focus=false win.position=right<cr>"; action = "<cmd>Trouble symbols toggle focus=false win.position=right<cr>";
options.desc = "Trouble Symbols"; options.desc = "Trouble Symbols";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>ctf"; key = "<leader>tf";
action = "<cmd>ToggleAutoformat<cr>"; action = "<cmd>ToggleAutoformat<cr>";
options.desc = "Format on Save"; options.desc = "Format on Save";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>ctl"; key = "<leader>tl";
action = "<cmd>ToggleAutoLint<cr>"; action = "<cmd>ToggleAutoLint<cr>";
options.desc = "Lint on Save"; options.desc = "Lint on Save";
} }