Fix and remove unnecessary items (win-to-altgr_xmodmap.sh)

This commit is contained in:
q3aql 2020-11-05 14:41:32 +01:00
parent 5c3fca2273
commit d701077ea1

View File

@ -17,15 +17,13 @@ if [ -f ${xmodmap_config_file} ] ; then
sleep 2 sleep 2
restore_key=$(cat ${xmodmap_config_file}) restore_key=$(cat ${xmodmap_config_file})
xmodmap -e "keycode ${restore_key} = Super_L" xmodmap -e "keycode ${restore_key} = Super_L"
rm -rf ${HOME}/.Xmodmap
rm -rf ${xmodmap_config_file} rm -rf ${xmodmap_config_file}
echo "* Restored!" echo "* Restored!"
else else
echo "* Creating mapping of Win-Key to AltGr-Key..." echo "* Creating mapping of Win-Key to AltGr-Key..."
sleep 2 sleep 2
win_key_detect=$(xmodmap -pke | grep Super_L | grep keycode | head -1 | cut -d " " -f 2) win_key_detect=$(xmodmap -pke | grep Super_L | tr -s " " | grep keycode | head -1 | cut -d " " -f 2)
echo ${win_key_detect} > ${xmodmap_config_file} echo ${win_key_detect} > ${xmodmap_config_file}
xmodmap -e "keycode ${win_key_detect} = ISO_Level3_Shift" xmodmap -e "keycode ${win_key_detect} = ISO_Level3_Shift"
echo "keycode ${win_key_detect} = ISO_Level3_Shift" > ${HOME}/.Xmodmap
echo "* Created!" echo "* Created!"
fi fi