From 422f4fb800af380a0c27046282a37eaac6044787 Mon Sep 17 00:00:00 2001 From: Etaash-mathamsetty <45927311+Etaash-mathamsetty@users.noreply.github.com> Date: Thu, 21 Apr 2022 17:10:20 +0000 Subject: [PATCH] Add support for GNOME console and newer GNOME editors (#700) * add support for gnome console * Delete configurationCache.log * Update linux.ts * fix cap of gnome * support new GNOME Text Editor * support GNOME builder --- app/src/lib/editors/linux.ts | 10 +++++++++- app/src/lib/shells/linux.ts | 10 ++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/src/lib/editors/linux.ts b/app/src/lib/editors/linux.ts index 5abd1fcca86..5fec8467e27 100644 --- a/app/src/lib/editors/linux.ts +++ b/app/src/lib/editors/linux.ts @@ -68,9 +68,17 @@ const editors: ILinuxExternalEditor[] = [ paths: ['/usr/bin/kate'], }, { - name: 'GNOME Text Editor', + name: 'GEdit', paths: ['/usr/bin/gedit'], }, + { + name: 'GNOME Text Editor', + paths: ['/usr/bin/gnome-text-editor'], + }, + { + name: 'GNOME Builder', + paths: ['/usr/bin/gnome-builder'], + }, { name: 'Notepadqq', paths: ['/usr/bin/notepadqq'], diff --git a/app/src/lib/shells/linux.ts b/app/src/lib/shells/linux.ts index 393e0bb7e30..28bdeb898b0 100644 --- a/app/src/lib/shells/linux.ts +++ b/app/src/lib/shells/linux.ts @@ -6,6 +6,7 @@ import { pathExists as pathExistsLinux, spawnShell } from '../helpers/linux' export enum Shell { Gnome = 'GNOME Terminal', + GnomeConsole = 'GNOME Console', Mate = 'MATE Terminal', Tilix = 'Tilix', Terminator = 'Terminator', @@ -34,6 +35,8 @@ function getShellPath(shell: Shell): Promise { switch (shell) { case Shell.Gnome: return getPathIfAvailable('/usr/bin/gnome-terminal') + case Shell.GnomeConsole: + return getPathIfAvailable('/usr/bin/kgx') case Shell.Mate: return getPathIfAvailable('/usr/bin/mate-terminal') case Shell.Tilix: @@ -68,6 +71,7 @@ export async function getAvailableShells(): Promise< > { const [ gnomeTerminalPath, + gnomeConsolePath, mateTerminalPath, tilixPath, terminatorPath, @@ -82,6 +86,7 @@ export async function getAvailableShells(): Promise< kittyPath, ] = await Promise.all([ getShellPath(Shell.Gnome), + getShellPath(Shell.GnomeConsole), getShellPath(Shell.Mate), getShellPath(Shell.Tilix), getShellPath(Shell.Terminator), @@ -101,6 +106,10 @@ export async function getAvailableShells(): Promise< shells.push({ shell: Shell.Gnome, path: gnomeTerminalPath }) } + if (gnomeConsolePath) { + shells.push({ shell: Shell.GnomeConsole, path: gnomeConsolePath }) + } + if (mateTerminalPath) { shells.push({ shell: Shell.Mate, path: mateTerminalPath }) } @@ -159,6 +168,7 @@ export function launch( const shell = foundShell.shell switch (shell) { case Shell.Gnome: + case Shell.GnomeConsole: case Shell.Mate: case Shell.Tilix: case Shell.Terminator: