keyd, anki

This commit is contained in:
js0ny 2025-11-04 08:49:33 +00:00
parent a32917bd22
commit 6e0352c089
3 changed files with 38 additions and 18 deletions

View file

@ -35,6 +35,7 @@
../../modules/nixos/programs/thunderbird.nix ../../modules/nixos/programs/thunderbird.nix
../../modules/nixos/programs/waydroid.nix ../../modules/nixos/programs/waydroid.nix
../../modules/nixos/programs/wine.nix ../../modules/nixos/programs/wine.nix
../../modules/nixos/programs/dolphin.nix
# services # services
../../modules/nixos/services/docker.nix ../../modules/nixos/services/docker.nix

View file

@ -16,4 +16,11 @@
}; };
}; };
}; };
# See https://github.com/rvaiya/keyd?tab=readme-ov-file#faqs
environment.etc."libinput/local-overrides.quirks".text = ''
[Serial Keyboards]
MatchUdevType=keyboard
MatchName=keyd*keyboard
AttrKeyboardIntegration=internal
'';
} }

View file

@ -1,4 +1,8 @@
{pkgs, ...}: { {
pkgs,
lib,
...
}: {
home.packages = with pkgs; [ home.packages = with pkgs; [
# Terminal Emulator # Terminal Emulator
ghostty # default ghostty # default
@ -57,6 +61,7 @@
kdePackages.krdc kdePackages.krdc
kdePackages.breeze kdePackages.breeze
zotero zotero
anki-bin
# Email # Email
protonmail-bridge protonmail-bridge
@ -64,35 +69,42 @@
birdtray birdtray
]; ];
services.protonmail-bridge.enable = true; home.sessionVariables = {
ANKI_WAYLAND = 1;
GOLDENDICT_FORCE_WAYLAND = 1;
NIXOS_OZONE_WL = 1;
};
xdg.desktopEntries = { xdg.desktopEntries = {
# Force wayland when running goldendict-ng "anki" = {
"io.github.xiaoyifang.goldendict_ng" = { name = "Anki";
name = "GoldenDict-ng"; genericName = "Flashcards";
genericName = "Multiformat Dictionary"; comment = "An intelligent spaced-repetition memory training program";
comment = "A feature-rich dictionary lookup program"; icon = "anki";
icon = "goldendict";
type = "Application"; type = "Application";
terminal = false; terminal = false;
categories = [ categories = [
"Office"
"Dictionary"
"Education" "Education"
"Languages"
"KDE"
"Qt" "Qt"
]; ];
mimeType = [ mimeType = [
"x-scheme-handler/goldendict" "application/x-apkg"
"x-scheme-handler/dict" "application/x-anki"
"application/x-ankiaddon"
]; ];
exec = "env GOLDENDICT_FORCE_WAYLAND=1 ${pkgs.goldendict-ng}/bin/goldendict %u"; # Should specify wayland and IME used
exec = "env ANKI_WAYLAND=1 QT_IM_MODULE=fcitx anki %f";
settings = { settings = {
"GenericName[zh_CN]" = ""; "TryExec" = "anki";
"Comment[zh_CN]" = ""; "Version" = "1.0";
"Keywords" = "dict;dictionary"; "X-GNOME-SingleWindow" = "true";
"Keywords[zh_CN]" = "dict;dictionary;;"; "SingleMainWindow" = "true";
"StartupWMClass" = "GoldenDict-ng"; "StartupWMClass" = "anki";
}; };
}; };
}; };
services.protonmail-bridge.enable = true;
} }