Discussion:
[X2Go-Dev] [PATCH] allow user to set his preferred applications in ~/.x2go/applications
Reinhard Tartler
2012-12-01 14:31:45 UTC
Permalink
This file is sourced by the shell. Applications can be specified e.g. like this:
WWWBROWSER=/usr/bin/google-chrome
MAILCLIENT=/local/thunderbird/bin/thunderbird

If the application does not exist, or is not specified, the hard coded
list will be consulted
---
x2goserver/bin/x2goruncommand | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/x2goserver/bin/x2goruncommand b/x2goserver/bin/x2goruncommand
index b88c3b9..7d826b5 100755
--- a/x2goserver/bin/x2goruncommand
+++ b/x2goserver/bin/x2goruncommand
@@ -31,6 +31,10 @@ X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`

$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"

+if [ $HOME/.x2go/applications ]; then
+ . $HOME/.x2go/applications
+fi
+
export DISPLAY
export X2GO_AGENT_PID
export X2GO_SESSION
@@ -131,7 +135,9 @@ elif [ "$cmd" == "TRINITY" ]; then
fi

if [ "$cmd" == "WWWBROWSER" ]; then
- if [ -e "/usr/bin/firefox" ]; then
+ if [ -n "$WWWBROWSER" ] && [ -e "$WWWBROWSER" ]; then
+ cmd="$WWWBROWSER"
+ elif [ -e "/usr/bin/firefox" ]; then
cmd="/usr/bin/firefox"
elif [ -e "/usr/bin/iceweasel" ]; then
cmd="/usr/bin/iceweasel"
@@ -147,7 +153,9 @@ if [ "$cmd" == "WWWBROWSER" ]; then
fi

if [ "$cmd" == "MAILCLIENT" ]; then
- if [ -e "/usr/bin/thunderbird" ]; then
+ if [ -n "$MAILCLIENT" ] && [ -e "$MAILCLIENT" ]; then
+ cmd="$MAILCLIENT"
+ elif [ -e "/usr/bin/thunderbird" ]; then
cmd="/usr/bin/thunderbird"
elif [ -e "/usr/bin/icedove" ]; then
cmd="/usr/bin/icedove"
@@ -159,7 +167,9 @@ if [ "$cmd" == "MAILCLIENT" ]; then
fi

if [ "$cmd" == "OFFICE" ]; then
- if [ -e "/usr/bin/loffice" ]; then
+ if [ -n "$OFFICE" ] && [ -e "$OFFICE" ]; then
+ cmd="$OFFICE"
+ elif [ -e "/usr/bin/loffice" ]; then
cmd="/usr/bin/loffice"
elif [ -e "/usr/bin/ooffice" ]; then
cmd="/usr/bin/ooffice"
@@ -168,7 +178,9 @@ fi

if [ "$cmd" == "TERMINAL" ]; then
IMEXIT="true"
- if [ -e "/usr/bin/konsole" ]; then
+ if [ -n "$TERMINAL" ] && [ -e "$TERMINAL" ]; then
+ cmd="$TERMINAL"
+ elif [ -e "/usr/bin/konsole" ]; then
cmd="/usr/bin/konsole"
# KDE4 konsole behaves differently from other terminals
IMEXIT="false"
--
1.7.9.5
Mike Gabriel
2012-12-03 03:43:03 UTC
Permalink
Hi Reinhard,

NICE!!!

Please commit to master and cherry-pick to release/3.1.1.x branch.

Please also add a /debian/changelog entry for 3.1.1.10 in both branches.

Thanks+Greets,
Mike
Post by Reinhard Tartler
WWWBROWSER=/usr/bin/google-chrome
MAILCLIENT=/local/thunderbird/bin/thunderbird
If the application does not exist, or is not specified, the hard coded
list will be consulted
---
x2goserver/bin/x2goruncommand | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/x2goserver/bin/x2goruncommand b/x2goserver/bin/x2goruncommand
index b88c3b9..7d826b5 100755
--- a/x2goserver/bin/x2goruncommand
+++ b/x2goserver/bin/x2goruncommand
@@ -31,6 +31,10 @@ X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+if [ $HOME/.x2go/applications ]; then
+ . $HOME/.x2go/applications
+fi
+
export DISPLAY
export X2GO_AGENT_PID
export X2GO_SESSION
@@ -131,7 +135,9 @@ elif [ "$cmd" == "TRINITY" ]; then
fi
if [ "$cmd" == "WWWBROWSER" ]; then
- if [ -e "/usr/bin/firefox" ]; then
+ if [ -n "$WWWBROWSER" ] && [ -e "$WWWBROWSER" ]; then
+ cmd="$WWWBROWSER"
+ elif [ -e "/usr/bin/firefox" ]; then
cmd="/usr/bin/firefox"
elif [ -e "/usr/bin/iceweasel" ]; then
cmd="/usr/bin/iceweasel"
@@ -147,7 +153,9 @@ if [ "$cmd" == "WWWBROWSER" ]; then
fi
if [ "$cmd" == "MAILCLIENT" ]; then
- if [ -e "/usr/bin/thunderbird" ]; then
+ if [ -n "$MAILCLIENT" ] && [ -e "$MAILCLIENT" ]; then
+ cmd="$MAILCLIENT"
+ elif [ -e "/usr/bin/thunderbird" ]; then
cmd="/usr/bin/thunderbird"
elif [ -e "/usr/bin/icedove" ]; then
cmd="/usr/bin/icedove"
@@ -159,7 +167,9 @@ if [ "$cmd" == "MAILCLIENT" ]; then
fi
if [ "$cmd" == "OFFICE" ]; then
- if [ -e "/usr/bin/loffice" ]; then
+ if [ -n "$OFFICE" ] && [ -e "$OFFICE" ]; then
+ cmd="$OFFICE"
+ elif [ -e "/usr/bin/loffice" ]; then
cmd="/usr/bin/loffice"
elif [ -e "/usr/bin/ooffice" ]; then
cmd="/usr/bin/ooffice"
@@ -168,7 +178,9 @@ fi
if [ "$cmd" == "TERMINAL" ]; then
IMEXIT="true"
- if [ -e "/usr/bin/konsole" ]; then
+ if [ -n "$TERMINAL" ] && [ -e "$TERMINAL" ]; then
+ cmd="$TERMINAL"
+ elif [ -e "/usr/bin/konsole" ]; then
cmd="/usr/bin/konsole"
# KDE4 konsole behaves differently from other terminals
IMEXIT="false"
--
1.7.9.5
_______________________________________________
X2Go-Dev mailing list
https://lists.berlios.de/mailman/listinfo/x2go-dev
--
DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: ***@das-netzwerkteam.de, http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
Reinhard Tartler
2012-12-03 08:30:05 UTC
Permalink
Mike,

the patch does not update the manpage. can you handle that? Thanks

Reinhard.

On Mon, Dec 3, 2012 at 4:43 AM, Mike Gabriel
Post by Mike Gabriel
Hi Reinhard,
NICE!!!
Please commit to master and cherry-pick to release/3.1.1.x branch.
Please also add a /debian/changelog entry for 3.1.1.10 in both branches.
Thanks+Greets,
Mike
Post by Reinhard Tartler
WWWBROWSER=/usr/bin/google-chrome
MAILCLIENT=/local/thunderbird/bin/thunderbird
If the application does not exist, or is not specified, the hard coded
list will be consulted
---
x2goserver/bin/x2goruncommand | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/x2goserver/bin/x2goruncommand b/x2goserver/bin/x2goruncommand
index b88c3b9..7d826b5 100755
--- a/x2goserver/bin/x2goruncommand
+++ b/x2goserver/bin/x2goruncommand
@@ -31,6 +31,10 @@ X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+if [ $HOME/.x2go/applications ]; then
+ . $HOME/.x2go/applications
+fi
+
export DISPLAY
export X2GO_AGENT_PID
export X2GO_SESSION
@@ -131,7 +135,9 @@ elif [ "$cmd" == "TRINITY" ]; then
fi
if [ "$cmd" == "WWWBROWSER" ]; then
- if [ -e "/usr/bin/firefox" ]; then
+ if [ -n "$WWWBROWSER" ] && [ -e "$WWWBROWSER" ]; then
+ cmd="$WWWBROWSER"
+ elif [ -e "/usr/bin/firefox" ]; then
cmd="/usr/bin/firefox"
elif [ -e "/usr/bin/iceweasel" ]; then
cmd="/usr/bin/iceweasel"
@@ -147,7 +153,9 @@ if [ "$cmd" == "WWWBROWSER" ]; then
fi
if [ "$cmd" == "MAILCLIENT" ]; then
- if [ -e "/usr/bin/thunderbird" ]; then
+ if [ -n "$MAILCLIENT" ] && [ -e "$MAILCLIENT" ]; then
+ cmd="$MAILCLIENT"
+ elif [ -e "/usr/bin/thunderbird" ]; then
cmd="/usr/bin/thunderbird"
elif [ -e "/usr/bin/icedove" ]; then
cmd="/usr/bin/icedove"
@@ -159,7 +167,9 @@ if [ "$cmd" == "MAILCLIENT" ]; then
fi
if [ "$cmd" == "OFFICE" ]; then
- if [ -e "/usr/bin/loffice" ]; then
+ if [ -n "$OFFICE" ] && [ -e "$OFFICE" ]; then
+ cmd="$OFFICE"
+ elif [ -e "/usr/bin/loffice" ]; then
cmd="/usr/bin/loffice"
elif [ -e "/usr/bin/ooffice" ]; then
cmd="/usr/bin/ooffice"
@@ -168,7 +178,9 @@ fi
if [ "$cmd" == "TERMINAL" ]; then
IMEXIT="true"
- if [ -e "/usr/bin/konsole" ]; then
+ if [ -n "$TERMINAL" ] && [ -e "$TERMINAL" ]; then
+ cmd="$TERMINAL"
+ elif [ -e "/usr/bin/konsole" ]; then
cmd="/usr/bin/konsole"
# KDE4 konsole behaves differently from other terminals
IMEXIT="false"
--
1.7.9.5
_______________________________________________
X2Go-Dev mailing list
https://lists.berlios.de/mailman/listinfo/x2go-dev
--
DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148
GnuPG Key ID 0x25771B31
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
_______________________________________________
X2Go-Dev mailing list
https://lists.berlios.de/mailman/listinfo/x2go-dev
--
regards,
Reinhard
Mike Gabriel
2012-12-03 08:57:38 UTC
Permalink
Hi Reinhard,
Post by Reinhard Tartler
Mike,
the patch does not update the manpage. can you handle that? Thanks
Reinhard.
yes, please push your commit first...

Mike
--
DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: ***@das-netzwerkteam.de, http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
Mike Gabriel
2012-12-04 12:58:52 UTC
Permalink
Hi Reinhard,
Post by Reinhard Tartler
Mike,
the patch does not update the manpage. can you handle that? Thanks
Reinhard.
On Mon, Dec 3, 2012 at 4:43 AM, Mike Gabriel
Post by Mike Gabriel
Hi Reinhard,
NICE!!!
Please commit to master and cherry-pick to release/3.1.1.x branch.
Please also add a /debian/changelog entry for 3.1.1.10 in both branches.
Thanks+Greets,
Mike
Post by Reinhard Tartler
WWWBROWSER=/usr/bin/google-chrome
MAILCLIENT=/local/thunderbird/bin/thunderbird
If the application does not exist, or is not specified, the hard coded
list will be consulted
---
x2goserver/bin/x2goruncommand | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/x2goserver/bin/x2goruncommand b/x2goserver/bin/x2goruncommand
index b88c3b9..7d826b5 100755
--- a/x2goserver/bin/x2goruncommand
+++ b/x2goserver/bin/x2goruncommand
@@ -31,6 +31,10 @@ X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go`
+if [ $HOME/.x2go/applications ]; then
+ . $HOME/.x2go/applications
+fi
+
export DISPLAY
export X2GO_AGENT_PID
export X2GO_SESSION
@@ -131,7 +135,9 @@ elif [ "$cmd" == "TRINITY" ]; then
fi
if [ "$cmd" == "WWWBROWSER" ]; then
- if [ -e "/usr/bin/firefox" ]; then
+ if [ -n "$WWWBROWSER" ] && [ -e "$WWWBROWSER" ]; then
+ cmd="$WWWBROWSER"
+ elif [ -e "/usr/bin/firefox" ]; then
cmd="/usr/bin/firefox"
elif [ -e "/usr/bin/iceweasel" ]; then
cmd="/usr/bin/iceweasel"
@@ -147,7 +153,9 @@ if [ "$cmd" == "WWWBROWSER" ]; then
fi
if [ "$cmd" == "MAILCLIENT" ]; then
- if [ -e "/usr/bin/thunderbird" ]; then
+ if [ -n "$MAILCLIENT" ] && [ -e "$MAILCLIENT" ]; then
+ cmd="$MAILCLIENT"
+ elif [ -e "/usr/bin/thunderbird" ]; then
cmd="/usr/bin/thunderbird"
elif [ -e "/usr/bin/icedove" ]; then
cmd="/usr/bin/icedove"
@@ -159,7 +167,9 @@ if [ "$cmd" == "MAILCLIENT" ]; then
fi
if [ "$cmd" == "OFFICE" ]; then
- if [ -e "/usr/bin/loffice" ]; then
+ if [ -n "$OFFICE" ] && [ -e "$OFFICE" ]; then
+ cmd="$OFFICE"
+ elif [ -e "/usr/bin/loffice" ]; then
cmd="/usr/bin/loffice"
elif [ -e "/usr/bin/ooffice" ]; then
cmd="/usr/bin/ooffice"
@@ -168,7 +178,9 @@ fi
if [ "$cmd" == "TERMINAL" ]; then
IMEXIT="true"
- if [ -e "/usr/bin/konsole" ]; then
+ if [ -n "$TERMINAL" ] && [ -e "$TERMINAL" ]; then
+ cmd="$TERMINAL"
+ elif [ -e "/usr/bin/konsole" ]; then
cmd="/usr/bin/konsole"
# KDE4 konsole behaves differently from other terminals
IMEXIT="false"
--
1.7.9.5
_______________________________________________
X2Go-Dev mailing list
https://lists.berlios.de/mailman/listinfo/x2go-dev
--
DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148
GnuPG Key ID 0x25771B31
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
_______________________________________________
X2Go-Dev mailing list
https://lists.berlios.de/mailman/listinfo/x2go-dev
--
regards,
Reinhard
I see a push for this patch is still pending. I have two comments on
the patch (belated, sorry):

