You are not logged in.
Pages: 1
Topic closed
I am trying to remap search key to capslock key using xmodmap in arch on acer c720 chromebook.
If I execute the command
$ xmodmap -e "keycode 133 = Caps_Lock"
in terminal, it works.
I get the search key works as capslock.
But I cann't get it remaped permenantly.
I created ~/.Xmodmap file using the command
$ xmodmap -pke > ~/.Xmodmap
then change the line
keycode 133 = Super_L NoSymbol Super_L
to
keycode 133 = Caps_Lock NoSymbol Caps_Lock
and then add these lines
if [ -s ~/.Xmodmap ]; then
xmodmap ~/.Xmodmap
fi
in ~/.xinitrc.
It doesn't work.
I am using openbox. I can excute most of commands at startup using autostart file.
But it doesn't work as well if I put this command
$ xmodmap -e "keycode 133 = Caps_Lock"
in ~/.config/openbox/autostart file.
my autostart file is this:
#
# These things are run when an Openbox X Session is started.
# You may place a similar script in $HOME/.config/openbox/autostart
# to run user-specific things.
#
# If you want to use GNOME config tools...
#
#if test -x /usr/lib/openbox/gnome-settings-daemon >/dev/null; then
# /usr/lib/openbox/gnome-settings-daemon &
#elif which gnome-settings-daemon >/dev/null 2>&1; then
# gnome-settings-daemon &
#fi
# If you want to use XFCE config tools...
#
#xfce-mcs-manager &
# Setting Wallpaper
(sleep 0.5s && feh --bg-scale /home/msh/Pictures/archlinux-889216.jpg) &
# Start Tint2 panel
(sleep 1s && tint2) &
# us,mm keyboard
(sleep 2s && setxkbmap -layout us,mm -option grp:alt_shift_toggle) &
# xbindkeys
(sleep 2.5s && xbindkeys) &
# Caps_Lock
(sleep 3s && xmodmap -e "keycode 133 = Caps_Lock") &
I think I should works. But it doesn't.
thz for helps in advance.
Last edited by mshan (2014-11-07 05:22:00)
Amazing !
Offline
What does your xinitrc look like? Does the xmodmap command come after the 'exec' line?
Offline
No. my ~/.xinitrc file is like this:
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
if [ -s ~/.Xmodmap ]; then
xmodmap ~/.Xmodmap
fi
# exec gnome-session
# exec startkde
# exec startxfce4
# ...or the Window Manager of your choice
# exec /usr/bin/ratpoison
exec openbox-session
actually I have tested both of before and after. But doesn't work.
Last edited by mshan (2014-11-05 10:16:13)
Amazing !
Offline
Nothing after the first 'exec' line is read, see the note https://wiki.archlinux.org/index.php/Xinitrc
What happens if you use
xmodmap -e "keycode 133 = Caps_Lock"
in ~/.xinitrc?
Have you tried using setxkbmap?
Offline
I can solve it now.
I configured my system to auto startx putting the line:
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
to ~/.bash_profile file
and automatic login to virtual console creating /etc/systemd/system/getty@tty1.service.d/autologin.conf file like this:
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin username --noclear %I 38400 linux
when my openbox's autostart file like this:
#
# These things are run when an Openbox X Session is started.
# You may place a similar script in $HOME/.config/openbox/autostart
# to run user-specific things.
#
# If you want to use GNOME config tools...
#
#if test -x /usr/lib/openbox/gnome-settings-daemon >/dev/null; then
# /usr/lib/openbox/gnome-settings-daemon &
#elif which gnome-settings-daemon >/dev/null 2>&1; then
# gnome-settings-daemon &
#fi
# If you want to use XFCE config tools...
#
#xfce-mcs-manager &
# Setting Wallpaper
(sleep 0.5s && feh --bg-scale /home/msh/Pictures/archlinux-889216.jpg) &
# Start Tint2 panel
(sleep 1s && tint2) &
# us,mm keyboard
(sleep 2s && setxkbmap -layout us,mm -option grp:alt_shift_toggle) &
# xbindkeys
(sleep 2.5s && xbindkeys) &
At that time, I can not execute any xmodmap command. But I can execute any other command like compton or something using openbox's autostart file and ~/.xinitrc using ~/.Xmodmap.
the solution is that I configured my system back to normal (manual login and manual startx) removing the line:
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
in ~/.bash_profile file and removing
/etc/systemd/system/getty@tty1.service.d/autologin.conf file.
then I put the lines:
# Caps_Lock
(sleep 3s && xmodmap -e "keycode 133 = Caps_Lock") &
in my openbox's autostart file.
reboot, check it works (yes it works) and set my system back again to auto login and auto startx by the way I mentioned above.
and then finally reboot again and check it still works (yes it still works)
I have already tested using ~/.Xmodmap and editing ~/.xinitrc with the solution above.
yes it works.
I don't know what I found is the cause of my problem or not.
Last edited by mshan (2014-11-07 05:25:18)
Amazing !
Offline
This, in a ~/.config/autostart/foo.desktop file, will work:
xmodmap -e 'keysym Super_L = Caps_Lock'
And now this thread that is marked SOLVED actually is solved, and isn’t just titled with a big damned lie.
Offline
Offline
Pages: 1
Topic closed