mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 01:18:30 +09:00
normcap-translate
This commit is contained in:
Generated
+6
-6
@@ -663,17 +663,17 @@
|
||||
"nixpkgs": "nixpkgs_5"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1785856454,
|
||||
"narHash": "sha256-7f2AfONkRN5XpCUjN0TAO1Qlk/YImDCM28vDcC1mppI=",
|
||||
"lastModified": 1785857772,
|
||||
"narHash": "sha256-JMEQH9x8Pb9cHW4JbWfFBcqxsh4JkPDR5k8dCnphUTU=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "e0e919b6cc4eab40afe02f4ed72b93ed383674db",
|
||||
"revCount": 6,
|
||||
"rev": "9d6fec627a620841c27c7e67e8e7b5719ce9b465",
|
||||
"revCount": 8,
|
||||
"type": "git",
|
||||
"url": "https://github.com/zunoser/nani-translate-linux-mirror.git"
|
||||
"url": "https://github.com/zunoser/nani-translate-linux.git"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zunoser/nani-translate-linux-mirror.git"
|
||||
"url": "https://github.com/zunoser/nani-translate-linux.git"
|
||||
}
|
||||
},
|
||||
"niri-flake": {
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nani-translate-linux.url = "git+https://github.com/zunoser/nani-translate-linux-mirror.git";
|
||||
nani-translate-linux.url = "git+https://github.com/zunoser/nani-translate-linux.git";
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -125,6 +125,7 @@ in
|
||||
(execute "W-l" "loginctl lock-session")
|
||||
(execute "W-v" "vicinae vicinae://launch/clipboard/history?toggle=true")
|
||||
(execute "W-j" "nani-translate-primary")
|
||||
(execute "W-S-j" "normcap-translate")
|
||||
(execute "W-C-j" "${lib.getExe' pkgs.xdg-utils "xdg-open"} naniapp://translate")
|
||||
(execute "W-space" "ghostty +toggle-quick-terminal")
|
||||
(execute "W-p" "wdisplays")
|
||||
|
||||
@@ -117,6 +117,11 @@ in
|
||||
action.spawn = [ "nani-translate-primary" ];
|
||||
hotkey-overlay.title = "Translate Primary Selection";
|
||||
};
|
||||
"Mod+Shift+J" = {
|
||||
repeat = false;
|
||||
action.spawn = [ "normcap-translate" ];
|
||||
hotkey-overlay.title = "OCR and Translate with Nani";
|
||||
};
|
||||
"Mod+Ctrl+J" = {
|
||||
repeat = false;
|
||||
action.spawn = [
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
normcap = pkgs.normcap.override {
|
||||
tesseract4 = pkgs.tesseract4.override {
|
||||
enableLanguages = [
|
||||
"chi_sim"
|
||||
"jpn"
|
||||
"eng"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
normcapTranslate = pkgs.writeShellApplication {
|
||||
name = "normcap-translate";
|
||||
|
||||
runtimeInputs = [
|
||||
normcap
|
||||
pkgs.jq
|
||||
pkgs.xdg-utils
|
||||
];
|
||||
|
||||
text = ''
|
||||
captured_text="$(
|
||||
normcap \
|
||||
--cli-mode \
|
||||
--screenshot-handler grim \
|
||||
--show-introduction False \
|
||||
--update False \
|
||||
--detect-codes False \
|
||||
--notification False \
|
||||
-l jpn eng chi_sim
|
||||
)" || exit 0
|
||||
[ -n "$captured_text" ] || exit 0
|
||||
encoded_text="$(printf '%s' "$captured_text" | jq -sRr @uri)"
|
||||
exec xdg-open "naniapp://translate?source=$encoded_text"
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
home.packages = [
|
||||
normcap
|
||||
normcapTranslate
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
description = "NormCap OCR screen capture";
|
||||
|
||||
includes = [
|
||||
"applications.nani"
|
||||
];
|
||||
}
|
||||
@@ -13,6 +13,7 @@
|
||||
"applications.loupe"
|
||||
"applications.linux-wallpaperengine"
|
||||
"applications.nautilus"
|
||||
"applications.normcap"
|
||||
"applications.papers"
|
||||
"applications.qalculate-gtk"
|
||||
"applications.resources"
|
||||
|
||||
Reference in New Issue
Block a user