Skip to content
This repository has been archived by the owner on May 17, 2018. It is now read-only.

Basic functionality doesn't work with non-standard WM #78

Closed
ppvg opened this issue Mar 29, 2013 · 4 comments
Closed

Basic functionality doesn't work with non-standard WM #78

ppvg opened this issue Mar 29, 2013 · 4 comments

Comments

@ppvg
Copy link

ppvg commented Mar 29, 2013

I use a tiling window manager, which apparently means I can't use this plugin.

It seems it's checking which Desktop Manager is running to determine which GUI dialog tool should be available. I only glaced through the code, so please correct me if I'm wrong.

Two questions come to mind:

  • Are the dialog boxes absolutely needed for the basic functionality of this plugin? Or could it still offer some working subset without dialog boxes?
  • Could you test which GUI toolkit is available, instead of which window manager is running? (Smells like browser detection.)

Should it matter to this plugin which window manager the user is running? I have no problem installing zenity or Xdialog to make it work, but there's no way in hell I'm using Gnome, Mate or KDE.

@ppvg
Copy link
Author

ppvg commented Mar 29, 2013

Okay, never mind. I should have read more of the code. It looks like desktop is just a drop-in library, and only the .open function is used. The problem is actually documented inside the desktop source code: it looks for the DESKTOP_LAUNCH variable for which launcher to use.

A simple export DESKTOP_LAUNCH=xdg-open fixed it. Perhaps something for the README?

Still, would have been nice if it had fallen back to feature detection.

@ppvg ppvg closed this as completed Mar 29, 2013
@revolunet
Copy link
Owner

Hi @ppvg thansk for reporting. Yes we use the desktop Python module which doesnt play weel with many distros out there.
Note you have a browser setting in the plugin preferences that can help you decide which browser to use.
Could you please help us fix the desktop module ?
https://github.com/revolunet/sublimetext-markdown-preview/blob/master/desktop/__init__.py#L151
Is there any common env variable for your window manager that could help detect it and use xdg-open by default ?

Thanks

@ppvg
Copy link
Author

ppvg commented Mar 29, 2013

@revolunet kudos for the quick response. I use xmonad and as far as I know, it doesn't set any environment variables. I think xdg does, so perhaps that could be a check. I also suspect almost all linux systems with a working X11 will have xdg-utils installed.

On the other hand, making sure either $DESKTOP_LAUNCH or $BROWSER has a valid value works perfectly. I think most users of edge-case WM's like xmonad will happily set an env variable, as long as they know they have to. :)

@revolunet
Copy link
Owner

README updated, thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants