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.
 
 
 
 
 
 

14 lines
603 B

#!/bin/bash
# Check if keyd is using the swapped config
if pgrep -f "keyd.*default.conf" > /dev/null && keyd list | grep -q "capslock = esc"; then
# Currently swapped, switch to normal config
sudo cp ~/.config/keyd/normal.conf ~/.config/keyd/default.conf
sudo keyd reload
notify-send "Keyboard Layout" "Caps Lock and Escape returned to normal" -i input-keyboard
else
# Not swapped, switch to swapped config
sudo cp ~/.config/keyd/swapped.conf ~/.config/keyd/default.conf
sudo keyd reload
notify-send "Keyboard Layout" "Caps Lock and Escape swapped" -i input-keyboard
fi