From a0bececb436ad7b0807ffe798e311c5ec5d97255 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Fri, 15 Apr 2022 14:53:04 -0700 Subject: [PATCH] profile: move swapping caps and escape to a script --- .config/shell/bin/swap-caps-escape | 14 ++++++++++++++ .config/shell/profile | 14 ++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) create mode 100755 .config/shell/bin/swap-caps-escape diff --git a/.config/shell/bin/swap-caps-escape b/.config/shell/bin/swap-caps-escape new file mode 100755 index 0000000..4fed192 --- /dev/null +++ b/.config/shell/bin/swap-caps-escape @@ -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" diff --git a/.config/shell/profile b/.config/shell/profile index 5d7a1dd..06448f9 100644 --- a/.config/shell/profile +++ b/.config/shell/profile @@ -56,18 +56,12 @@ export $(dbus-launch) if [ "$(tty | sed 's-[0-9]$--g')" = /dev/tty ]; then export IS_TTY=true - # 1- Swap caps and escape - 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 + # Change the prompt theme to one that doesn't use nerdfonts export P10K_CONFIG_LOCATION="$HOME/.config/shell/p10k/simple.p10k.zsh" + echo + echo "Welcome home" + else export IS_TTY=false