1
1
#! /bin/bash
2
2
# runx: Provide an X server in Cygwin, MSYS2 or WSL.
3
3
4
- Version=" v0.4.18 "
4
+ Version=" v0.4.20 "
5
5
6
6
usage () { # Usage information (--help)
7
7
echo " runx - Run Linux GUI applications on MS Windows.
@@ -63,6 +63,13 @@ Providing an X server in background all the time:
63
63
- Create an entry in ~/.bashrc: source /usr/local/bin/runx
64
64
- In future terminal session you can directly run GUI commands.
65
65
E.g. just type: 'pcmanfm' instead of 'runx -- pcmanfm'.
66
+ - If you specify a display number with --display, runx will re-use
67
+ a possibly already running X server with same display number
68
+ and only provide the access credentials DISPLAY and XAUTHORITY.
69
+ This allows to use the same X server across several terminals.
70
+
71
+ runx stores the access credentials DISPLAY and XAUTHORITY in ~/.Xenv
72
+ This allows sourcing the file for custom access setups.
66
73
67
74
runx version $Version
68
75
Please report issues and get help at: https://github.com/mviereck/runx
@@ -283,7 +290,6 @@ check_displayport() { # Return 0 if display number $1 is in use
283
290
(< /dev/tcp/" $Hostip " /$(( 6000 + ${1:- } )) ) > /dev/null 2>&1
284
291
}
285
292
check_host () { # Check host environment
286
-
287
293
# Check for MS Windows subsystem
288
294
command -v cygcheck.exe > /dev/null && {
289
295
cygcheck.exe -V | rmcr | grep -q " (cygwin)" && Winsubsystem=" CYGWIN"
@@ -606,6 +612,7 @@ declare_variables() {
606
612
Sharegpu=" no"
607
613
Verbose=" no"
608
614
Xauthentication=" yes"
615
+ Xenvfile=" $HOME /.Xenv"
609
616
610
617
# Terminal colors used for messages and --verbose=c
611
618
Esc=" $( printf ' \033' ) "
@@ -740,6 +747,8 @@ main() {
740
747
or 'Invalid MIT-MAGIC-COOKIE', the X authentication cookie might be broken.
741
748
You can remove old cookies and stop running X servers with: runx --cleanup"
742
749
echo " DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY "
750
+ echo " export DISPLAY=$DISPLAY
751
+ export XAUTHORITY=$XAUTHORITY " > " $Xenvfile "
743
752
;;
744
753
no)
745
754
unset XAUTHORITY
@@ -750,6 +759,7 @@ main() {
750
759
Others could try to access your system through network connections.
751
760
Please use option --no-auth for debugging only."
752
761
echo " DISPLAY=$DISPLAY "
762
+ echo " export DISPLAY=$DISPLAY " > " $Xenvfile "
753
763
;;
754
764
esac
755
765
export DISPLAY XAUTHORITY
0 commit comments