alacritty: add binding to swap foreground color between green and orange
This commit is contained in:
parent
83be4a8e85
commit
5fc4968a93
@ -99,6 +99,7 @@ key_bindings:
|
|||||||
- { key: Key0, mods: Control, action: ResetFontSize }
|
- { key: Key0, mods: Control, action: ResetFontSize }
|
||||||
- { key: Equals, mods: Control, action: IncreaseFontSize }
|
- { key: Equals, mods: Control, action: IncreaseFontSize }
|
||||||
- { key: Subtract, mods: Control, action: DecreaseFontSize }
|
- { key: Subtract, mods: Control, action: DecreaseFontSize }
|
||||||
|
- { key: Backslash, mods: Command, command: "/home/adam/.config/alacritty/swapColors.sh" }
|
||||||
- { key: Home, chars: "\x1bOH", mode: AppCursor }
|
- { key: Home, chars: "\x1bOH", mode: AppCursor }
|
||||||
- { key: Home, chars: "\x1b[H", mode: ~AppCursor }
|
- { key: Home, chars: "\x1b[H", mode: ~AppCursor }
|
||||||
- { key: End, chars: "\x1bOF", mode: AppCursor }
|
- { key: End, chars: "\x1bOF", mode: AppCursor }
|
||||||
|
19
.config/alacritty/swapColors.sh
Executable file
19
.config/alacritty/swapColors.sh
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
file="$(dirname $0)/alacritty.yml"
|
||||||
|
|
||||||
|
prefix=' foreground: '
|
||||||
|
amber="'0xb98000'"
|
||||||
|
green="'0x008000'"
|
||||||
|
color=$amber
|
||||||
|
|
||||||
|
if [ -n "$1" ]
|
||||||
|
then
|
||||||
|
[ "$1" == "green" ] && color=$green
|
||||||
|
else
|
||||||
|
current=$(grep -oP '^'"$prefix"'\K.*$' "$file")
|
||||||
|
echo $current
|
||||||
|
[ "$current" == "$amber" ] && color=$green
|
||||||
|
fi
|
||||||
|
|
||||||
|
sed -i 's/^'"${prefix}"'.*/'"${prefix}${color}"'/' "$file"
|
Loading…
Reference in New Issue
Block a user