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

Forcibly setting $DISPLAY to :0 #121

Closed
ViktorWalter opened this issue Apr 7, 2022 · 7 comments
Closed

Forcibly setting $DISPLAY to :0 #121

ViktorWalter opened this issue Apr 7, 2022 · 7 comments

Comments

@ViktorWalter
Copy link
Collaborator

On

DISPLAY=:0 && xset r rate 350 55 2> /dev/null

the commons.sh is setting the $DISPLAY variable to :0, in order to fix the keyboard repeat rate.
This is problematic, since it breaks ssh X11 Forwarding - when you do e.g. ssh -X user@host, the sshd on host sets $DISPLAY to the appropriate value corresponding to the remote display assigned to the remote session, e.g. localhost:10.0.
Sourcing commons.sh in my .bashrc / .zshrc sets it back to :0, so if I don't manually set it back I can't display remote graphical interfaces.
Instead of manually setting the variable, I would recommend to instead check if $DISPLAY is set before doing xset r rate ....

@matemat13
Copy link
Collaborator

Maybe the best solution would be to save the original value of $DISPLAY and then set it back after this line? A good catch, nevertheless!

@ViktorWalter
Copy link
Collaborator Author

ViktorWalter commented Apr 7, 2022

Yeah, that's my current workaround:

DISPLAY_STORE=$DISPLAY
source ~/git/linux-setup/appconfig/shell/commons.sh_git
DISPLAY=$DISPLAY_STORE

But apparently we have linux-setup on drones and I'm told some people have already had trouble with ssh -X on them.

@klaxalk
Copy link
Owner

klaxalk commented Apr 7, 2022

I am not even sure if the export needs to be there...

@klaxalk
Copy link
Owner

klaxalk commented Apr 7, 2022

It seems it works even without it. I will remove it and let's observe if it breaks something.

@ViktorWalter
Copy link
Collaborator Author

This is the best attitude to have 😄.

@klaxalk
Copy link
Owner

klaxalk commented Apr 8, 2022

Improvement by reduction :-).

@ViktorWalter
Copy link
Collaborator Author

Let's consider this solved until it breaks something then.

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

No branches or pull requests

3 participants