Skip to content

Commit

Permalink
Adds LXTerminal to terminals and Geany and Mousepad to supported edit…
Browse files Browse the repository at this point in the history
…ors (#711)

* add LXTerminal to supported terminals

* add geany to supported editors list

* Update linux.ts

* add mousepad to supported editors

* lint changed files

Co-authored-by: Brendan Forster <[email protected]>
  • Loading branch information
theofficialgman and shiftkey committed Sep 2, 2023
1 parent 6130aa1 commit a0f5741
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/src/lib/shells/linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export enum Shell {
XFCE = 'XFCE Terminal',
Alacritty = 'Alacritty',
Kitty = 'Kitty',
LXTerminal = 'LXDE Terminal',
}

export const Default = Shell.Gnome
Expand Down Expand Up @@ -61,6 +62,8 @@ function getShellPath(shell: Shell): Promise<string | null> {
return getPathIfAvailable('/usr/bin/alacritty')
case Shell.Kitty:
return getPathIfAvailable('/usr/bin/kitty')
case Shell.LXTerminal:
return getPathIfAvailable('/usr/bin/lxterminal')
default:
return assertNever(shell, `Unknown shell: ${shell}`)
}
Expand All @@ -84,6 +87,7 @@ export async function getAvailableShells(): Promise<
xfcePath,
alacrittyPath,
kittyPath,
lxterminalPath,
] = await Promise.all([
getShellPath(Shell.Gnome),
getShellPath(Shell.GnomeConsole),
Expand All @@ -99,6 +103,7 @@ export async function getAvailableShells(): Promise<
getShellPath(Shell.XFCE),
getShellPath(Shell.Alacritty),
getShellPath(Shell.Kitty),
getShellPath(Shell.LXTerminal),
])

const shells: Array<IFoundShell<Shell>> = []
Expand Down Expand Up @@ -158,6 +163,10 @@ export async function getAvailableShells(): Promise<
shells.push({ shell: Shell.Kitty, path: kittyPath })
}

if (lxterminalPath) {
shells.push({ shell: Shell.LXTerminal, path: lxterminalPath })
}

return shells
}

Expand Down Expand Up @@ -193,6 +202,8 @@ export function launch(
'--directory',
path,
])
case Shell.LXTerminal:
return spawnShell(foundShell.path, ['--working-directory=' + path])
default:
return assertNever(shell, `Unknown shell: ${shell}`)
}
Expand Down

0 comments on commit a0f5741

Please sign in to comment.