You are not logged in.
So, after some struggles I managed to make a custom keymap which I have saved as ~/.Xkeymap and I can load it "by hand" with xkbcomp .Xkeymap $DISPLAY
Now the problem is that I want to load it on start with xinit (if possible), the problem is that this way: test -f ~/.Xkeymap && xkbcomp ~/.Xkeymap $DISPLAY which I got from arch wiki doesn't work. The problem is that it runs before the $DISPLAY var is set. I will try it with sleep and report back but it seems really hacky.
Here is my ~/.xinitrc:
#!/bin/sh
xrdb -load $HOME/.Xresources &
[ -f ~/.Xkeymap ] && xkbcomp ~/.Xkeymap $DISPLAY &
session=${1:-gnome}
case $session in
"gn"|"gnome")
export XDG_SESSION_TYPE=x11
export GDK_BACKEND=x11
exec gnome-session
;;
"bsp"|"bspwm")
exec bspwm
;;
*) exec "$1" ;;
esac* Adding sleep 1 did work but it really feels hacky...
Last edited by r1amu (2021-03-02 17:14:37)
Offline
You should not background either of these two commands (... remove the trailing &) as they are intended to modify specifics of the current xorg server that shouldn't be done concurrently.
In general your .xinitrc is broken and doesn't include a few necessary includes to make sure the environment is properly setup, copy the template from the system directory and add your modifications after, note the blue notes in https://wiki.archlinux.org/index.php/Xinit#xinitrc
Last edited by V1del (2021-03-01 00:58:21)
Offline
Thanks for the reply V1del. I had a look at the default xinitrc and added this if statement as that was the only thing that was really missing:
if [ -d /etc/X11/xinit/xinitrc.d ]
then
for f in /etc/X11/xinit/xinitrc.d/?*.sh
do
[ -x "$f" ] && source "$f"
done
unset f
fi(I checked and I do not have default .Xresources or .Xmodmap)
I also removed the the backgrounding of both xrdb and xkbcomp, xrdb works fine but xkbcomp now doesn't load at all even with sleep
Offline
The problem is that it runs before the $DISPLAY var is set.
Are you positive about that? W/o $DISPLAY xrdb should™ fail just as much.
I'd rather suspect that the session simply overrides your keymap - notably yor gnome session.
Does it work if you only "exec xterm"?
Offline
So I tested few things and it's kinda weird.
If I background both xrdb and xkbcomp with & and add a delay with sleep 1 to xkbcomp they both work in bspwm. If I use the same setup with xterm only xkbcomp gets loaded.
If I remove the backgrounding and the delay then it works as expected with xterm, but when launching bspwm only xrdb loads as it should.
Here is what I launch in my bspwmrc:
#!/bin/sh
# Autostart
sxhkd &
setxkbmap -option "caps:escape" \
-option "altwin:menu_win" \
-option "terminate:ctrl_alt_bksp" &
xsetroot -cursor_name left_ptr &
xset r rate 250 60 &
wlp -r & # Wallpaper script
unclutter &
picom -b &
hinf & # Show notification with some infoOffline
setxkbmap…
a) don't fork it (same for xsetroot and xset )
b) run it before sxhkd
c) try running xkbmap there and before sxhkd, but after setxkbmap
Offline
Thank you seth! now it works, at least in bspwm, any tips for Gnome?
Offline
Offline
Thank you!
Offline
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Offline