Skip to content
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

nixos: Add a menu launcher for the NixOS manual #23861

Merged
merged 1 commit into from
Mar 15, 2017

Conversation

benley
Copy link
Member

@benley benley commented Mar 13, 2017

This adds a clickable app launcher in most desktop environments to open the current system's generated documentation set.

@mention-bot
Copy link

@benley, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @7c6f434c and @nbp to be potential reviewers.

@c0bw3b
Copy link
Contributor

c0bw3b commented Mar 13, 2017

Nice idea.
One thing though : the creation of the desktopItem should be conditioned on services.xserver.enable being true. Otherwise we are on a server with no desktop env at all.

@benley
Copy link
Member Author

benley commented Mar 13, 2017

I'm not sure it's worth bothering; the desktopItem is a small inert text file that doesn't drag in any additional dependencies.

@benley
Copy link
Member Author

benley commented Mar 13, 2017

Although, once we add a better icon it will pull that in, so maybe you're right.

@benley
Copy link
Member Author

benley commented Mar 13, 2017

done :)

genericName = "View NixOS documentation in a web browser";
# TODO: find a better icon (Nix logo + help overlay?)
icon = "system-help";
exec = "xdg-open ${entry}";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm. Can I actually assume that xdg-open will be present if this is used?

Copy link
Contributor

@c0bw3b c0bw3b Mar 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it should be if at least one desktop env is installed system-wide.
On a server with no X the xdg-open command is not available. But since you just made the creation of the desktop item conditional it should be fine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Desktop entries specifically allow URLs, so I guess we might just use file://${entry} URL instead of xdg-open.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another way would be to execute ${help}, as we define it above anyway...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re URLs, I am pretty sure that the URL field only applies to desktop files with Type=Link. And for some reason the gnome and KDE app menus refuse to work with those; they require Type=Application, which in turn requires an exec line. I'll switch to having it exec ${help} though, that's a good idea.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I meant Type=Link, but I just read the specs now and never used that – thanks.

@benley
Copy link
Member Author

benley commented Mar 14, 2017

updated, probably mergeable?

Copy link
Member

@vcunat vcunat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems OK, even for picking to 17.03.

@benley benley merged commit 98e4c5d into NixOS:master Mar 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants