Skip to content
Merged

Dev #277

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f0167bd
Add option to convert double hyphen to em-dash
hthienloc May 1, 2026
111d92a
Add UI option and support keypad minus for em-dash
hthienloc May 1, 2026
3bcbca6
Add modifier check and keypad support for double space
hthienloc May 1, 2026
5942c11
Comment em-dash as UTF-8 literal for clarity
hthienloc May 1, 2026
1c5bcde
Simplify em-dash comment
hthienloc May 1, 2026
a27f626
fix: use std::string instead of const char*
nhktmdzhg May 2, 2026
048e96c
Merge pull request #254 from hthienloc/feat/em-dash-from-double-hyphen
nhktmdzhg May 4, 2026
322f813
feat: Add BracketTransform mode (replace Telex 2) (#257)
hthienloc May 4, 2026
1238425
refactor: remove deleting monitor thread and fallback commit logic
nhktmdzhg May 6, 2026
82db76c
fix: wrap navigation in emoji mode within current page
hthienloc May 8, 2026
e2389f8
refactor: remove unused variable
nhktmdzhg May 9, 2026
beaa6f8
ci/cd: update workflows version
nhktmdzhg May 9, 2026
5c9d97b
fix: missing header
nhktmdzhg May 9, 2026
16ffa48
fix: make App label read-only using setAuxDown (#260)
hthienloc May 9, 2026
88ca31e
fix: wrap navigation in emoji mode within current page (#269)
nhktmdzhg May 9, 2026
4dcd15e
fix: don’t update preedit in fake BS mode
Zebra2711 May 12, 2026
d71042c
Merge pull request #271 from Zebra2711/hotfix-1
nhktmdzhg May 13, 2026
0059e6d
patch: Nix module to support multi users (#275)
hieutran21198 May 14, 2026
973e1a7
Ready bump to 3.1.0
nhktmdzhg May 14, 2026
2e05102
add new contributor
nhktmdzhg May 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@
"contributions": [
"platform"
]
},
{
"login": "hieutran21198",
"name": "Trần Minh Hiếu (Cirius)",
"avatar_url": "https://avatars.githubusercontent.com/u/87953912?v=4",
"profile": "https://github.com/hieutran21198",
"contributions": [
"platform"
]
}
],
"contributorsPerLine": 4,
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Check 📋
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Nix
uses: cachix/install-nix-action@v31
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:

- name: Upload build log
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: build-log
path: build.log
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ refresh-contributor
lotus-version.h
# Logs
*.log
__pycache__/
__pycache__/
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)

project(fcitx5-lotus VERSION 3.0.3)
project(fcitx5-lotus VERSION 3.1.0)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(REQUIRED_FCITX_VERSION 5.0.5)
Expand Down
3 changes: 3 additions & 0 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="25%"><a href="https://github.com/hien-ngo29"><img src="https://avatars.githubusercontent.com/u/98635550?v=4?s=100" width="100px;" alt="Ngo Phu Hien"/><br /><sub><b>Ngo Phu Hien</b></sub></a><br /><a href="https://github.com/LotusInputMethod/fcitx5-lotus/commits?author=hien-ngo29" title="Code">💻</a></td>
<td align="center" valign="top" width="25%"><a href="https://github.com/minhtrancccp"><img src="https://avatars.githubusercontent.com/u/33189614?v=4?s=100" width="100px;" alt="Minh Tran"/><br /><sub><b>Minh Tran</b></sub></a><br /><a href="#platform-minhtrancccp" title="Packaging/porting to new platform">📦</a></td>
</tr>
<tr>
<td align="center" valign="top" width="25%"><a href="https://github.com/hieutran21198"><img src="https://avatars.githubusercontent.com/u/87953912?v=4?s=100" width="100px;" alt="Trần Minh Hiếu (Cirius)"/><br /><sub><b>Trần Minh Hiếu (Cirius)</b></sub></a><br /><a href="#platform-hieutran21198" title="Packaging/porting to new platform">📦</a></td>
</tr>
</tbody>
<tfoot>
<tr>
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ Cảm ơn những con người tuyệt vời ([chú thích emoji](https://allcon
<td align="center" valign="top" width="25%"><a href="https://github.com/hien-ngo29"><img src="https://avatars.githubusercontent.com/u/98635550?v=4?s=100" width="100px;" alt="Ngo Phu Hien"/><br /><sub><b>Ngo Phu Hien</b></sub></a><br /><a href="https://github.com/LotusInputMethod/fcitx5-lotus/commits?author=hien-ngo29" title="Code">💻</a></td>
<td align="center" valign="top" width="25%"><a href="https://github.com/minhtrancccp"><img src="https://avatars.githubusercontent.com/u/33189614?v=4?s=100" width="100px;" alt="Minh Tran"/><br /><sub><b>Minh Tran</b></sub></a><br /><a href="#platform-minhtrancccp" title="Packaging/porting to new platform">📦</a></td>
</tr>
<tr>
<td align="center" valign="top" width="25%"><a href="https://github.com/hieutran21198"><img src="https://avatars.githubusercontent.com/u/87953912?v=4?s=100" width="100px;" alt="Trần Minh Hiếu (Cirius)"/><br /><sub><b>Trần Minh Hiếu (Cirius)</b></sub></a><br /><a href="#platform-hieutran21198" title="Packaging/porting to new platform">📦</a></td>
</tr>
</tbody>
<tfoot>
<tr>
Expand Down
19 changes: 13 additions & 6 deletions bamboo/bamboo-c.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
bool modernStyle;
bool freeMarking;
int w2u;
int bracketTransform;
const char *timeFormat;
const char *dateFormat;
} FcitxBambooEngineOption;
Expand Down Expand Up @@ -122,8 +123,15 @@ func EngineSetOption(engine uintptr, option *C.FcitxBambooEngineOption) {
} else {
flags &= ^bamboo.Ew2uEnabled
}

if int(option.bracketTransform) != 0 {
flags |= bamboo.EbracketTransformEnabled
} else {
flags &= ^bamboo.EbracketTransformEnabled
}
bambooEngine.preeditor.SetFlag(flags)
bambooEngine.preeditor.SetW2UMode(int(option.w2u))
bambooEngine.preeditor.SetBracketTransformMode(int(option.bracketTransform))
bambooEngine.timeFormat = C.GoString(option.timeFormat)
bambooEngine.dateFormat = C.GoString(option.dateFormat)
}
Expand Down Expand Up @@ -270,12 +278,11 @@ func GetInputMethodNames() **C.char {
order := map[string]int{
"Telex": 0,
"VNI": 1,
"Telex 2": 2,
"Telex + VNI": 3,
"Telex + VNI + VIQR": 4,
"VIQR": 5,
"Microsoft layout": 6,
"VNI Bàn phím tiếng Pháp": 7,
"Telex + VNI": 2,
"Telex + VNI + VIQR": 3,
"VIQR": 4,
"Microsoft layout": 5,
"VNI Bàn phím tiếng Pháp": 6,
}
names := make([]string, len(bamboo.InputMethodDefinitions))
i := 0
Expand Down
2 changes: 1 addition & 1 deletion bamboo/bamboo-core
Binary file added bamboo/fcitxbambooengine
Binary file not shown.
78 changes: 68 additions & 10 deletions nix/modules/nixos/fcitx5-lotus/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,88 @@
pkgs,
...
}:
with lib; let
with lib;
let
cfg = config.services.fcitx5-lotus;
fcitx5-lotus = inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.fcitx5-lotus;
in {

legacyUsers = optional (cfg.user != null && cfg.user != "") cfg.user;
effectiveUsers = unique (legacyUsers ++ cfg.users);

syntacticallyInvalidUsers = filter (
user: user == "" || (builtins.match "[A-Za-z_][A-Za-z0-9_-]*" user) == null
) effectiveUsers;

unknownUsers = filter (user: !(builtins.hasAttr user config.users.users)) effectiveUsers;
in
{
options.services.fcitx5-lotus = {
enable = mkEnableOption "Fcitx5 Lotus Server";
enable = mkEnableOption "Fcitx5 Lotus integration";

package = mkOption {
type = types.package;
default = fcitx5-lotus;
defaultText = literalExpression "inputs.self.packages.\${pkgs.stdenv.hostPlatform.system}.fcitx5-lotus";
description = "The fcitx5-lotus package to install.";
};

# Backward compatible with the old module API, but no longer defaults to "".
user = mkOption {
type = types.str;
default = "";
description = "User name of the Server";
type = types.nullOr types.str;
default = null;
example = "alice";
description = ''
Backward-compatible single user to start the Lotus server for.

Prefer `services.fcitx5-lotus.users` for new configurations.
'';
};

users = mkOption {
type = types.listOf types.str;
default = [ ];
example = [
"alice"
"bob"
];
description = ''
Linux users to start system-level fcitx5-lotus-server instances for.

Each configured user gets one fcitx5-lotus-server@<user>.service instance.
'';
};
};

config = mkIf cfg.enable {
i18n.inputMethod.fcitx5.addons = [fcitx5-lotus];
assertions = [
{
assertion = cfg.user != "";
message = "services.fcitx5-lotus.user must not be an empty string; use null or services.fcitx5-lotus.users.";
}
{
assertion = effectiveUsers != [ ];
message = "services.fcitx5-lotus requires at least one user. Set services.fcitx5-lotus.users = [ \"alice\" ];";
}
{
assertion = syntacticallyInvalidUsers == [ ];
message = "services.fcitx5-lotus.users/user contains invalid Linux usernames.";
}
{
assertion = unknownUsers == [ ];
message = "services.fcitx5-lotus.users/user must contain users declared in users.users.";
}
];

i18n.inputMethod.fcitx5.addons = [ cfg.package ];

users.users.uinput_proxy = {
isSystemUser = true;
group = "input";
};

services.udev.packages = [fcitx5-lotus];
systemd.packages = [fcitx5-lotus];
services.udev.packages = [ cfg.package ];
systemd.packages = [ cfg.package ];

systemd.targets.multi-user.wants = ["fcitx5-lotus-server@${cfg.user}.service"];
systemd.targets.multi-user.wants = map (user: "fcitx5-lotus-server@${user}.service") effectiveUsers;
};
}
8 changes: 5 additions & 3 deletions packaging/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
fcitx5-lotus (3.0.3-1) unstable; urgency=medium
fcitx5-lotus (3.1.0-1) unstable; urgency=medium

* Small fix
* Add option to type em-dash from double hyphen
* Add bracket transform option
* Fix some bug

-- Nguyen Hoang Ky <nhktmdzhg@gmail.com> Sun, 03 May 2026 07:43:00 +0700
-- Nguyen Hoang Ky <nhktmdzhg@gmail.com> Sun, 14 May 2026 16:15:00 +0700
8 changes: 5 additions & 3 deletions packaging/rpm/fedora/fcitx5-lotus.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: fcitx5-lotus
Version: 3.0.3
Version: 3.1.0
Release: 1
Summary: Vietnamese input method for fcitx5
License: GPL-3.0-or-later
Expand Down Expand Up @@ -165,5 +165,7 @@ fi
%systemd_postun_with_restart fcitx5-lotus-server@.service

%changelog
* Sun May 03 2026 Nguyen Hoang Ky <nhktmdzhg@gmail.com> - 3.0.3-1
- Small fix
* Sun May 14 2026 Nguyen Hoang Ky <nhktmdzhg@gmail.com> - 3.1.0-1
- Add option to type em-dash from double hyphen
- Add bracket transform option
- Fix some bug
8 changes: 5 additions & 3 deletions packaging/rpm/opensuse/fcitx5-lotus.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: fcitx5-lotus
Version: 3.0.3
Version: 3.1.0
Release: 1
Summary: Vietnamese input method for fcitx5
License: GPL-3.0-or-later
Expand Down Expand Up @@ -168,5 +168,7 @@ fi
%systemd_postun_with_restart fcitx5-lotus-server@.service

%changelog
* Sun May 02 2026 Nguyen Hoang Ky <nhktmdzhg@gmail.com> - 3.0.3-1
- Small fix
* Sun May 14 2026 Nguyen Hoang Ky <nhktmdzhg@gmail.com> - 3.1.0-1
- Add option to type em-dash from double hyphen
- Add bracket transform option
- Fix some bug
2 changes: 1 addition & 1 deletion settings-gui/ui/pages/dict_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _setup_ui(self):
# Dictionary behavior toggles
toggles_card = CardWidget("")
toggles_layout = QHBoxLayout()
self.cb_enable = QCheckBox(_("Enable Custom Dictionary"))
self.cb_enable = QCheckBox(_("Custom Dictionary"))
self.cb_enable.toggled.connect(self._on_item_changed)
toggles_layout.addWidget(self.cb_enable)
toggles_layout.addStretch()
Expand Down
2 changes: 1 addition & 1 deletion settings-gui/ui/pages/dynamic_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class SettingsCategory(Enum):
},
SettingsCategory.TYPING: {
"SPELLING & CORRECTIONS": ["SpellCheck", "AutoNonVnRestore", "DdFreeStyle"],
"TYPING OPTIONS": ["W2U", "ModernStyle", "FreeMarking", "FixUinputWithAck", "DoubleSpaceToPeriod", "AutoCapitalizeAfterPunctuation"],
"TYPING OPTIONS": ["W2U", "BracketTransform", "ModernStyle", "FreeMarking", "FixUinputWithAck", "DoubleSpaceToPeriod", "DoubleHyphenToEmDash", "AutoCapitalizeAfterPunctuation"],
},
SettingsCategory.SHORTCUTS: {
"SHORTCUTS": ["ModeMenuKey"],
Expand Down
23 changes: 1 addition & 22 deletions settings-gui/ui/pages/keymap_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,27 +118,6 @@
("$", "_Ô"),
("0", "__đ"),
(")", "_Đ"),
("[", "__ư"),
("{", "_Ư"),
("]", "__ơ"),
("}", "_Ơ"),
],
"Telex 2": [
("z", "XoaDauThanh"),
("s", "DauSac"),
("f", "DauHuyen"),
("r", "DauHoi"),
("x", "DauNga"),
("j", "DauNang"),
("a", "A_Â"),
("e", "E_Ê"),
("o", "O_Ô"),
("w", "UOA_ƯƠĂ__Ư"),
("d", "D_Đ"),
("]", "__ư"),
("[", "__ơ"),
("}", "_Ư"),
("{", "_Ơ"),
],
"Telex + VNI": [
("z", "XoaDauThanh"),
Expand Down Expand Up @@ -249,7 +228,7 @@ def _setup_ui(self):

# Row 1: Enable checkbox and Search
top_row = QHBoxLayout()
self.cb_enable = QCheckBox(_("Enable Custom Keymap"))
self.cb_enable = QCheckBox(_("Custom Keymap"))
self.cb_enable.toggled.connect(self._on_item_changed)
top_row.addWidget(self.cb_enable)
top_row.addStretch()
Expand Down
2 changes: 1 addition & 1 deletion settings-gui/ui/pages/macro_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def _setup_ui(self):
# Macro behavior toggles
toggles_card = CardWidget("")
toggles_layout = QHBoxLayout()
self.cb_enable = QCheckBox(_("Enable Macro"))
self.cb_enable = QCheckBox(_("Macro"))
self.cb_capitalize = QCheckBox(_("Capitalize Macro"))
self.cb_enable.toggled.connect(self._on_item_changed)
self.cb_capitalize.toggled.connect(self._on_item_changed)
Expand Down
22 changes: 18 additions & 4 deletions src/lotus-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ namespace fcitx {

FCITX_CONFIG_ENUM_NAME_WITH_I18N(W2UMode, N_("Disabled"), N_("Non-Start"), N_("Everywhere"));

/**
* @brief Bracket transform mode for [ -> ơ, ] -> ư conversion.
*/
enum class BracketTransformMode : std::uint8_t {
Disabled = 0,
NonStart = 1,
Everywhere = 2,
};

FCITX_CONFIG_ENUM_NAME_WITH_I18N(BracketTransformMode, N_("Disabled"), N_("Non-Start"), N_("Everywhere"));

/**
* @brief Icon theme options.
*/
Expand Down Expand Up @@ -198,22 +209,25 @@ namespace fcitx {
OptionWithAnnotation<std::string, StringListAnnotation> outputCharset{this, "OutputCharset", _("Output Charset"), "Unicode", {}, {}, StringListAnnotation()};
KeyListOption modeMenuKey{
this, "ModeMenuKey", _("Mode Menu Hotkey"), {Key("grave")}, KeyListConstrain({KeyConstrainFlag::AllowModifierLess, KeyConstrainFlag::AllowModifierOnly})};
SubConfigOption appRules{this, "AppRules", _("App Rules"), "fcitx://config/addon/lotus/app_rules"};
OptionWithAnnotation<W2UMode, W2UModeI18NAnnotation> w2u{this, "W2U", _("Type w to Produce ư"), W2UMode::NonStart};
SubConfigOption appRules{this, "AppRules", _("App Rules"), "fcitx://config/addon/lotus/app_rules"};
OptionWithAnnotation<W2UMode, W2UModeI18NAnnotation> w2u{this, "W2U", _("Type w to Produce ư"), W2UMode::NonStart};
OptionWithAnnotation<BracketTransformMode, BracketTransformModeI18NAnnotation> bracketTransform{this, "BracketTransform", _("Type [ -> ơ, ] -> ư, { -> Ơ, } -> Ư"),
BracketTransformMode::Disabled};

Option<bool> spellCheck{this, "SpellCheck", _("Enable Spell Check"), true}; Option<bool> enableMacro{this, "EnableMacro", _("Enable Macro"), true};
Option<bool> capitalizeMacro{this, "CapitalizeMacro", _("Capitalize Macro"), true}; Option<bool> autoCapitalizeAfterPunctuation{
this, "AutoCapitalizeAfterPunctuation", _("Auto capitalize after sentence-ending punctuation (. ! ? Enter) (experimental)"), false};
Option<bool> doubleSpaceToPeriod{this, "DoubleSpaceToPeriod", _("Double Space to Period (experimental)"), false};
Option<bool> doubleHyphenToEmDash{this, "DoubleHyphenToEmDash", _("Double Hyphen to Em-Dash (--)"), false};
Option<bool> autoNonVnRestore{this, "AutoNonVnRestore", _("Auto Restore Invalid Words"), true};
Option<bool> modernStyle{this, "ModernStyle", _("Use oà, uý (Instead Of òa, úy)"), true};
Option<bool> freeMarking{this, "FreeMarking", _("Allow Type With More Freedom"), true};
Option<bool> ddFreeStyle{this, "DdFreeStyle", _("Allow dd To Produce đ When Auto Restore Invalid Words Is On"), true};
Option<bool> fixUinputWithAck{this, "FixUinputWithAck", _("Fix Uinput Mode With Ack"), false};
Option<bool> useLotusIcons{this, "UseLotusIcons", _("Use Lotus Status Icons"), false};

Option<bool> enableDictionary{this, "EnableDictionary", _("Enable Custom Dictionary"), false};
Option<bool> enableCustomKeymap{this, "EnableCustomKeymap", _("Enable Custom Keymap"), false};
Option<bool> enableDictionary{this, "EnableDictionary", _("Custom Dictionary"), false};
Option<bool> enableCustomKeymap{this, "EnableCustomKeymap", _("Custom Keymap"), false};

Option<bool> showModeSmooth{this, "ShowModeSmooth", _("Show Uinput (Smooth)"), true}; Option<bool> showModeUinput{this, "ShowModeUinput", _("Show Uinput (Slow)"), true};
Option<bool> showModeMinecraft{this, "ShowModeMinecraft", _("Show Minecraft"), true};
Expand Down
Loading
Loading