Add kitty, alacritty and tmux confs

This commit is contained in:
Daniel Carrillo 2021-12-05 19:59:14 +01:00
parent b050edabdf
commit 44b209a56d
Signed by: dcarrillo
GPG Key ID: E4CD5C09DAED6E16
5 changed files with 1682 additions and 0 deletions

View File

@ -0,0 +1,64 @@
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
env:
TERM: xterm-256color
# LANG: "en_US.UTF-8"
# LC_CTYPE: en_US.UTF-8
shell:
program: /bin/zsh
args:
- -l
- -c
- "tmux attach || tmux"
window:
dimensions:
columns: 150
lines: 35
position:
x: 1200
y: 510
scrolling:
history: 50000
cursor:
style: Underline
selection:
semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
font:
normal:
family: "Roboto Mono"
style: Regular
size: 9.0
use_thin_strokes: true
colors:
primary:
background: '#073642'
foreground: '#BABABA'
normal:
black: '#000000'
red: '#E8341C'
green: '#68C256'
yellow: '#F2D42C'
blue: '#1C98E8'
magenta: '#8E69C9'
cyan: '#1C98E8'
white: '#BABABA'
bright:
black: '#666666'
red: '#E05A4F'
green: '#77B869'
yellow: '#EFD64B'
blue: '#387CD3'
magenta: '#957BBE'
cyan: '#3D97E2'
white: '#BABABA'

1520
.config/kitty/kitty.conf Normal file

File diff suppressed because it is too large Load Diff

40
.config/kitty/secrets.py Normal file
View File

@ -0,0 +1,40 @@
from contextlib import closing
from typing import Dict, List
from simple_term_menu import TerminalMenu
import secretstorage
from kitty.boss import Boss
def main(args: List[str]) -> str:
options = get_secret_names(args[1], args[2])
terminal_menu = TerminalMenu(options)
menu_entry_index = terminal_menu.show()
if menu_entry_index is not None:
return list(options.values())[menu_entry_index]
return ''
def get_secret_names(attribute: str, value: str) -> Dict[str, str]:
secrets = {}
with closing(secretstorage.dbus_init()) as bus:
for keyring in secretstorage.get_all_collections(bus):
for item in keyring.get_all_items():
if item.is_locked():
item.unlock()
attr = item.get_attributes()
if attr.get(attribute) == value:
secrets[item.get_label()] = item.get_secret().decode('utf-8')
return secrets
def handle_result(args: List[str], answer: str, target_window_id: int, boss: Boss) -> None:
window = boss.window_id_map.get(target_window_id)
if window is not None:
window.paste(answer)

56
.config/tmux.conf Normal file
View File

@ -0,0 +1,56 @@
# remap bind key from 'Ctrl-b' to 'Ctrl-q'
unbind C-b
set-option -g prefix C-q
bind-key C-q send-prefix
set -g mouse off
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
# reload config
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# start counting windows and panels from 1
# set -g base-index 1
# set-window-option -g pane-base-index 1
# set-option -g allow-rename off
# split panes
bind | split-window -h
bind - split-window -v
bind e split-window -h
bind o split-window -v
unbind '"'
unbind %
# scroll up/down
bind -n Pageup copy-mode -u
bind -n S-Pageup copy-mode -u
bind -n S-Pagedown send-keys Pagedown
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# turn off all sounds
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none
# statusbar
# https://www.ditig.com/256-colors-cheat-sheet
set -g status-position bottom
set -g status-style 'bg=colour235 fg=colour255'
set -g status-left-length 50
set -g status-left " "
set -g status-right ""
# pane
set -g pane-border-style 'bg=default fg=colour8'
set -g pane-active-border-style 'bg=default fg=colour8'
set -g message-style 'fg=colour255 bg=colour62'

2
.zshrc
View File

@ -41,6 +41,8 @@ alias mknamedvenv='mkvirtualenv $(basename $PWD) -r requirements.txt'
alias dkillall='docker rm -f $(docker ps -qa)'
alias k=kubectl
alias kconfig='echo "$(kubectl config current-context) ($(kubectl config view --minify --output "jsonpath={..namespace}"))"'
alias icat="kitty +kitten icat --align=left"
alias idiff="kitty +kitten diff"
##### tilix #####