diff --git a/src/components/InteractiveInstaller.vue b/src/components/InteractiveInstaller.vue index a9ef552..bfaffb7 100644 --- a/src/components/InteractiveInstaller.vue +++ b/src/components/InteractiveInstaller.vue @@ -10,6 +10,7 @@ import { shells, deWms, environments, + resolveWM, initSystems, logic, fcitx5Config, @@ -41,6 +42,7 @@ const deIcons: Record = { Sway: 'simple-icons:sway', Hyprland: 'simple-icons:hyprland', Niri: 'simple-icons:niri', + AwesomeWM: 'simple-icons:awesomewm', }; const envBaseIcons: Record = { @@ -48,6 +50,7 @@ const envBaseIcons: Record = { }; const deIcon = (de: string): string | undefined => deIcons[de]; +const wmLabel = (de: string): string => resolveWM(de, selectedEnv.value); const envIcon = (env: string): string | undefined => env === 'X11' @@ -222,7 +225,7 @@ const copyToClipboard = async (text: string) => { const autostartText = computed( () => logic.steps.autostart[ - selectedDe.value as keyof typeof logic.steps.autostart + resolveWM(selectedDe.value, selectedEnv.value) as keyof typeof logic.steps.autostart ], ); @@ -265,7 +268,7 @@ const chromiumWaylandFlags = computed(() =>
- {{ de }} + {{ wmLabel(de) }}
diff --git a/src/data/installer.ts b/src/data/installer.ts index c0a59c7..b077a20 100644 --- a/src/data/installer.ts +++ b/src/data/installer.ts @@ -29,9 +29,16 @@ export const deWms = [ 'Sway', 'Hyprland', 'Niri', + 'AwesomeWM' ]; export const environments = ['X11', 'Wayland']; export const initSystems = ['systemd', 'OpenRC', 'runit']; +const wmAliases: Record>> = { + AwesomeWM: { Wayland: 'SomeWM' }, +}; +export const resolveWM = (wm: string, env: string): string => { + return wmAliases[wm]?.[env] ?? wm; +}; export const logic = { steps: { @@ -246,6 +253,10 @@ export const logic = { Hyprland: 'Thêm `hl.exec_cmd("fcitx5 -d")` vào ~/.config/hypr/hyprland.lua', Niri: 'Thêm `spawn-sh-at-startup "fcitx5 -d"` vào ~/.config/niri/config.kdl', + AwesomeWM: + 'Thêm `awful.spawn.once("fcitx5 -d")` vào ~/.config/awesome/rc.lua', + SomeWM: + 'Thêm `awful.spawn.once("fcitx5 -d")` vào ~/.config/somewm/rc.lua', }, wayland_extras: { General: {