Make a Quake like quick access terminal¶
Added in version 0.42.0: See here for what platforms it works on.
This kitten can be used to make a quick access terminal, that appears and disappears at a key press. To do so use the following command:
kitten quick-access-terminal
Run this command in a terminal, and a quick access kitty window will show up at the top of your screen. Run it again, and the window will be hidden.
To make the terminal appear and disappear at a key press:
Simply bind the above command to some key press in your window manager or desktop environment settings and then you have a quick access terminal at a single key press.
In kitty, run the above command to show the quick access window, then close it by running the command again or pressing ctrl+d. Now go to System Preferences->Keyboard->Keyboard Shortcuts->Services->General and set a shortcut for the Quick access to kitty entry.
Configuration¶
You can configure the appearance and behavior of the quick access window
by creating a quick-access-terminal.conf
file in your
kitty config folder. In particular, you can use the
kitty_conf
option to change
various kitty settings, just for the quick access window.
Note
This kitten uses the panel kitten under the
hood. You can use the techniques described there
for remote controlling the quick access window, remember to add
kitty_override allow_remote_control=socket-only
and kitty_override
listen_on=unix:/tmp/whatever
to
quick-access-terminal.conf
.
See below for the supported configuration directives:
Window appearance¶
- lines¶
lines 25
The number of lines shown in the window, when the window is along the top or bottom edges of the screen.
If it has the suffix px
then it sets the height of the window in pixels instead of lines.
- columns¶
columns 80
The number of columns shown in the window, when the window is along the left or right edges of the screen.
If it has the suffix px
then it sets the width of the window in pixels instead of columns.
- edge¶
edge top
Which edge of the screen to place the window along
- background_opacity¶
background_opacity 0.85
The background opacity of the window. This works the same as the kitty option of the same name, it is present here as it has a different default value for the quick access terminal.
- hide_on_focus_loss¶
hide_on_focus_loss no
Hide the window when it loses keyboard focus automatically. Using this option
will force focus_policy
to on-demand
.
- margin_left¶
margin_left 0
Set the left margin for the window, in pixels. Has no effect for windows on the right edge of the screen.
- margin_right¶
margin_right 0
Set the right margin for the window, in pixels. Has no effect for windows on the left edge of the screen.
- margin_top¶
margin_top 0
Set the top margin for the window, in pixels. Has no effect for windows on the bottom edge of the screen.
- margin_bottom¶
margin_bottom 0
Set the bottom margin for the window, in pixels. Has no effect for windows on the top edge of the screen.
- kitty_conf¶
Path to config file to use for kitty when drawing the window. Can be specified multiple times. By default, the normal kitty.conf is used. Relative paths are resolved with respect to the kitty config directory.
- kitty_override¶
Override individual kitty configuration options, can be specified multiple times. Syntax: name=value. For example: font_size=20
.
- app_id¶
app_id kitty-quick-access
On Wayland set the namespace of the layer shell surface. On X11 set the WM_CLASS assigned to the quick access window. (Linux only)
- output_name¶
The panel can only be displayed on a single monitor (output) at a time. This allows
you to specify which output is used, by name. If not specified the compositor will choose an
output automatically, typically the last output the user interacted with or the primary monitor.
You can get a list of available outputs by running: kitten panel --output-name list
.
start_as_hidden no
Whether to start the quick access terminal hidden. Useful if you are starting it as part of system startup.
- focus_policy¶
focus_policy exclusive
How to manage window focus. A value of exclusive
means prevent other windows from getting focus.
However, whether this works is entirely dependent on the compositor/desktop environment.
It does not have any effect on macOS and KDE, for example. Note that on sway using on-demand
means
the compositor will not focus the window when it appears until you click on it, which is why the default is set
to exclusive
.
Source code for quick_access_terminal¶
The source code for this kitten is available on GitHub.
Command Line Interface¶
kitten quick_access_terminal [options] [cmdline-to-run ...]
A quick access terminal window that you can bring up instantly with a keypress or a command.
Options¶
- --config <CONFIG>, -c <CONFIG>¶
Specify a path to the configuration file(s) to use. All configuration files are merged onto the builtin
quick-access-terminal.conf
, overriding the builtin values. This option can be specified multiple times to read multiple configuration files in sequence, which are merged. Use the special valueNONE
to not load any config file.If this option is not specified, config files are searched for in the order:
$XDG_CONFIG_HOME/kitty/quick-access-terminal.conf
,~/.config/kitty/quick-access-terminal.conf
,$XDG_CONFIG_DIRS/kitty/quick-access-terminal.conf
. The first one that exists is used as the config file.If the environment variable
KITTY_CONFIG_DIRECTORY
is specified, that directory is always used and the above searching does not happen.If
/etc/xdg/kitty/quick-access-terminal.conf
exists, it is merged before (i.e. with lower priority) than any user config files. It can be used to specify system-wide defaults for all users. You can use either-
or/dev/stdin
to read the config from STDIN.
- --override <OVERRIDE>, -o <OVERRIDE>¶
Override individual configuration options, can be specified multiple times. Syntax: name=value. For example: -o lines=12
- --detach [=no]¶
Detach from the controlling terminal, if any, running in an independent child process, the parent process exits immediately.
- --instance-group <INSTANCE_GROUP>¶
The unique name of this quick access terminal Use a different name if you want multiple such terminals. Default:
quick-access
- --debug-rendering [=no]¶
For debugging interactions with the compositor/window manager.
Sample quick-access-terminal.conf¶
You can download a sample quick-access-terminal.conf
file with all default settings and
comments describing each setting by clicking: sample quick-access-terminal.conf
.