It would be fine to have the default/preferred applications
configurable system-wide and on a per-user basis. Can you add that?

Then: the name applications in ~/.x2go and /etc/x2go is already
reserved. Expected is a directory or dir-symlink that contains /
points to a folder with .desktop files. This is used in the
x2gogetapps script and is part of the X2Go Published Applications
feature.

Please consider using another name instead of ,,applications'' for the
proposed environment file.

Thanks+Greets,
Mike
--
DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: ***@das-netzwerkteam.de, http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
Reinhard Tartler
2012-12-04 13:03:40 UTC
Permalink
On Tue, Dec 4, 2012 at 1:58 PM, Mike Gabriel
I see a push for this patch is still pending. I have two comments on the
It would be fine to have the default/preferred applications configurable
system-wide and on a per-user basis. Can you add that?
Err, the "system-wide" is currently hardcoded in the binary. Do you
want to source additionally from some file in
/etc/x2goserver/applications? What file should have precedence, the
system-wide file or the file in the user home? And why?
Then: the name applications in ~/.x2go and /etc/x2go is already reserved.
Expected is a directory or dir-symlink that contains / points to a folder
with .desktop files. This is used in the x2gogetapps script and is part of
the X2Go Published Applications feature.
Where is the specification/documentation for that? What would be the
best place for this configuration setting?
Please consider using another name instead of ,,applications'' for the
proposed environment file.
For instance X2GO_DEFAULT_APP_WWWBROWSER?

