@@ -12,6 +12,9 @@ import {
1212 logic ,
1313 fcitx5Config ,
1414 kanataConfig ,
15+ userCreationCmd ,
16+ udevReloadCmd ,
17+ uinputModprobeCmd ,
1518} from ' @/data/installer' ;
1619
1720const selectedDistro = ref (distros [0 ]?.name || ' ' );
@@ -21,10 +24,26 @@ const selectedDe = ref<string>(deWms[0] || '');
2124const selectedEnv = ref <string >(environments [1 ] || ' ' );
2225const selectedInit = ref <string >(initSystems [0 ] || ' systemd' );
2326
27+ const needsUserCreation = computed (() => {
28+ return selectedInit .value !== ' systemd' || selectedMethod .value === ' Source' ;
29+ });
30+
31+ const needsUdevReload = computed (() => {
32+ return selectedMethod .value === ' Source' ;
33+ });
34+
35+ const needsUinputModprobe = computed (() => {
36+ return selectedMethod .value === ' Source' ;
37+ });
38+
2439const activateServerCode = computed (() => {
2540 if (selectedDistro .value === ' NixOS' )
2641 return ' # Bước này đã được cấu hình trong flake.nix ở trên.' ;
27- if (isAutoHandled .value && selectedInit .value !== ' OpenRC' ) {
42+ if (
43+ isAutoHandled .value &&
44+ selectedInit .value !== ' OpenRC' &&
45+ selectedInit .value !== ' runit'
46+ ) {
2847 return ' # Gói .deb sẽ tự động thực hiện bước này.\n ' + serverCmd .value ;
2948 }
3049 return serverCmd .value ;
@@ -38,7 +57,13 @@ const shellConfigCode = computed(() => {
3857
3958const serverCmd = computed (() => {
4059 if (selectedInit .value === ' OpenRC' ) {
41- return ' sudo rc-update add fcitx5-lotus\n sudo ln -s /etc/init.d/fcitx5-lotus /etc/init.d/fcitx5-lotus.$(whoami)\n sudo rc-service fcitx5-lotus.$(whoami) restart' ;
60+ return ' sudo ln -s /etc/init.d/fcitx5-lotus /etc/init.d/fcitx5-lotus.$(whoami)\n sudo rc-update add fcitx5-lotus.$(whoami) default\n sudo rc-service fcitx5-lotus.$(whoami) restart' ;
61+ }
62+ if (selectedInit .value === ' runit' ) {
63+ if (selectedDistro .value === ' Void Linux' ) {
64+ return ' sudo ln -s /etc/sv/fcitx5-lotus /var/service/fcitx5-lotus.$(whoami)\n sudo sv start fcitx5-lotus.$(whoami)' ;
65+ }
66+ return ' sudo ln -sf /etc/runit/sv/fcitx5-lotus /etc/runit/sv/fcitx5-lotus.$(whoami)\n sudo sv start /etc/runit/sv/fcitx5-lotus.$(whoami)' ;
4267 }
4368 if (selectedShell .value === ' Fish' )
4469 return ' sudo systemctl enable --now fcitx5-lotus-server@(whoami).service; or begin; sudo systemd-sysusers; and sudo systemctl enable --now fcitx5-lotus-server@(whoami).service; end' ;
@@ -78,7 +103,6 @@ const envCmd = computed(() => {
78103 } else if (selectedShell .value === ' Zsh' ) {
79104 return ` cat <<EOF >> ~/.zprofile\n ${vars .join (' \n ' )}\n EOF ` ;
80105 } else {
81- // Fish
82106 const fishVars = vars .map ((v ) => {
83107 const idxEq = v .indexOf (' =' );
84108 const name = v .slice (0 , idxEq ).replace (' export ' , ' ' );
@@ -123,7 +147,6 @@ const autostartText = computed(
123147 ],
124148);
125149
126- // Wayland Logic
127150const waylandGeneral = computed (() => {
128151 if (selectedEnv .value !== ' Wayland' ) return null ;
129152 return logic .steps .wayland_extras .General ;
@@ -137,7 +160,7 @@ const waylandDeSpecific = computed(() => {
137160const chromiumWaylandFlags = computed (() =>
138161 selectedDe .value === ' KDE Plasma'
139162 ? ' --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime'
140- : ' --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime --wayland-text-input-version=3'
163+ : ' --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime --wayland-text-input-version=3' ,
141164);
142165 </script >
143166
@@ -254,11 +277,58 @@ const chromiumWaylandFlags = computed(() =>
254277 </div >
255278 </div >
256279
280+ <div v-if =" needsUserCreation" class =" step-card" >
281+ <div class =" step-badge" >1.5</div >
282+ <div class =" step-content" >
283+ <h4 >Tạo User và Group (thay thế systemd-sysusers)</h4 >
284+ <p class =" instruction" >
285+ Non-systemd và build from source cần tạo user
286+ <code >uinput_proxy</code > và group <code >input</code > thủ công.
287+ </p >
288+ <div class =" code-container" >
289+ <pre ><code >{{ userCreationCmd }}</code ></pre >
290+ <el-button
291+ class =" copy-float"
292+ circle
293+ :icon =" DocumentCopy"
294+ @click =" copyToClipboard(userCreationCmd)"
295+ />
296+ </div >
297+ </div >
298+ </div >
299+
300+ <div v-if =" needsUdevReload" class =" step-card" >
301+ <div class =" step-badge" >1.6</div >
302+ <div class =" step-content" >
303+ <h4 >Reload Udev Rules</h4 >
304+ <p class =" instruction" >
305+ Áp dụng các udev rules mới (99-lotus.rules) để thiết bị uinput có
306+ quyền đúng.
307+ </p >
308+ <div class =" code-container" >
309+ <pre ><code >{{ udevReloadCmd }}</code ></pre >
310+ <el-button
311+ class =" copy-float"
312+ circle
313+ :icon =" DocumentCopy"
314+ @click =" copyToClipboard(udevReloadCmd)"
315+ />
316+ </div >
317+ </div >
318+ </div >
319+
257320 <div class =" step-card" >
258321 <div class =" step-badge" >2</div >
259322 <div class =" step-content" >
260323 <h4 >Kích hoạt Server</h4 >
261- <div v-if =" isAutoHandled && selectedInit !== 'OpenRC'" class =" mb-3" >
324+ <div
325+ v-if ="
326+ isAutoHandled &&
327+ selectedInit !== 'OpenRC' &&
328+ selectedInit !== 'runit'
329+ "
330+ class =" mb-3"
331+ >
262332 <el-alert
263333 title =" Gói .deb sẽ tự động kích hoạt server qua post-install script. Bạn có thể bỏ qua bước này."
264334 type =" success"
@@ -277,6 +347,26 @@ const chromiumWaylandFlags = computed(() =>
277347 </div >
278348 </div >
279349
350+ <div v-if =" needsUinputModprobe" class =" step-card" >
351+ <div class =" step-badge" >2.5</div >
352+ <div class =" step-content" >
353+ <h4 >Nạp Kernel Module uinput</h4 >
354+ <p class =" instruction" >
355+ Module uinput cần được nạp lần để fcitx5-lotus-server có thể tạo
356+ thiết bị input ảo, lần sau khởi động sẽ tự động nạp.
357+ </p >
358+ <div class =" code-container" >
359+ <pre ><code >{{ uinputModprobeCmd }}</code ></pre >
360+ <el-button
361+ class =" copy-float"
362+ circle
363+ :icon =" DocumentCopy"
364+ @click =" copyToClipboard(uinputModprobeCmd)"
365+ />
366+ </div >
367+ </div >
368+ </div >
369+
280370 <div class =" step-card" >
281371 <div class =" step-badge" >3</div >
282372 <div class =" step-content" >
@@ -420,11 +510,15 @@ const chromiumWaylandFlags = computed(() =>
420510 </div >
421511 </div >
422512
423- <div v-if =" selectedInit === 'OpenRC'" class =" extra-item mb-4" >
513+ <div
514+ v-if =" selectedInit === 'OpenRC' || selectedInit === 'runit'"
515+ class =" extra-item mb-4"
516+ >
424517 <p class =" instruction" >
425- <b >Lưu ý cho OpenRC:</b > Thêm biến sau vào cấu hình môi trường
426- (ví dụ <code >/etc/environment</code > hoặc config của DE/WM) để
427- fix lỗi không gõ được trên các ứng dụng X11/XCB:
518+ <b >Lưu ý cho {{ selectedInit }}:</b > Thêm biến sau vào cấu
519+ hình môi trường (ví dụ <code >/etc/environment</code > hoặc
520+ config của DE/WM) để fix lỗi không gõ được trên các ứng dụng
521+ X11/XCB:
428522 </p >
429523 <div class =" code-container mini" >
430524 <pre ><code >DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/bus</code ></pre >
0 commit comments