Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 5 additions & 2 deletions src/components/InteractiveInstaller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
shells,
deWms,
environments,
resolveWM,
initSystems,
logic,
fcitx5Config,
Expand Down Expand Up @@ -41,13 +42,15 @@ const deIcons: Record<string, string> = {
Sway: 'simple-icons:sway',
Hyprland: 'simple-icons:hyprland',
Niri: 'simple-icons:niri',
AwesomeWM: 'simple-icons:awesomewm',
};

const envBaseIcons: Record<string, string> = {
Wayland: 'simple-icons:wayland',
};

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'
Expand Down Expand Up @@ -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
],
);

Expand Down Expand Up @@ -265,7 +268,7 @@ const chromiumWaylandFlags = computed(() =>
<div v-for="de in deWms" :key="de" class="de-card" :class="{ active: selectedDe === de }" role="button"
tabindex="0" :aria-pressed="selectedDe === de" @click="selectedDe = de" @keydown.enter="selectedDe = de">
<v-icon v-if="deIcon(de)" :icon="deIcon(de)" width="1.25em" height="1.25em" />
<span>{{ de }}</span>
<span>{{ wmLabel(de) }}</span>
</div>
</div>
</div>
Expand Down
11 changes: 11 additions & 0 deletions src/data/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, Partial<Record<string, string>>> = {
AwesomeWM: { Wayland: 'SomeWM' },
};
export const resolveWM = (wm: string, env: string): string => {
return wmAliases[wm]?.[env] ?? wm;
};

export const logic = {
steps: {
Expand Down Expand Up @@ -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: {
Expand Down
Loading