profile: move swapping caps and escape to a script
This commit is contained in:
parent
80e6430342
commit
a0bececb43
2 changed files with 18 additions and 10 deletions
14
.config/shell/bin/swap-caps-escape
Executable file
14
.config/shell/bin/swap-caps-escape
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# This will swap caps and escape. Will ask for root privilage.
|
||||||
|
# Requires: sudo
|
||||||
|
# Usage: swap-caps-escape
|
||||||
|
|
||||||
|
TMP_KEYMAP=/tmp/keymap_tmp.kmap
|
||||||
|
cat <<-EOF > "$TMP_KEYMAP"
|
||||||
|
keycode 1 = Caps_Lock
|
||||||
|
keycode 58 = Escape
|
||||||
|
EOF
|
||||||
|
|
||||||
|
sudo loadkeys "$TMP_KEYMAP"
|
||||||
|
|
||||||
|
rm "$TMP_KEYMAP"
|
|
@ -56,18 +56,12 @@ export $(dbus-launch)
|
||||||
if [ "$(tty | sed 's-[0-9]$--g')" = /dev/tty ]; then
|
if [ "$(tty | sed 's-[0-9]$--g')" = /dev/tty ]; then
|
||||||
export IS_TTY=true
|
export IS_TTY=true
|
||||||
|
|
||||||
# 1- Swap caps and escape
|
# Change the prompt theme to one that doesn't use nerdfonts
|
||||||
TMP_KEYMAP=/tmp/keymap_tmp.kmap
|
|
||||||
cat <<-EOF >> "$TMP_KEYMAP"
|
|
||||||
keycode 1 = Caps_Lock
|
|
||||||
keycode 58 = Escape
|
|
||||||
EOF
|
|
||||||
sudo -n loadkeys "$TMP_KEYMAP" 2>/dev/null
|
|
||||||
rm "$TMP_KEYMAP"
|
|
||||||
|
|
||||||
# 2- Change the prompt theme to one that doesn't use nerdfonts
|
|
||||||
export P10K_CONFIG_LOCATION="$HOME/.config/shell/p10k/simple.p10k.zsh"
|
export P10K_CONFIG_LOCATION="$HOME/.config/shell/p10k/simple.p10k.zsh"
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Welcome home"
|
||||||
|
|
||||||
else
|
else
|
||||||
export IS_TTY=false
|
export IS_TTY=false
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue