i3: Move kitty daemonization into own script

This commit is contained in:
2025-08-26 13:06:08 +02:00
parent 1f6fb2abf7
commit c09ed22389
3 changed files with 25 additions and 10 deletions

View File

@@ -36,18 +36,11 @@ set $TERM_CMD_FLAG
# a single sprite cache on the GPU"[^1], so that startup is almost instant. # 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 # 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. # the kitty process is always running, even when no OS windows exists. See the
# # daemon.sh script in .config/kitty.
# NOTE: `--start-as hidden` needs kitty 0.42.0 or later.
#
# Additionally allow remote_control over a socket, so that kitty-cwd works.
# #
# [^1]: kitty(1) # [^1]: kitty(1)
exec --no-startup-id $TERMINAL \ exec --no-startup-id kitty-daemon
--start-as hidden \
--detach \
-o allow_remote_control=socket-only \
--listen-on unix:/tmp/mykitty
# Multi monitor support # Multi monitor support
exec_always --no-startup-id ~/.config/i3/monitor-setup.sh & exec_always --no-startup-id ~/.config/i3/monitor-setup.sh &

21
.config/kitty/daemon.sh Executable file
View File

@@ -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

1
.local/bin/kitty-daemon Symbolic link
View File

@@ -0,0 +1 @@
../../.config/kitty/daemon.sh