feat: correct neomutt keybinds, add rdrview
Some checks are pending
Check flake / check (push) Waiting to run

This commit is contained in:
Youwen Wu 2024-12-28 04:02:00 -08:00
parent 24a30547d5
commit 44bc095527
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3
4 changed files with 240 additions and 1 deletions

View file

@ -0,0 +1,45 @@
{
lib,
stdenv,
fetchFromGitHub,
libxml2,
curl,
libseccomp,
installShellFiles,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "rdrview";
version = "0.1.3";
src = fetchFromGitHub {
owner = "eafer";
repo = "rdrview";
rev = "v${finalAttrs.version}";
hash = "sha256-UFHRsaLGa/jv/S+VXtXIMgLuQUPgqbRgD35bBrJyuZA=";
};
buildInputs = [
libxml2
curl
libseccomp
];
nativeBuildInputs = [ installShellFiles ];
installPhase = ''
runHook preInstall
install -Dm755 rdrview -t $out/bin
installManPage rdrview.1
runHook postInstall
'';
enableParallelBuilding = true;
meta = with lib; {
description = "Command line tool to extract main content from a webpage";
homepage = "https://github.com/eafer/rdrview";
license = licenses.asl20;
maintainers = with maintainers; [ djanatyn ];
mainProgram = "rdrview";
};
})

View file

@ -4,5 +4,6 @@ let
in
final: prev: {
modrinth-app = callPackage ./by-name/modrinth-app { };
hyprland-qtutils = callPackage ./by-name/hyprland-qtutils { };
# hyprland-qtutils = callPackage ./by-name/hyprland-qtutils { };
rdrview = callPackage ./by-name/rdrview { };
}

View file

@ -111,4 +111,18 @@ in
text/html; ${pkgs.w3m}/bin/w3m %s; nametemplate=%s.html; needsterminal
text/html; ${pkgs.w3m}/bin/w3m -v -F -T text/html -dump %s; copiousoutput
'';
home.file.".w3m/config".text = ''
inline_img_protocol 4
imgdisplay kitty
display_link_number 1
'';
home.file.".w3m/keymap".text =
(builtins.readFile ./vimkeys.w3m)
+ ''
keymap R COMMAND "READ_SHELL '${pkgs.rdrview}/bin/rdrview $W3M_URL -H 2> /dev/null 1> /tmp/readable.html' ; LOAD /tmp/readable.html"
keymap f COMMAND "RESHAPE ; LINK_BEGIN ; GOTO_LINK"
keymap F COMMAND "RESHAPE ; LINK_BEGIN ; TAB_LINK"
'';
}

View file

@ -0,0 +1,179 @@
# Removing Defaults
keymap + NULL
keymap C-v NULL
keymap SPC NULL
keymap ^[[6~ NULL
keymap - NULL
keymap ESC-v NULL
keymap ^[[5~ NULL
keymap b NULL
keymap C-f NULL
keymap C-b NULL
keymap C-f NULL
keymap C-b NULL
keymap C-n NULL
keymap C-p NULL
keymap J NULL
keymap K NULL
keymap > NULL
keymap < NULL
keymap , NULL
keymap . NULL
keymap C-a NULL
keymap ^ NULL
keymap $ NULL
keymap C-e NULL
keymap 0 NULL
keymap Z NULL
keymap z NULL
keymap w NULL
keymap W NULL
keymap b NULL
keymap ESC-g NULL
keymap ESC-< NULL
keymap ESC-> NULL
keymap ^[[1~ NULL
keymap ^[[4~ NULL
keymap G NULL
keymap g NULL
keymap [ NULL
keymap ] NULL
keymap TAB NULL
keymap C-u NULL
keymap ESC-TAB NULL
keymap ^[[Z NULL
keymap ESC-m NULL
keymap u NULL
keymap C-r NULL
keymap C-j NULL
keymap C-m NULL
keymap C-t NULL
keymap ESC-C-j NULL
keymap ESC-C-m NULL
keymap a NULL
keymap I NULL
keymap ESC-I NULL
keymap c NULL
keymap u NULL
keymap i NULL
keymap = NULL
keymap C-g NULL
keymap : NULL
keymap ";" NULL
keymap ESC-: NULL
keymap F NULL
keymap M NULL
keymap ESC-M NULL
keymap L NULL
keymap ESC-l NULL
keymap U NULL
keymap ESC-u NULL
keymap V NULL
keymap @ NULL
keymap "#" NULL
keymap | NULL
keymap B NULL
keymap C-_ NULL
keymap s NULL
keymap v NULL
keymap ESC-s NULL
keymap S NULL
keymap E NULL
keymap ESC-e NULL
keymap R NULL
keymap r NULL
keymap C-l NULL
keymap T NULL
keymap C-q NULL
keymap { NULL
keymap } NULL
keymap ESC-t NULL
keymap J NULL
keymap K NULL
keymap ESC-b NULL
keymap ESC-a NULL
keymap / NULL
keymap ? NULL
keymap n NULL
keymap N NULL
keymap C-s NULL
keymap C-r NULL
keymap ESC-w NULL
keymap ESC-W NULL
keymap C-@ NULL
keymap ESC-n NULL
keymap ESC-p NULL
keymap \" NULL
keymap ^[[28~ NULL
keymap ^[[2~ NULL
keymap ^[[E NULL
keymap ^[[L NULL
keymap H NULL
keymap o NULL
keymap r NULL
keymap C-k NULL
keymap C-h NULL
keymap D NULL
keymap m NULL
keymap C-w NULL
keymap ESC-c NULL
keymap ESC-o NULL
keymap ESC-k NULL
keymap ! NULL
keymap C-z NULL
keymap q NULL
keymap Q NULL
# New keybinds
# Navigation
keymap $ LINE_END
keymap ^ LINE_BEGIN
keymap 0 LINE_BEGIN
keymap G END
keymap gg BEGIN
keymap ESC-g GOTO_LINE
keymap w NEXT_WORD
keymap b PREV_WORD
# NPage Navigation
keymap j COMMAND "MOVE_DOWN1"
keymap k COMMAND "MOVE_UP1"
# Undo
keymap C-r REDO
#keymap C-f NEXT_PAGE
keymap C-f COMMAND "NEXT_PAGE"
#keymap C-b PREV_PAGE
keymap C-b COMMAND "PREV_PAGE"
keymap H BACK
keymap r RELOAD
# Tab stuff
keymap J NEXT_TAB
keymap K PREV_TAB
keymap o GOTO
keymap O TAB_GOTO
# Search
keymap / WHEREIS
keymap ? SEARCH_BACK
keymap n SEARCH_NEXT
keymap N SEARCH_PREV
# Commands
keymap :: COMMAND
keymap :help HELP
keymap :downloads DOWNLOAD_LIST
#keymap :hist HISTORY
keymap :settings OPTIONS
keymap ZZ EXIT
keymap C-Q EXIT
keymap ZQ QUIT
keymap :q QUIT
# copy url to clipboard
keymap yy EXTERN 'printf %s | wl-clipboard'