Added old-school WSL Xauthority configuration
This commit is contained in:
parent
56a38c8e51
commit
1871c5dde6
1 changed files with 14 additions and 0 deletions
14
2018-xx-xx_wsl-xauthority.bashrc
Normal file
14
2018-xx-xx_wsl-xauthority.bashrc
Normal file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Provides a stub for WSL when using X11 forwarding to ensure the xauthority is updated correctly.
|
||||
|
||||
# First make a timestamp that represents "startup" timestamp
|
||||
touch "$HOME/.uptime_tag" -d "$(uptime -s)"
|
||||
# If file is missing or is outdated, fix it!
|
||||
if [[ ! -e "$HOME/.Xauthority" || "$HOME/.uptime_tag" -nt "$HOME/.Xauthority" ]]; then
|
||||
# then create the new Xauthority file IF display is defined
|
||||
# but only do it if we have a display
|
||||
if [[ ! -z "$DISPLAY" ]]; then
|
||||
xauth add "$DISPLAY" . $(mcookie)
|
||||
fi
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue