alacritty: add config with color switching, use as terminal in i3
This commit is contained in:
parent
ebd7b86e4c
commit
aa1690a445
19
.config/alacritty/alacritty.yml
Normal file
19
.config/alacritty/alacritty.yml
Normal file
@ -0,0 +1,19 @@
|
||||
# See: /usr/share/doc/alacritty/example/alacritty.yml
|
||||
|
||||
env:
|
||||
TERM: xterm-256color
|
||||
|
||||
colors:
|
||||
primary:
|
||||
background: '#424242'
|
||||
foreground: '#eeeeee'
|
||||
|
||||
font:
|
||||
size: 13.5
|
||||
normal:
|
||||
family: Fantasque Sans Mono
|
||||
|
||||
key_bindings:
|
||||
- key: F6
|
||||
mods: Control|Shift
|
||||
command: { program: "/bin/sh", args: ["-c", "~/.config/alacritty/switch_bg.py"] }
|
15
.config/alacritty/switch_bg.py
Executable file
15
.config/alacritty/switch_bg.py
Executable file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import os
|
||||
|
||||
path = os.path.join(os.getenv('HOME'), '.config/alacritty/alacritty.yml')
|
||||
with open(path, 'r+') as f:
|
||||
cfg = f.read()
|
||||
if " background: '#424242'" in cfg:
|
||||
cfg = cfg.replace(" background: '#424242'", " background: '#fafafa'")
|
||||
cfg = cfg.replace(" foreground: '#eeeeee'", " foreground: '#424242'")
|
||||
else:
|
||||
cfg = cfg.replace(" background: '#fafafa'", " background: '#424242'")
|
||||
cfg = cfg.replace(" foreground: '#424242'", " foreground: '#eeeeee'")
|
||||
f.seek(0)
|
||||
f.write(cfg)
|
@ -22,7 +22,7 @@ bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 3
|
||||
floating_modifier $mod
|
||||
|
||||
# start a terminal
|
||||
bindsym $mod+Shift+Return exec "emacsclient -n -c --eval '(vterm)'"
|
||||
bindsym $mod+Shift+Return exec alacritty
|
||||
|
||||
# start new Emacs frame
|
||||
bindsym $mod+e exec "emacsclient -n -c"
|
||||
|
Loading…
x
Reference in New Issue
Block a user