Skip to content

Instantly share code, notes, and snippets.

@guemidiborhane
Created June 11, 2021 06:59
Show Gist options
  • Save guemidiborhane/95d0e1f7780ec02690d3294f4d710a1c to your computer and use it in GitHub Desktop.
Save guemidiborhane/95d0e1f7780ec02690d3294f4d710a1c to your computer and use it in GitHub Desktop.
From 8fd6114648a02e92cfeccd8be1c0bbefa7ce6db7 Mon Sep 17 00:00:00 2001
From: Borhaneddine GUEMIDI <guemidiborhane@gmail.com>
Date: Fri, 11 Jun 2021 03:09:36 +0100
Subject: [PATCH] :sparkles: Add kitty as shell option
---
app/src/lib/shells/linux.ts | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/app/src/lib/shells/linux.ts b/app/src/lib/shells/linux.ts
index 15eecc85..60a46ec2 100644
--- a/app/src/lib/shells/linux.ts
+++ b/app/src/lib/shells/linux.ts
@@ -17,6 +17,7 @@ export enum Shell {
Elementary = 'Elementary Terminal',
XFCE = 'XFCE Terminal',
Alacritty = 'Alacritty',
+ Kitty = 'Kitty',
}
export const Default = Shell.Gnome
@@ -55,6 +56,8 @@ function getShellPath(shell: Shell): Promise<string | null> {
return getPathIfAvailable('/usr/bin/xfce4-terminal')
case Shell.Alacritty:
return getPathIfAvailable('/usr/bin/alacritty')
+ case Shell.Kitty:
+ return getPathIfAvailable('/usr/bin/kitty')
default:
return assertNever(shell, `Unknown shell: ${shell}`)
}
@@ -76,6 +79,7 @@ export async function getAvailableShells(): Promise<
elementaryPath,
xfcePath,
alacrittyPath,
+ kittyPath,
] = await Promise.all([
getShellPath(Shell.Gnome),
getShellPath(Shell.Mate),
@@ -89,6 +93,7 @@ export async function getAvailableShells(): Promise<
getShellPath(Shell.Elementary),
getShellPath(Shell.XFCE),
getShellPath(Shell.Alacritty),
+ getShellPath(Shell.Kitty),
])
const shells: Array<IFoundShell<Shell>> = []
@@ -140,6 +145,10 @@ export async function getAvailableShells(): Promise<
shells.push({ shell: Shell.Alacritty, path: alacrittyPath })
}
+ if (kittyPath) {
+ shells.push({ shell: Shell.Kitty, path: kittyPath })
+ }
+
return shells
}
@@ -154,6 +163,8 @@ export function launch(
case Shell.Tilix:
case Shell.Terminator:
case Shell.XFCE:
+ case Shell.Kitty:
+ return spawn(foundShell.path, ['--single-instance', '--directory', path])
case Shell.Alacritty:
return spawn(foundShell.path, ['--working-directory', path])
case Shell.Urxvt:
--
2.31.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment