fix: fcitx5 may overwrite its profile file

This commit is contained in:
ryan4yin
2023-05-10 16:53:53 +08:00
parent 1237c68b8f
commit 42c24dbb6f
8 changed files with 10 additions and 3566 deletions

View File

@@ -29,7 +29,6 @@ sudo nixos-rebuild switch --flake .#nixos-test
# deploy my PC's configuration
rm -rf ~/.config/fcitx5/profile ~/.config/mimeapps.list # this file may be covered by fcitx5, so remove it first
sudo nixos-rebuild switch --flake .#msi-rtx4090
```

View File

@@ -16,11 +16,12 @@
home.file.".gtkrc-2.0".source = ./gtkrc-2.0;
home.file.".config/hypr/wallpapers/wallpaper.png".source = ../wallpapers/wallpaper.png;
# need set fcitx5's config dir readonly, to avoid other tools overwrite it.
home.file.".config/fcitx5" = {
source = ./fcitx5;
recursive = true;
};
home.file.".config/fcitx5/profile".source = ./profile;
# fcitx5 每次切换输入法,就会修改 ~/.config/fcitx5/profile 文件,导致我用 hm 管理的配置被覆盖
# 解决方法是通过如下内置,每次 rebuild 前都先删除下 profile 文件
home.activation.removeExistingFcitx5Profile = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
rm -f "${config.xdg.configHome}/fcitx5/profile"
'';
# allow fontconfig to discover fonts and configurations installed through home.packages
fonts.fontconfig.enable = true;

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +0,0 @@
# Hidden Notifications
HiddenNotifications=

View File

@@ -1,75 +0,0 @@
[Hotkey]
# Enumerate when press trigger key repeatedly
EnumerateWithTriggerKeys=True
# Skip first input method while enumerating
EnumerateSkipFirst=False
[Hotkey/TriggerKeys]
0=Control+space
1=Zenkaku_Hankaku
2=Hangul
[Hotkey/AltTriggerKeys]
0=Shift_L
[Hotkey/EnumerateForwardKeys]
0=Control+Shift_L
[Hotkey/EnumerateBackwardKeys]
0=Control+Shift_R
[Hotkey/EnumerateGroupForwardKeys]
0=Super+space
[Hotkey/EnumerateGroupBackwardKeys]
0=Shift+Super+space
[Hotkey/ActivateKeys]
0=Hangul_Hanja
[Hotkey/DeactivateKeys]
0=Hangul_Romaja
[Hotkey/PrevPage]
0=Up
[Hotkey/NextPage]
0=Down
[Hotkey/PrevCandidate]
0=Shift+Tab
[Hotkey/NextCandidate]
0=Tab
[Hotkey/TogglePreedit]
0=Control+Alt+P
[Behavior]
# Active By Default
ActiveByDefault=False
# Share Input State
ShareInputState=No
# Show preedit in application
PreeditEnabledByDefault=True
# Show Input Method Information when switch input method
ShowInputMethodInformation=True
# Show Input Method Information when changing focus
showInputMethodInformationWhenFocusIn=False
# Show compact input method information
CompactInputMethodInformation=True
# Show first input method information
ShowFirstInputMethodInformation=True
# Default page size
DefaultPageSize=5
# Override Xkb Option
OverrideXkbOption=False
# Custom Xkb Option
CustomXkbOption=
# Force Enabled Addons
EnabledAddons=
# Force Disabled Addons
DisabledAddons=
# Preload input method to be used by default
PreloadInputMethod=True

View File

@@ -194,8 +194,6 @@ exec-once=~/.config/hypr/scripts/startup
#-- Fcitx5 input method ----------------------------------------------------
windowrule=pseudo,fcitx # enable this will make fcitx5 works, but fcitx5-configtool will not work!
# set fcitx5's config dir readonly
exec-once=chmod 500 ~/.config/fcitx5
exec-once=fcitx5-remote -r
exec-once=fcitx5 -d --replace
exec-once=fcitx5-remote -r

View File

@@ -48,5 +48,9 @@
# let vscode sync and update its configuration & extensions across devices, using github account.
# userSettings = {};
};
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/web-apps/code-server.nix
};
}