Skip to main content
Topic: startup remaps deactivate some time after booting (Read 422 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

startup remaps deactivate some time after booting

I use LARBS as config for my system after fresh install of artix-runit. There is a remaps script in ~/.local/bin/ directory that has a bunch of keyboard related configurations in it:
Code: [Select]
#!/bin/sh

# This script is called on startup to remap keys.
# Decrease key repeat delay to 300ms and increase key repeat rate to 50 per second.
xset r rate 300 50
setxkbmap -option caps:swapescape
# Map the caps lock key to super, and map the menu key to right super.
setxkbmap -option altwin:menu_win
# When caps lock is pressed only once, treat it as escape.
killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape'
# Turn off caps lock if on since there is no longer a key for it.
#xset -q | grep "Caps Lock:\s*on" && xdotool key Caps_Lock

and it's called from ~/.xprofile like this:
Code: [Select]
#!/bin/sh

# This file runs when a DM logs you into a graphical session.
# If you use startx/xinit like a Chad, this file will also be sourced.

xrandr --dpi 96 # Set DPI. User may want to use a larger number for larger screens.
setbg & # set the background with the `setbg` script
xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & xrdbpid=$! # Uncomment to use Xresources colors/settings on startup
remaps & # run the remaps script, switching caps/esc and more; check it for more info

autostart="mpd xcompmgr dunst unclutter pipewire"

for program in $autostart; do
pidof -s "$program" || "$program" &
done >/dev/null 2>&1

# Ensure that xrdb has finished running before moving on to start the WM/DE.
[ -n "$xrdbpid" ] && wait "$xrdbpid"
My problem is, some times, not always, couple of hours after system startup, all keyboard configurations get deactivated (rate decrease, caps and escape are back to original keys etc.). and I have to open the terminal and run the remaps script manually to re-activate the keymaps.
Can somebody tell me where's the problem? Is there something wrong with my .xprofile?
I have systems running on arch linux and this problem never happened in any of them.

Re: startup remaps deactivate some time after booting

Reply #1
This also happens to me in that my layout configuration resets after some time.

I don't know about you, but I had this problem on Arch, including someone else.

According to this guy, it's dbus. Someone else also recommended a probable fix: Fcitx

The simplest solution I recommend for now is to put your config script in the background using a while true; do ... ; sleep 30m; done loop to re-apply your settings every 30 minutes.

 

Re: startup remaps deactivate some time after booting

Reply #2
I don't know about you, but I had this problem on Arch
I noticed that my other two arch linux devices are laptops and the one running artix is a desktop. So maybe it has something to do with the usb keyboard. 

Also I had a setxkbmap command in the remaps script for toggling the layout between us and ir. Anytime this problem happened, the switching keys didn't work anymore (even after running the script manually!). So I moved the toggling command to the 00-keyboard.conf file in /etc/X11/xorg.conf.d/ and last time I checked after the configuration got lost, I still was able to toggle the layout.
I guess if I move other options (caps and the menu key swaps) to the .conf file, they will become permanent too. But I'm not sure if I can set the repeat rate in the .conf file also.