Alacritty+distrobox keybindings

I migrated from Workstaion KDE to Kinoite yesterday, and am currently configuring it to suit my taste.

My terminal emulator of choice is Alacritty running Zsh.
I’ve installed Ubuntu, Fedora and Archlinux containers/toolboxes using distrobox.
I want keybindings to enter a toolbox in a new terminal window running Zsh. The three toolboxes should have different background/accent colors.

I’ve been looking around for a bit, but I’m unsure which approach will be best.

  1. Binding f12+u to distrobox-enter -n ubuntu-toolbxusing bind, and setting up zsh with my preferred extensions, aliases, etc. in all containers one by one.
  2. Somehow carrying over settings like preferred shell, aliases, extensions etc. from host system to containers, but using a separate alacritty config file for each container to change background color.

btw I’m having trouble using bind, is there a graphical way to achieve this on Plasma desktop?

1 Like

I don’t know what bind is but you should be able to configure global shortcuts in a settings page.

1 Like

Alright, that partially solves it for me. I just needed to look a bit deeper in the settings menus. Now I can launch Alacritty windows with these keybindings:
alt+shift+a: alacritty --command distrobox-enter -n arch-toolbx
alt+shift+u: alacritty --command distrobox-enter -n ubuntu-toolbx
alt+shift+f: alacritty --command distrobox-enter -n fedora-toolbx

What remains is to somehow identify which container runs in which terminal window

I’m not sure, but maybe you want to check alacritty --help if there any option to load custom config file path then add to your command above from shortcut.

Since I saw this topic here I also use Alacritty. I got annoyed because of the window title bar, that all are named “Alacrittty”. I found the solution in the arch wiki.

“user@host:cwd” in window title bar

You just need to add alacritty* to the /etc/bash.bashrc file. Follow the link to the arch wiki to see how. You just need to find the equivalent in Zsh.

About the colored background, you could use the --config-file option to open Alacritty with different config files.

1 Like

why not use -t or --title
or --class ?

alright, I got errors when trying to specify custom config file, so decided to use launch options. These options make it easy to tell separate containers apart.

Arch: alacritty -o window.title=Arch-toolbx -o "colors.primary.background='#314957'" --command distrobox-enter -n arch-toolbx

Ubuntu: alacritty -o window.title=Ubuntu-toolbx -o "colors.primary.background='#404325'" --command distrobox-enter -n ubuntu-toolbx

Fedora: alacritty -o window.title=Fedora-toolbx -o "colors.primary.background='#6C323A'" --command distrobox-enter -n fedora-toolbx