Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds LXTerminal to terminals and Geany and Mousepad to supported editors #711

Merged
merged 5 commits into from
May 7, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
12 changes: 12 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,11 @@ 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 +203,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