Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upxdg-open does not work in debian-8 template #2065
Comments
andrewdavidwong
added
enhancement
P: minor
C: Debian
labels
Jun 13, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
Jun 15, 2016
Member
|
user support:
to fix this in meanwhile, install libgnome2-bin.
sudo apt-get install libgnome2-bin
development discussion:
Since we have environment variable GNOME_DESKTOP_SESSION_ID set,
xdg-open will set DE=gnome.
Rather than trying to understand and fix xdg-open, I suggest to install
libgnome2-bin by default (contains gnome-open).
Make libgnome2-bin a dependency of qubes-gui-agent-linux. Should I
create a pull request?
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Actually we set |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Jun 15, 2016
Member
Using gnome-open breaks DispVM (because gnome-open doesn't wait for file viewer/editor being closed).
|
Using |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
unman
Jun 15, 2016
Member
On Wed, Jun 15, 2016 at 06:43:46AM -0700, Patrick Schleizer wrote:
user support:
to fix this in meanwhile, install libgnome2-bin.
sudo apt-get install libgnome2-bin
development discussion:
Since we have environment variable GNOME_DESKTOP_SESSION_ID set,
xdg-open will set DE=gnome.Rather than trying to understand and fix xdg-open, I suggest to install
libgnome2-bin by default (contains gnome-open).Make libgnome2-bin a dependency of qubes-gui-agent-linux. Should I
create a pull request?If I remember this pulls in a vast amount of gnome stuff.
|
On Wed, Jun 15, 2016 at 06:43:46AM -0700, Patrick Schleizer wrote:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
Jun 16, 2016
Member
At first it sounded like a bug worth being reported against gnome-open. I cannot find out how to report a bug against gnome-open. However, old bug reports against gnome-open make this seem futile.
According to Debian file search for gnome-open, seems like gnome-open is a gnome2 thing only and not available in gnome3?
Then what about perhaps setting DE=generic as global environment variable rather than just setting it in qubes-open?
|
At first it sounded like a bug worth being reported against gnome-open. I cannot find out how to report a bug against gnome-open. However, old bug reports against gnome-open make this seem futile. According to Debian file search for gnome-open, seems like gnome-open is a gnome2 thing only and not available in gnome3? Then what about perhaps setting |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Jun 16, 2016
Member
Maybe it's rather a bug in xdg-open to call gnome-open if it isn't installed? I'm not sure about DE=generic globally - it may break something else or have other unexpected results.
|
Maybe it's rather a bug in |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
Jun 20, 2016
Member
|
I am not sure upstream would accept a bug report and/or patch with
if/else /usr/bin/gnome-open code included. This issue probably applies
to Qubes only. Is caused by Qubes setting the GNOME_DESKTOP_SESSION_ID
environment variable.
[1]
https://github.com/marmarek/qubes-gui-agent-linux/blob/master/appvm-scripts/etc/X11/Xsession.d/20qt-gnome-desktop-session-id
In /usr/bin/xdg-open it gets triggered by the following line.
elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome
Upstream might ask, why do you have the GNOME_DESKTOP_SESSION_ID
environment variable set if you are not using gnome?
The workaround...
unset GNOME_DESKTOP_SESSION_ID xdg-open ...
...is functional.
Can the goal 'Prevents QT from displaying ugly QT theme' [1] be reached
some other way than setting the GNOME_DESKTOP_SESSION_ID environment
variable.
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Jun 20, 2016
Member
Can the goal 'Prevents QT from displaying ugly QT theme' [1] be reached
some other way than setting the GNOME_DESKTOP_SESSION_ID environment
variable.
No idea, but if someone would find a way, I'd love to unset GNOME_DESKTOP_SESSION_ID.
This is the commit which introduced the change:
marmarek/qubes-gui-agent-linux@524fb45
No idea, but if someone would find a way, I'd love to unset This is the commit which introduced the change: |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rootkovska
removed
the
C:
label
Jun 30, 2016
andrewdavidwong
added
the
C: Debian
label
Jul 1, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
Nov 23, 2016
Member
A reasonable feature request against upstream /usr/bin/xdg-open could be:
do not overwrite environment variable DE if it is already set
The patch /usr/bin/xdg-open would be trivial.
Now:
detectDE
if [ x"$DE" = x"" ]; then
DE=generic
fi
Suggested:
if [ x"$DE" = x"" ]; then
detectDE
fi
if [ x"$DE" = x"" ]; then
DE=generic
fi
What do you think?
|
A reasonable feature request against upstream The patch Now:
Suggested:
What do you think? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Makes sense. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
Nov 26, 2016
Member
do not overwrite environment variable DE if it is already set:
https://bugs.freedesktop.org/show_bug.cgi?id=98866
|
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rdieter
Nov 28, 2016
Is there any reasons you cannot set/use the (standardized) XDG_CURRENT_DESKTOP instead (of DE) ?
rdieter
commented
Nov 28, 2016
|
Is there any reasons you cannot set/use the (standardized) XDG_CURRENT_DESKTOP instead (of DE) ? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
I think the only reason is: didn't know about its existence. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
Nov 28, 2016
Member
|
Rex Dieter:
Is there any reasons you cannot set/use the (standardized) XDG_CURRENT_DESKTOP instead (of DE) ?
Setting XDG_CURRENT_DESKTOP=generic alone does not work. The bash xtrace
shows, DE will still be set to gnome.
Setting both XDG_CURRENT_DESKTOP=generic and DE=generic however works.
So no patch from upstream required.
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Try |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
Nov 28, 2016
Member
Thank you @rdieter [xdg-open upstream] for joining this discussion!
Update: Upstream rejected my previous suggestion and that's fine.
Marek Marczykowski-Górecki:
Try
XDG_CURRENT_DESKTOP=X-generic.
Doesn't work.
Variable XDG_CURRENT_DESKTOP isn't tested for either 'generic' or 'X-generic' so I wouldn't know how that possibly could work as of now.
Still need to set DE=generic as well as XDG_CURRENT_DESKTOP=generic.
It makes sense to me because in /usr/bin/xdg-open 'sh' function 'detectDE' the following...
if [ x"$DE" = x"" ]; then
...
DE=kde;
...
... is outside this previous 'if'.
if [ -n "${XDG_CURRENT_DESKTOP}" ]; then
Even though upstream considers variable DE an internal variable, for Qubes purpose in meanwhile as workaround setting DE=generic as well as XDG_CURRENT_DESKTOP=generic should do.
The clean fix for xdg-open as far as I see through this would be a minimal patch for if 'XDG_CURRENT_DESKTOP = 'generic' then it should also set 'DE=generic'. What do you think, @rdieter?
|
Thank you @rdieter [xdg-open upstream] for joining this discussion! Update: Upstream rejected my previous suggestion and that's fine. Marek Marczykowski-Górecki:
Doesn't work. Variable XDG_CURRENT_DESKTOP isn't tested for either 'generic' or 'X-generic' so I wouldn't know how that possibly could work as of now. Still need to set DE=generic as well as XDG_CURRENT_DESKTOP=generic. It makes sense to me because in /usr/bin/xdg-open 'sh' function 'detectDE' the following...
... is outside this previous 'if'.
Even though upstream considers variable DE an internal variable, for Qubes purpose in meanwhile as workaround setting DE=generic as well as XDG_CURRENT_DESKTOP=generic should do. The clean fix for xdg-open as far as I see through this would be a minimal patch for if 'XDG_CURRENT_DESKTOP = 'generic' then it should also set 'DE=generic'. What do you think, @rdieter? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Typo in my message - there should be |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
Nov 28, 2016
Member
Same result.
XDG_CURRENT_DESKTOP=X-Generic sh -x /usr/bin/xdg-open some-file results in using gnome-open.
DE=generic XDG_CURRENT_DESKTOP=generic sh -x /usr/bin/xdg-open some-file results in using mine-open.
|
Same result.
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Nov 28, 2016
Member
Hmm, it should. See detectDE function
detectDE()
{
# see https://bugs.freedesktop.org/show_bug.cgi?id=34164
unset GREP_OPTIONS
if [ -n "${XDG_CURRENT_DESKTOP}" ]; then
case "${XDG_CURRENT_DESKTOP}" in
(...)
X-Generic)
DE=generic
;;
esac
fi
Maybe Debian have outdated xdg-utils package?
|
Hmm, it should. See detectDE function
Maybe Debian have outdated xdg-utils package? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
Nov 29, 2016
Member
Yes. jessie version does not support X-Generic. stretch version does.
So looks like upstream already implemented a nice solution XDG_CURRENT_DESKTOP="X-Generic" that works for Qubes long term then.
For jessie based Qubes, I suggest:
# Can be removed once depending on Debian stretch or above.
DE=generic
XDG_CURRENT_DESKTOP=X-Generic
(Then we can just remove DE=generic later with very low priority.)
|
Yes. jessie version does not support So looks like upstream already implemented a nice solution For jessie based Qubes, I suggest:
(Then we can just remove |
waiting-for-dev commentedJun 13, 2016
•
edited
Edited 1 time
-
waiting-for-dev
edited Jun 13, 2016 (most recent)
Qubes OS version (e.g.,
R3.1):R3.1
Affected TemplateVMs (e.g.,
fedora-23, if applicable):debian-8
Expected behavior:
xdg-opento work out of the boxActual behavior:
Steps to reproduce the behavior:
Just run:
General notes:
This doesn't happen in
fedora-23template.I tried:
without success. But, anyway,
xdg-openshould work OOTB.Thanks!
Related issues: