All Projects → LandingEllipse → kitti3

LandingEllipse / kitti3

Licence: BSD-3-Clause license
Kitty drop-down service for sway & i3wm

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to kitti3

i3status
Simple status bar for i3 / i3-gaps / sway written in bash and python
Stars: ✭ 69 (-5.48%)
Mutual labels:  i3, sway, i3wm, swaywm
dotfiles
My dotfiles, with an out-of-date install-script. Arch, Tiling WM (i3, sway), ZSH, Neovim
Stars: ✭ 20 (-72.6%)
Mutual labels:  i3, sway, i3wm, swaywm
swayinfo
Some goodies for use in Sway and i3 wm
Stars: ✭ 30 (-58.9%)
Mutual labels:  i3, sway, i3wm, swaywm
sway-alttab
Simple Alt-Tab daemon for SwayWM/i3. Switches back to previous focused window on Alt-Tab or SIGUSR1
Stars: ✭ 36 (-50.68%)
Mutual labels:  i3, sway, i3wm, swaywm
Dotfiles
🌸 Configuration for i3, kitty, picom, ZSH, gtk, qutebrowser, qbittorrent and more... (All tools for an arch linux new installation)
Stars: ✭ 15 (-79.45%)
Mutual labels:  i3, i3wm, kitty
dotfiles
My dotfiles and colorschemes for sway and a variety of other programs.
Stars: ✭ 55 (-24.66%)
Mutual labels:  sway, swaywm
hax
Zero-config Hacky Hackpecker setup
Stars: ✭ 16 (-78.08%)
Mutual labels:  i3, i3wm
no-mans-sky-rice-i3wm
i3WM rice themed using No Man's Sky's colors
Stars: ✭ 34 (-53.42%)
Mutual labels:  i3, i3wm
negi3wm
Brings a lot of unique UX features inspired by ion3/notion wm. Probably the most sophisticated example of i3ipc usage ever created
Stars: ✭ 27 (-63.01%)
Mutual labels:  i3, i3wm
i3blocks-airpods
i3blocks script for managing airpods and airpods pro.
Stars: ✭ 61 (-16.44%)
Mutual labels:  i3, i3wm
raiseorlaunch
A run-or-raise-application-launcher for i3 window manager.
Stars: ✭ 35 (-52.05%)
Mutual labels:  i3, i3wm
i3blocks-crypto
💵 View your favorite coins' ticker prices with i3blocks.
Stars: ✭ 30 (-58.9%)
Mutual labels:  i3, i3wm
persway
Small Sway IPC Daemon
Stars: ✭ 51 (-30.14%)
Mutual labels:  ipc, swaywm
dotfiles
My main working machine setup. Here be cyber dragons, and optional bugs.
Stars: ✭ 35 (-52.05%)
Mutual labels:  i3, i3wm
i3-workspace-switcher
MRU (Most recently used) workspace switcher for i3 window manager
Stars: ✭ 20 (-72.6%)
Mutual labels:  i3, i3wm
i3-timer
⏰ A simple timer for the i3 window manager
Stars: ✭ 34 (-53.42%)
Mutual labels:  i3, i3wm
dotfiles
A total nord dotfiles used by me. Forever work in progress.
Stars: ✭ 35 (-52.05%)
Mutual labels:  i3, i3wm
openSUSEway
dotfiles for Sway on openSUSE
Stars: ✭ 48 (-34.25%)
Mutual labels:  sway, swaywm
i3-wm-gruvbox-theme
An i3-wm gruvbox theme implementation
Stars: ✭ 229 (+213.7%)
Mutual labels:  i3, i3wm
i3wm-config
i3wm config files. Updated config files are in the repository below.
Stars: ✭ 13 (-82.19%)
Mutual labels:  i3, i3wm

Kitti3 - Kitty drop-down manager for i3 & Sway

Kitti3 turns Kitty into a drop-down, Quake-style floating terminal for the i3 and Sway window managers.

Features

  • i3 & Sway native, flicker-free visibility toggling
  • Multi-monitor support with adaptive resizing and alignment to the active monitor
  • Flexible choice of terminal position; freely selectable dimensions
  • Great responsiveness by leveraging the i3/Sway IPC API
  • Support for multiple concurrent instances
  • Kitty argument forwarding (e.g. --session)