Isn't that a bit too verbose?
--
regards,
Reinhard
Mike Gabriel
2012-12-04 14:13:35 UTC
Permalink
Hi Reinhard,
Post by Reinhard Tartler
On Tue, Dec 4, 2012 at 1:58 PM, Mike Gabriel
I see a push for this patch is still pending. I have two comments on the
It would be fine to have the default/preferred applications configurable
system-wide and on a per-user basis. Can you add that?
Err, the "system-wide" is currently hardcoded in the binary. Do you
want to source additionally from some file in
/etc/x2goserver/applications? What file should have precedence, the
system-wide file or the file in the user home? And why?
As a file name: /etc/x2go/rootless-commands? ~/.x2go/rootless-commands?
Or ,,default-applications'' at same locations? Your choice. Only
,,applications'' is already reserved. Config folders are either
/etc/x2go or ~/.x2go.

About precedence: the common behaviour is that user configs supersede
system-wide configs, isn't it? So let's go that way...(?)
Post by Reinhard Tartler
Then: the name applications in ~/.x2go and /etc/x2go is already reserved.
Expected is a directory or dir-symlink that contains / points to a folder
with .desktop files. This is used in the x2gogetapps script and is part of
the X2Go Published Applications feature.
Where is the specification/documentation for that? What would be the
ENO specs yet, or rather: they are inside the code... :-(
Post by Reinhard Tartler
best place for this configuration setting?
see above...
Post by Reinhard Tartler
Please consider using another name instead of ,,applications'' for the
proposed environment file.
For instance X2GO_DEFAULT_APP_WWWBROWSER?
prepending X2GO is surely a good idea. Actually, I like those variable
names...

Mike
--
DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: ***@das-netzwerkteam.de, http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
Loading...