This commit is contained in:
2026-08-04 16:16:32 +09:00
parent 247db71f2d
commit 2a3f7ee6ff
2 changed files with 31 additions and 0 deletions
+2
View File
@@ -124,6 +124,8 @@ in
(execute "W-e" "nautilus --new-window") (execute "W-e" "nautilus --new-window")
(execute "W-l" "loginctl lock-session") (execute "W-l" "loginctl lock-session")
(execute "W-v" "vicinae vicinae://launch/clipboard/history?toggle=true") (execute "W-v" "vicinae vicinae://launch/clipboard/history?toggle=true")
(execute "W-j" "nani-translate-primary")
(execute "W-C-j" "${lib.getExe' pkgs.xdg-utils "xdg-open"} naniapp://translate")
(execute "W-space" "ghostty +toggle-quick-terminal") (execute "W-space" "ghostty +toggle-quick-terminal")
(execute "W-p" "wdisplays") (execute "W-p" "wdisplays")
(execute "W-z" "wl-find-cursor -c 0xCCFF453A -s 160 -d 1200") (execute "W-z" "wl-find-cursor -c 0xCCFF453A -s 160 -d 1200")
+29
View File
@@ -1,8 +1,24 @@
{ lib, pkgs, ... }: { lib, pkgs, ... }:
let let
keybindings = import ./keybindings.nix; keybindings = import ./keybindings.nix;
naniTranslatePrimary = pkgs.writeShellApplication {
name = "nani-translate-primary";
runtimeInputs = with pkgs; [
jq
wl-clipboard
xdg-utils
];
text = ''
selected_text="$(wl-paste --primary --no-newline)" || exit 0
[ -n "$selected_text" ] || exit 0
encoded_text="$(printf '%s' "$selected_text" | jq -sRr @uri)"
exec xdg-open "naniapp://translate?source=$encoded_text"
'';
};
in in
{ {
home.packages = [ naniTranslatePrimary ];
programs.niri.settings = { programs.niri.settings = {
binds = keybindings // { binds = keybindings // {
@@ -96,6 +112,19 @@ in
]; ];
hotkey-overlay.title = "Clipboard History"; hotkey-overlay.title = "Clipboard History";
}; };
"Mod+J" = {
repeat = false;
action.spawn = [ "nani-translate-primary" ];
hotkey-overlay.title = "Translate Primary Selection";
};
"Mod+Ctrl+J" = {
repeat = false;
action.spawn = [
(lib.getExe' pkgs.xdg-utils "xdg-open")
"naniapp://translate"
];
hotkey-overlay.title = "Open Nani Translate";
};
"Mod+Space" = { "Mod+Space" = {
action.spawn = [ action.spawn = [
"ghostty" "ghostty"