Skip to content

Commit

Permalink
Add support for GNOME console and newer GNOME editors (#700)
Browse files Browse the repository at this point in the history
* add support for gnome console

* Delete configurationCache.log

* Update linux.ts

* fix cap of gnome

* support new GNOME Text Editor

* support GNOME builder
  • Loading branch information
Etaash-mathamsetty authored and shiftkey committed Apr 27, 2022
1 parent b60f211 commit 5495bf3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/src/lib/editors/linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
10 changes: 10 additions & 0 deletions app/src/lib/shells/linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -34,6 +35,8 @@ function getShellPath(shell: Shell): Promise<string | null> {
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:
Expand Down Expand Up @@ -68,6 +71,7 @@ export async function getAvailableShells(): Promise<
> {
const [
gnomeTerminalPath,
gnomeConsolePath,
mateTerminalPath,
tilixPath,
terminatorPath,
Expand All @@ -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),
Expand All @@ -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 })
}
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 5495bf3

Please sign in to comment.