mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 01:58:12 +09:00
nani
This commit is contained in:
@@ -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")
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user