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

xdg-open does not work in debian-8 template #2065

Open
waiting-for-dev opened this Issue Jun 13, 2016 · 21 comments

Comments

Projects
None yet
7 participants
@waiting-for-dev

waiting-for-dev commented Jun 13, 2016

Qubes OS version (e.g., R3.1):

R3.1

Affected TemplateVMs (e.g., fedora-23, if applicable):

debian-8


Expected behavior:

xdg-open to work out of the box

Actual behavior:

xdg-open http://github.com
/usr/bin/xdg-open: 491: /usr/bin/xdg-open: gnome-open: not found

Steps to reproduce the behavior:

Just run:

xdg-open http://github.com

General notes:

This doesn't happen in fedora-23 template.

I tried:

xdg-settings set default-web-browser iceweasel.desktop
xdg-mime default iceweasel.desktop x-scheme-handler/http
xdg-mime default iceweasel.desktop x-scheme-handler/https

without success. But, anyway, xdg-open should work OOTB.

Thanks!


Related issues:

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Jun 15, 2016

Member
Member

adrelanos commented Jun 15, 2016

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 15, 2016

Member

Actually we set DE=generic exactly for this reason.

Member

marmarek commented Jun 15, 2016

Actually we set DE=generic exactly for this reason.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 15, 2016

Member

Using gnome-open breaks DispVM (because gnome-open doesn't wait for file viewer/editor being closed).

Member

marmarek commented Jun 15, 2016

Using gnome-open breaks DispVM (because gnome-open doesn't wait for file viewer/editor being closed).

@unman

This comment has been minimized.

Show comment
Hide comment
@unman

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.

Member

unman commented Jun 15, 2016

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.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

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.

https://bugzilla.gnome.org/buglist.cgi?short_desc=gnome-open&query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=NEEDINFO&short_desc_type=substring

According to Debian file search for gnome-open, seems like gnome-open is a gnome2 thing only and not available in gnome3?

https://packages.debian.org/search?searchon=contents&keywords=gnome-open&mode=path&suite=unstable&arch=any


Then what about perhaps setting DE=generic as global environment variable rather than just setting it in qubes-open?

Member

adrelanos commented Jun 16, 2016

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.

https://bugzilla.gnome.org/buglist.cgi?short_desc=gnome-open&query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=NEEDINFO&short_desc_type=substring

According to Debian file search for gnome-open, seems like gnome-open is a gnome2 thing only and not available in gnome3?

https://packages.debian.org/search?searchon=contents&keywords=gnome-open&mode=path&suite=unstable&arch=any


Then what about perhaps setting DE=generic as global environment variable rather than just setting it in qubes-open?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

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.

Member

marmarek commented Jun 16, 2016

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.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Jun 20, 2016

Member
Member

adrelanos commented Jun 20, 2016

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

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

Member

marmarek commented Jun 20, 2016

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

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

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?

Member

adrelanos commented Nov 23, 2016

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?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Nov 23, 2016

Member

Makes sense.

Member

marmarek commented Nov 23, 2016

Makes sense.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

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

Member

adrelanos commented Nov 26, 2016

do not overwrite environment variable DE if it is already set:
https://bugs.freedesktop.org/show_bug.cgi?id=98866

@rdieter

This comment has been minimized.

Show comment
Hide comment
@rdieter

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) ?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Nov 28, 2016

Member

I think the only reason is: didn't know about its existence.

Member

marmarek commented Nov 28, 2016

I think the only reason is: didn't know about its existence.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Nov 28, 2016

Member
Member

adrelanos commented Nov 28, 2016

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Nov 28, 2016

Member

Try XDG_CURRENT_DESKTOP=X-generic.

Member

marmarek commented Nov 28, 2016

Try XDG_CURRENT_DESKTOP=X-generic.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

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?

Member

adrelanos commented Nov 28, 2016

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?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Nov 28, 2016

Member

Typo in my message - there should be X-Generic.

Member

marmarek commented Nov 28, 2016

Typo in my message - there should be X-Generic.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

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.

Member

adrelanos commented Nov 28, 2016

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.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

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?

Member

marmarek commented Nov 28, 2016

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?

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

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.)

Member

adrelanos commented Nov 29, 2016

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.)

@andrewdavidwong andrewdavidwong added this to the Far in the future milestone Dec 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment