Problems Swapping Alt_L and Super_L on MacBook (Xubuntu 10.10)
Hi everybody. I'm running into some trouble swapping my Alt_L and Super_L keys on my 2006 Apple MacBook. For starters, I'm running Xubuntu 10.10, and I want to swap the keys because Apple's standard key mapping has the two keys reversed. This is going to be a lengthy post with lots of information, and I apologize for that, but I'm hoping that this information will be helpful.
For starters, running "xmodmap -pk" without having made any prior modifications to .bashrc or .xmodmap shows me the following: Code:
64 0xffe9 (Alt_L) 0xffe7 (Meta_L) 0xffe9 (Alt_L) 0xffe7 (Meta_L) Code:
xmodmap -e 'keycode 64 = Super_L' Code:
KeyPress event, serial 34, synthetic NO, window 0x5400001, Code:
keycode 64 = Super_L Code:
64 0xffeb (Super_L) 0x0000 (NoSymbol) 0xffeb (Super_L) Code:
keycode 64 = Super_L Code:
xmodmap -e 'keycode 64 = Super_L' For what it's worth, the only thing that works is running gnome-keyboard-properties, in which I have my keyboard layout settings adjusted so that Alt_L and Super_L are swapped. While this works perfectly after I open and close it, it's not exactly an optimal solution at all, as I also had to install all kinds of other GNOME applications along with it, including GNOME's appearance and startup management programs, which are interfering with XFCE's own settings. But, after running gnome-keyboard properties, the output of running "xmodmap" in terminal changes from (changes in bold): Code:
shift Shift_L (0x32), Shift_R (0x3e) Code:
shift Shift_L (0x32), Shift_R (0x3e) Thanks a ton. |
Well, for one thing, .bashrc usually only gets read when you start a non-login bash terminal (see the INVOCATION section of the bash manpage), and your desktop environment probably doesn't use bash to set its environment anyway, so your commands aren't being loaded when your x-session starts. Try creating a script for the command and launch it with your DE's autostart function instead.
|
Well I gave that a try, and no dice. Neither xev or xmodmap -pk report any changes at all after starting up, but they report correctly after I run the script manually after logging in. I'm guessing the script isn't running at startup for some reason, but either way, the changes still don't take effect on my keyboard after running the script.
Here's the script I made. I called it xmodmap-changes and it's located in ~/.scripts/xmodmap-changes. Code:
#!/bin/bash Did I go wrong somewhere in that process? |
I found a command that actually works!
$ setxkbmap -option altwin:swap_lalt_lwin And that's it! Alt_L and Super_L are then swapped and function properly. However, the changes are undone when restarting, so I removed the xmodmap commands from the original script and replaced them with the command above, added the script to my startup list, and everything is working beautifully now, with Alt_L and Super_L swapped. Hooray! Thank you for the suggestion David the H. It did help me come to my final solution, and I learned a little about scripting to boot. :D |
All times are GMT -5. The time now is 07:53 PM. |