From bb9ce904a1c189a978df4b1c728cb0eda08f6321 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Sat, 7 May 2022 10:50:19 -0400 Subject: [PATCH] Adds LXTerminal to terminals and Geany and Mousepad to supported editors (#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 --- app/src/lib/editors/linux.ts | 8 ++++++++ app/src/lib/shells/linux.ts | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/app/src/lib/editors/linux.ts b/app/src/lib/editors/linux.ts index ae83e708c6d..4190cc6c27f 100644 --- a/app/src/lib/editors/linux.ts +++ b/app/src/lib/editors/linux.ts @@ -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 { diff --git a/app/src/lib/shells/linux.ts b/app/src/lib/shells/linux.ts index 28bdeb898b0..2eb1aa3b824 100644 --- a/app/src/lib/shells/linux.ts +++ b/app/src/lib/shells/linux.ts @@ -19,6 +19,7 @@ export enum Shell { XFCE = 'XFCE Terminal', Alacritty = 'Alacritty', Kitty = 'Kitty', + LXTerminal = 'LXDE Terminal', } export const Default = Shell.Gnome @@ -61,6 +62,8 @@ function getShellPath(shell: Shell): Promise { 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}`) } @@ -84,6 +87,7 @@ export async function getAvailableShells(): Promise< xfcePath, alacrittyPath, kittyPath, + lxterminalPath, ] = await Promise.all([ getShellPath(Shell.Gnome), getShellPath(Shell.GnomeConsole), @@ -99,6 +103,7 @@ export async function getAvailableShells(): Promise< getShellPath(Shell.XFCE), getShellPath(Shell.Alacritty), getShellPath(Shell.Kitty), + getShellPath(Shell.LXTerminal), ]) const shells: Array> = [] @@ -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 } @@ -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}`) }