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 Aug 10, 2024
1 parent 9431ef4 commit f3a7b0f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/src/lib/shells/linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { pathExists, spawn } from '../helpers/linux'

export enum Shell {
Gnome = 'GNOME Terminal',
GnomeConsole = 'GNOME Console',
Mate = 'MATE Terminal',
Tilix = 'Tilix',
Terminator = 'Terminator',
Expand Down Expand Up @@ -38,6 +39,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 @@ -72,6 +75,7 @@ export async function getAvailableShells(): Promise<
> {
const [
gnomeTerminalPath,
gnomeConsolePath,
mateTerminalPath,
tilixPath,
terminatorPath,
Expand All @@ -86,6 +90,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 @@ -105,6 +110,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 @@ -163,6 +172,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 f3a7b0f

Please sign in to comment.