You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

13 lines
385 B

#!/bin/bash
# Get current state of Caps Lock and Escape key swap
current_state=$(setxkbmap -query | grep options | grep "caps:escape" | wc -l)
# If the swap is off, turn it on; otherwise, turn it off
if [ $current_state -eq 0 ]; then
echo "Swapping Caps Lock and Escape..."
setxkbmap -option caps:escape
else
echo "Reverting to normal layout..."
setxkbmap -option
fi