Image of Kitti3

Installation and setup

Kitti3 is a Python 3 package that lives on PYPI.

  1. To install Kitti3, either:

    • use pipx (recommended):
      $ pipx install kitti3
      
    • or use pip:
      $ pip install kitti3 --user
      
    • or copy main.py to somewhere on your $PATH, rename it to kitti3 and make it executable. (Note: in this case it's your responsibility to satisfy the Python dependencies)
  2. Ensure that Kitti3 is reachable (e.g. $ which kitti3); the WM won't necessarily complain later if it isn't!

  3. Add the following to your ~/.config/<WM>/config:

    exec_always --no-startup-id kitti3
    bindsym $mod+n nop kitti3
    

    where $mod+n refers to your keyboard shortcut of choice. Take a look at the configuration section below for a list of the CLI options that kitti3 accepts.

  4. Restart i3/Sway inplace (e.g. $mod+Shift+r)

  5. Trigger the shortcut to verify that the terminal appears (slight flicker / tiling noise is normal on the first toggle when Kitty is spawned and floated by Kitti3)

Configuration

Kitti3 does not make use of a dedicated configuration file, but its behaviour can be modified via commandline options:

$ kitti3 -h
usage: kitti3 [-h] [-n NAME] [-p {LT,LC,LB,CT,CC,CB,RT,RC,RB}]
              [-s SHAPE SHAPE] [-v]

Kitti3: i3/Sway drop-down manager for Kitty. Arguments following '--' are
forwarded to the Kitty instance

optional arguments:
  -h, --help            show this help message and exit
  -n NAME, --name NAME  name/tag used to identify this Kitti3 instance. Must
                        match the keybinding used in the i3/Sway config (e.g.
                        `bindsym $mod+n nop NAME`)
  -p {LT,LC,LB,CT,CC,CB,RT,RC,RB}, --position {LT,LC,LB,CT,CC,CB,RT,RC,RB}
                        where to position the Kitty window within the active
                        workspace, e.g. 'TL' for Top Left, or 'BC' for Bottom
                        Center (character order does not matter)
  -s SHAPE SHAPE, --shape SHAPE SHAPE
                        dimensions (x, y) of the Kitty window, each as a
                        fraction of the workspace size, e.g. '1.0 0.5' for
                        full width, half height 
  -v, --version         show kitti3's version number and exit

Command line options

-n, --name (default: kitti3)

The name option provides the string identifier used to connect a user-defined i3/Sway keybinding to the Kitti3 instance. Specifically, Kitti3 will listen to IPC events and toggle the visibility of Kitty when it encounters the bindsym command nop NAME - hence the requirement to include a "no-op" bindsym declaration in your config.

The name option value is also used internally to associate Kitti3 with the Kitty instance it manages (the latter is forwarded the argument --name NAME). For this reason it is worth ensuring that an instance name is chosen which is unlikely to collide with that of another application's window; it would be wise to avoid the likes of slack or discord.

-p, --position (default: RT)

The position option accepts a 2-char ID, which sets the Kitty window's location within the workspace (and implicitly in which directions to grow the window's dimensions). The window can be placed in one of nine locations:

  Left Center Right
Top LT CT RT
Center LC CC RC
Bottom LB CB RB

The case and order of the characters are inconsequential (i.e. LB == bl).

Note that for backwards compatibility, the position option additionally accepts an older location format, with the following mapping. The default position if none is provided is actually right (refer to the note on shape below for why this matters). These choices will be removed in a future release.

Old New
top LT
bottom LB
left LT
right RT

-s, --shape (default: 1.0 0.3)

The shape option specifies the (x, y) dimensions of the Kitty window relative to its workspace. Allowed values are in the range [0, 1], where 1.0 corresponds to the full extent of the given workspace axis.

Note that for backwards compatibility, shape values will be interpreted in (y, x) order when position is set to left or right.

Examples

Centered terminal with custom name and argument forwarding

