Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard and mouse grab issue ? #25

Closed
badele opened this issue Mar 5, 2018 · 10 comments
Closed

Keyboard and mouse grab issue ? #25

badele opened this issue Mar 5, 2018 · 10 comments
Labels

Comments

@badele
Copy link

badele commented Mar 5, 2018

I trying doing a new docker image (docker-bspwm on arch linux). But i don't know why, the key released don't seem work. I have installed a key-mon for showing the key, not result, but if i use xev, i can see the key code

Have you a good method for debuging the keyboard issue ?

I use

docker build --rm -f docker-bspwm/Dockerfile -t bspwm docker-bspwm
x11docker --xephyr --user=root --pulseaudio --desktop bspwm xterm
#x11docker --xephyr --user=root --pulseaudio --desktop bspwm startx

I have tested this on currently xorg and physical terminal

@mviereck
Copy link
Owner

mviereck commented Mar 5, 2018

I don't see an obvious reason on the first glance. You can try to install a locale in your image. Example for debian, adjust apt-get for arch:

# replace en_US by your desired locale setting, for example de_DE for german.
ENV LANG en_US.UTF-8
RUN echo $LANG UTF-8 > /etc/locale.gen
RUN apt-get install -y locales && update-locale --reset LANG=$LANG

If the issue persists, please run with option --verbose and provide me the output. It is quite long, best way is to store it at https://pastebin.com/.

Edit: Aside from the issue:
In your Dockerfile you create a /fakehome/root folder and add some dotfiles. To be more flexible I recommend a solution that does not rely on a specific user or a specifc home folder. Just add your dotfiles to /etc/skel and include this startscript in Dockerfile:

# startscript to copy dotfiles from /etc/skel
# runs either CMD or image command from docker run
RUN echo '#! /bin/sh\n\
[ -e "$HOME/.config" ] || cp -R /etc/skel/. $HOME/ \n\
exec $* \n\
' > /usr/local/bin/start 
RUN chmod +x /usr/local/bin/start 

ENTRYPOINT start
CMD startx

@mviereck
Copy link
Owner

mviereck commented Mar 5, 2018

One possible reason for the issue:

For Xephyr the keyboard mapping is adjusted in xinitrc to match keyboard settings on host with:

setxkbmap -display $Hostdisplay -print | xkbcomp - $Newdisplay

Maybe this command fails somehow and leaves a mess. Can you please show me the output of setxkbmap -display $DISPLAY -print ?

@badele
Copy link
Author

badele commented Mar 5, 2018

Hi,

On another computer i progress. The grab it seem working :) Now it show missing a file (my script :) ).

For information, in this computer, x11docker show message, i must run with root user.

This evening, i will test with my home computer. i will inform you

I would take the opportunity to implement the skeleton

@mviereck
Copy link
Owner

mviereck commented Mar 6, 2018

I would like to see the output of setxkbmap -display $DISPLAY -print, maybe it contains a ' or some others chars that cause the issue.

I did a change in x11docker 3.9.4.2 that may avoid the issue.

mviereck added a commit that referenced this issue Mar 6, 2018
# 06.03.2018 V3.9.4.2   store keyboard layout (xkb_keymap) in separate file, not in xinitrc. Set on all X servers. #25
@badele
Copy link
Author

badele commented Mar 6, 2018

If,

That works :), It's my fault (missing some files), but some points:

The initial skeleton not work for me, i must use echo with -e option, if not, the return feed line is not done and generate error message in container image.

I don"t know why in another computer, i receive this error message "x11docker must run as root", my user account is in the docker group (for two computers)

But, the good news, it works ! :) Good job :).

Can you waiting some days before close this ticket ? I would like do more investigate ?

Thanks

@mviereck
Copy link
Owner

mviereck commented Mar 6, 2018

That works :),

:)
Would still like to see the output of setxkbmap -display $DISPLAY -print.

The initial skeleton not work for me, i must use echo with -e option

ok, echo has dozens of different implementations. printf would provide a more general syntax.

I don"t know why in another computer, i receive this error message "x11docker must run as root", my user account is in the docker group (for two computers)

hm, don't know, too. You would need it for --hostuser but not for --user.

Can you waiting some days before close this ticket ? I would like do more investigate ?

I would like to close as the bug itself is fixed. But even in a closed bug you can still comment and I will answer. Also, feel free to open a new ticket for different themes, may they be big or small.

@mviereck mviereck closed this as completed Mar 6, 2018
@mviereck mviereck added the bug label Mar 6, 2018
@mviereck
Copy link
Owner

mviereck commented Mar 7, 2018

Inspired by your issue with keymaps I have made an update (V3.9.5) with new option --keymap LAYOUT where you can specify a desired keymap different from autodetected host keymap. For example --keymap fr would set the docker keyboard map to french.

Would still like to see the output of setxkbmap -display $DISPLAY -print, please don't let me starve. ;-)

@badele
Copy link
Author

badele commented Mar 7, 2018

Ourp, i forgot your request for setxkbmap :)

xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(azerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+fr+inet(evdev)"	};
	xkb_geometry  { include "pc(pc105)"	};
};

It is good for you ? You need more informations

@mviereck
Copy link
Owner

mviereck commented Mar 7, 2018

Thanks! Hm. I thought the output would show something strange that could explain the issues from your first post, but it looks all well.

Before the fix the output of setxkbmap was given with echo to xkbcomp. You found out that echo works different on arch, maybe the reason lies here.

I have some hundred echo in x11docker, maybe I have to review them all and replace with printf. o_O

@mviereck
Copy link
Owner

Just a note: I found that

ENTRYPOINT start
CMD startx

fails in setups without x11docker.
Instead use:

ENTRYPOINT ["/usr/local/bin/start"]
CMD ["startx"]

I've just updated a bunch of my Dockerfiles due to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants