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 <github@brendanforster.com>
  • Loading branch information
theofficialgman and shiftkey committed Aug 11, 2024
1 parent 7b19489 commit c3b581c
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 @@ -23,6 +23,7 @@ export enum Shell {
XFCE = 'XFCE Terminal',
Alacritty = 'Alacritty',
Kitty = 'Kitty',
LXTerminal = 'LXDE Terminal',
}

export const Default = Shell.Gnome
Expand Down Expand Up @@ -65,6 +66,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 @@ -88,6 +91,7 @@ export async function getAvailableShells(): Promise<
xfcePath,
alacrittyPath,
kittyPath,
lxterminalPath,
] = await Promise.all([
getShellPath(Shell.Gnome),
getShellPath(Shell.GnomeConsole),
Expand All @@ -103,6 +107,7 @@ export async function getAvailableShells(): Promise<
getShellPath(Shell.XFCE),
getShellPath(Shell.Alacritty),
getShellPath(Shell.Kitty),
getShellPath(Shell.LXTerminal),
])

const shells: Array<FoundShell<Shell>> = []
Expand Down Expand Up @@ -162,6 +167,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(
return spawn(foundShell.path, ['-w', path])
case Shell.Kitty:
return spawn(foundShell.path, ['--single-instance', '--directory', path])
case Shell.LXTerminal:
return spawn(foundShell.path, ['--working-directory=' + path])
default:
return assertNever(shell, `Unknown shell: ${shell}`)
}
Expand Down

0 comments on commit c3b581c

Please sign in to comment.