From c09ed223894cbcd2de6b73c7f6e05a2e7f585692 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Tue, 26 Aug 2025 13:06:08 +0200 Subject: [PATCH] i3: Move kitty daemonization into own script --- .config/i3/config | 13 +++---------- .config/kitty/daemon.sh | 21 +++++++++++++++++++++ .local/bin/kitty-daemon | 1 + 3 files changed, 25 insertions(+), 10 deletions(-) create mode 100755 .config/kitty/daemon.sh create mode 120000 .local/bin/kitty-daemon diff --git a/.config/i3/config b/.config/i3/config index 1915a2e..2b17c7f 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -36,18 +36,11 @@ set $TERM_CMD_FLAG # a single sprite cache on the GPU"[^1], so that startup is almost instant. # # For this to work best, launch one hidden "daemon" instance at startup so that -# the kitty process is always running, even when no OS windows exists. -# -# NOTE: `--start-as hidden` needs kitty 0.42.0 or later. -# -# Additionally allow remote_control over a socket, so that kitty-cwd works. +# the kitty process is always running, even when no OS windows exists. See the +# daemon.sh script in .config/kitty. # # [^1]: kitty(1) -exec --no-startup-id $TERMINAL \ - --start-as hidden \ - --detach \ - -o allow_remote_control=socket-only \ - --listen-on unix:/tmp/mykitty +exec --no-startup-id kitty-daemon # Multi monitor support exec_always --no-startup-id ~/.config/i3/monitor-setup.sh & diff --git a/.config/kitty/daemon.sh b/.config/kitty/daemon.sh new file mode 100755 index 0000000..9e26b3f --- /dev/null +++ b/.config/kitty/daemon.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# SPDX-License-Identifier: MIT +# Copyright (c) 2025 Julian Prein +# +# Daemonize kitty by launching one hidden instance that new invocations can use +# to create new OS windows. This makes kitty startup a lot faster since all +# windows can now share a single CPU process and GPU sprite cache. Additionally +# allow remote_control over a socket, so that kitty-cwd works. +# +# To launch new invocations using the daemon created by this script use: +# +# kitty --single-instance +# +# NOTE: `--start-as hidden` needs kitty 0.42.0 or later. + +kitty \ + --single-instance \ + --start-as hidden \ + --detach \ + -o allow_remote_control=socket-only \ + --listen-on unix:/tmp/mykitty diff --git a/.local/bin/kitty-daemon b/.local/bin/kitty-daemon new file mode 120000 index 0000000..beeeb4a --- /dev/null +++ b/.local/bin/kitty-daemon @@ -0,0 +1 @@ +../../.config/kitty/daemon.sh \ No newline at end of file