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 Jun 11, 2022
1 parent 664fbc1 commit bb9ce90
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/src/lib/editors/linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ const editors: ILinuxExternalEditor[] = [
name: 'Notepadqq',
paths: ['/usr/bin/notepadqq'],
},
{
name: 'Geany',
paths: ['/usr/bin/geany'],
},
{
name: 'Mousepad',
paths: ['/usr/bin/mousepad'],
},
]

async function getAvailablePath(paths: string[]): Promise<string | null> {
Expand Down
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 bb9ce90

Please sign in to comment.