The following i3/Sway configuration snippet produces a Kitty terminal positioned at the center of the workspace, filling half its height and 30% of its width. It is assigned the custom name "caterwaul", and the argument --session ~/.kitty_session is forwarded to Kitty when it is spawned.

exec_always --no-startup-id kitti3 -n caterwaul -p CC -s 0.5 0.3 -- --session ~/.kitty_session
bindsym $mod+n nop caterwaul

Note that any arguments following -- are ignored by Kitti3 and forwarded to the terminal when it is spawned.

Multiple instances

Multiple Kitti3 instances (and hence Kitty windows) can be run concurrently; they just need to be distinguished by unique instance names to avoid crosstalk, e.g.:

exec_always --no-startup-id kitti3 -n almond -p CT -s 0.5 0.25
bindsym $mod+t nop almond 
exec_always --no-startup-id kitti3 -n bubblegum -p CB -s 1.0 0.4
bindsym $mod+b nop bubblegum

Updating the configuration

Kitti3 must be respawned to trigger any changes made to its command line arguments in the i3/Sway config file. This can most easily be achieved by restarting the WM inplace (e.g. $mod+Shift+r), which because of the use of exec_always will spawn a new instance of Kitti3. The old instance will automatically exit when it detects a restart event, so you should not see any stray instances hanging around.

Dependencies

  • Kitty (duh)
  • i3 > 4 or Sway >= 1.6 (you should also be fine on the latest git)
  • Python >= 3.6
  • i3ipc-python (pip(x) will pull in >=2.0)

Alternatives

The following rant discussion was written some years ago and might not accurately represent the current day lay of the land.

The natives

If you're not too fussed about which terminal you're using then there are several alternatives out there that do drop-down out of the box, like guake and tilda. However, if you find yourself wanting to experiment with fonts that support programming ligatures (like the excellent FiraCode), your options quickly dwindle as terminals based on the VTE library (like the two above) still don't play well with ligatures.

The other bolt-ons

But you're here because you want to use Kitty, so forget about the natives for a second and instead ask yourself why you shouldn't just be using one of the other "drop-downifiers". Two notable mentions in this space are tdrop and i3-quickterm. tdrop is a swiss army knife that could probably turn a potato into a drop-down if you worked hard enough, but while feature rich it can be prohibitively slow and cause substantial flicker artifacts in i3wm during visibility toggling.

Kitti3 was actually inspired by the approach taken by i3-quickterm, which issues show/hide commands to i3 via IPC. It also supports other terminals than just Kitty, however its single-shot, mark-based design leads to some speed penalties and unwanted behaviour when spawning terminals. If you're open to using other terminals than Kitty (and have somehow made it this far into the readme), you should try it out. It was i3-quickterm's inability to display terminals as slide-ins (as opposed to drop-down or pop-up) that prompted the creation of Kitti3.

Kitti3 runs as a daemon and listens to events through the i3/Sway IPC API, using information about the active workspace to dynamically direct the WM in how to best resize and position Kitty when visibility is toggled. This leads to excellent responsiveness and no flicker artifacts, as well as a seamless experience in multi-monitor, multi-resolution setups.

Bare-metal i3/Sway config

"But I don't have a hundred external monitors on my desk!" you cry out. Well, if you're running a single-monitor setup, or you're simply content with having the terminal displayed on your main monitor only, then you don't actually need Kitti3 or any of the other bolt-ons. The WM is happy to take care of container floating and positioning if you're happy to work with absolute pixel values. This is where you start (add to ~/.config/<WM>/config):

exec --no-startup-id kitty --name dropdown 
for_window [instance="dropdown"] floating enable, border none, move absolute \
position 0px 0px, resize set 1920px 384px, move scratchpad
bindsym $mod+n [instance="dropdown"] scratchpad show

and the i3 user's guide will lead you the rest of the way.

Development

Found a bug? Feel like a feature is missing? Create an issue on GitHub!

Want to get your hands dirty and contribute? Great! Clone the repository and dig in.

The project follows a setuptools based structure and can be installed in development mode using pip (from the project root directory):

$ pip install -e .

This exposes the kitti3 entry point console script, which starts the Kitty manager.

License

Kitti3 is released under a BSD 3-clause license; see LICENSE for the details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].