Creates a desktop file and icon so that Bombadillo can show up in desktop environment menus and launchers #93
No reviewers
Labels
No Label
blocked
bug
build
documentation
duplicate
enhancement
finger
gemini
gopher
help wanted
http
in progress
invalid
local
needs-info
non-code
non-functional
non-urgent
question
release
rendering
suggestion
telnet
terminal
urgent
wontfix
No Milestone
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sloum/bombadillo#93
Loading…
Reference in New Issue
No description provided.
Delete Branch "desktop-file"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
bombadillo.desktop
in repoinstall-desktop
makefile targetinstall
anduninstall
targetsTo create this I used the following resources:
It seems that there are more things that can be done as well, but some of it was confusing and I was able to verify that this works well (on my system at least), so did not want to spend a ton of time on this one.
You mentioned making it so that gopher/gemini links could be opened in bombadillo by default. I could not figure out how to get that set up, but would love for that to happen. Let me know, or update this branch, if you know how to do it.
Ok. I figured it out and updated the desktop target to add default mime entries for: gopher, gemini, and finger. I figure http(s) and telnet are already fine with system defaults.
I have tested this on my system. After installing I can type a gemini link into firefox and it will ask me if I want to open it in bombadillo (there is a box to not be asked again and just do it from now on, but it does ask first so-as to not overwrite other defaults). It totally works: brings up a new terminal window with bombadillo opened to the url in question. This is really really cool.
If we want to modify the makefile further to support BSDs or do Darwin specific actions this is a good reference:
https://en.wikipedia.org/wiki/Uname
It's impressive. Really adds a lot of usability to a desktop environment.
I'll need a bit of time to absorb this as it's all new to me.
This doesn't seem like it is compatible with running
sudo make install
as the xdg-mime commands look user specific (it tries to install to the root user).xdg-mime's man page refers to an install function, as well as a --mode setting designed to handle system installs. Can some of these help?
Strangely, I installed with
sudo make install
and all of it did work. It is all pretty new to me as well, so there may be much better ways to go about this. I looked into supporting OSX with this but their way of handling this sort of thing is much more complicated and looks harder to automate, particularly if we aren't using a.app
file.I'll look into the --mode and install function and see what I can get figured out. In the meantime, feel free to play around with this or update it with any findings. :)
The man page shows the following in regard to the
mode
flag:The default is to use system mode when called by root and to use user mode when called by a non-root user.
That explains why it worked from the Makefile when using sudo. I think we should be ok as is. We could add explicit instructions to use system, but it doesnt seem to be necessary.
Taking a look at things, this is the only non-documentation story left for the release. Once we decide what to do about this PR I think we are feature complete for 2.0.0 and should push any code changes into a separate branch for a next version (branch to be set up when/if needed).
Once this is merged in and any documentation changes are added to support it I think we are at the stage for this repo where we just need to do final passes on README (me) and manpage (you). At that point we will have the web and gopher reviews to finish and then launch and do the reach out to various places to get people using it :) It feels like the finish line is in sight!
Sorry I think I had been subconsciously avoiding this because of our last jaunt with
xdg-open
.I'm still getting these errors when running
sudo make install
I'm doing this on Ubuntu 19.10. I'm not sure why this works for you, or maybe it only appears to work for you. I need to research this further, but:
/root
directory does not have a./config
directoryxdg-mime
could set my default assosciations by placing files in/root
, a directory I can't read--mode
setting only refers to installing and uninstalling, but that's a different thing?I'll do some more reading to try to understand this and let you know what I find out.
I haven't been able to get very far with this.
Adding entries to
/usr/share/applications/defaults.list
allows registration in (I assume) a system-wide manner. I just appended this:and then xdg-open tries to handle those URIs.
I think there is a "proper" way to do all of this, using
xdg-mime install
and an XML document. That will take a while to get through.Yeah, that is really weird. Mine does not try to install to a folder called root. I wonder if this has to do with some other xdg variable setting on your system?
What happens if you try to run:
That is an alternate way to go about things. It should produce the same result, but maybe will work better.
If you dont get an error, the setting can be confirmed by running:
If you have better luck with this then I am fine with switching over to it.
Either way, if we move forward we should prepend the command with a
-
. That way if it errors it doesn't halt installation. We can just consider it an optional part of the install. That said, it has made opening gopher/gemini/finger links from firefox really convenient.If the mime portion of this is deemed to unstable for the makefile I would like to update this branch to remove the mime stuff but keep the desktop file stuff. I think that portion should be very solid. That said, the
-
prefixing should take care of issues with adding mime and at least it would work on some systems that way. I think it is a really useful feature.Sorry, I had missed your above comment about adding directly to the file. I do believe that, as you mention, it is not recommended :-/
Try the
xdg-settings
version of the command and see if you have any better luck with that?I was definitely hoping to avoid having to go the xml route, particularly given that xdg-utils ships with two different ways to make this work. Hopefully we can get sorted through it and not have to resort to the xml (which was what made me shy away from doing it for osx).
xdg-settings
changes my user's mimeapps.list (in ~/.config). Running with sudo returns a similar error toxdg-mime
. Reading the man page, it is also not designed to be run as root.Maybe to clarify a point, when I run these commands as my user it all works. My user can't do
make install
though, it does not have permissions to the areas being modified.Also, another point to clarify: the folder root mentioned in the errors is the root user's home directory. Running these commands with sudo is trying to make the same user-specific changes, but to the root user.
It's possible that your root user has a home directory with a
.config
directory in it. You wouldn't get those errors when runningsudo make install
if that were the case.Regardless, I'm not too sure what other options there might be apart from removing it, ignoring the errors, or doing an XML. The
xdg-mime
commands could be moved to another target, with an additional step saying "if you want to set up URI handlers, runmake handlers
with your user account".That all still seems weird that I can run it (also on ubuntu) and you cannot. I wonder if this has anything to do with me setting my XDG_CONFIG_HOME to
~
? That is the only thing I can think of that would be majorly different. I'm on a pretty standard Ubuntu install. ITaking the above inconsistencies aside, I would be fine with adding a target I guess.
make handlers
sounds ok. The only issue with that is it only works for one user and is of no use to sys admins setting up bombadillo for the whole system.I would also be fine with skipping errors or ditching mime for the time being (but keeping desktop). Let me know what you think the best way would be.
I leave for vacation tomorrow (I'll have my computer with me so will be able to respond to things, but it may be intermittent), so my work day will be pretty lax today. I can try to look into the xml thing and see if that can be a solution for us as well.
Just for reference, I'm also testing this on Ubuntu and XDG_CONFIG_HOME variable doesn't seem to have an impact.
There might be a solution using
desktop-file-install
. I'm reading about it now, but it can run using sudo and installs the desktop file and URI handlers in one go. I'll update with some more information once I have it.Awesome! This is a great lead. Hopefully it pans out :) Definitely let me know what you find.
I've tested on two systems here and I think this is reliable when either:
xdg-open URL
It requires package desktop-file-utils which I think is installed by default on Ubuntu even with a minimal install.
The high-level process is:
Step 1 and 2 can be done as we currently do (manually copy files), however the tool
install-desktop-file
will validate and install the file.Step 3 can be done using the command
update-desktop-database
, but if we usedesktop-file-install
it has a flag to perform this operation.The tools don't seem to have the ability to uninstall, so we still need to manually remove the desktop file, the icon, and then run
update-desktop-database
.These are the two options for installation, first is not using
desktop-file-install
:and here is how it can be used:
Of the two options, the second seems more appropriate because of the validation performed. Considering the uninstall is just deleting the files, the first would be more a more uniform approach and does not require the tool (although maybe the tool is commonly installed like
xdg-open
?)By the way, there is a warning on
bombadillo.desktop
I thought you might like to see:I'm on really spotty internet so testing this on remote servers has been tricky. Hopefully this message sends.
It does not look like Arch (at least the Arch running on rawtext) has
desktop-file-install
installed (norupdate-desktop-database
). But that may be because it is not configured for a graphical environment.I had notcied that error just before you sent this last message! Just pushed it.
I think the first approach appeals more to me. The reason is that if either update-
desktop-database
ordesktop-file-install
are not present on the system, the desktop file is still where it needs to be.As such, my vote is for:
(Note the dash before
update-desktop-database
)I do agree that the validation is very useful, but it is something we can run before release. I'm not sure we gain a lot by having the user run it on install (so long as we have done so prior).
Let me know if you agree. If not I'm definitely open to pursuing other options if we can find a good one (or if you think
desktop-file-install
is the way to go)...Ok I've updated this now, I think it's ready for merging in. I did add piping of errors to /dev/null for
update-desktop-database
, although does this negate the use of-
?A point on your investigation: RTC will likely not have
desktop-file-utils
package as it does not seem to have any desktop packages installed (for example,xdg-open
is also not available). There is an arch package for this software though.Finally, a note on the makefile itself: it serves a fairly general purpose now, and further improvements have a couple of competing demands:
The updates look good to me. I'm not sure what happens with a pipe to null and the
-
operator in a makefile. I think it should still work fine. The process would still not exit with 0 so the dash is needed to continue execution. I think it should be good.That makes sense for RTC.
Agreed. There is a fine line between providing something useful and featureful and giving people too much and making it difficult for them to do it the way that makes sense on their system. I would still like to package the program at some point for at least debian (and derivatives). Maintaining multiple versions for multiple distros could quickly become a pain, but I am at least mildly interested in trying it out with one (to start with). In a perfect world the code would be developed here and there would be a maintainer for each distro that handled packaging the application. Maybe if this release takes off there might be some interest at some point.
I do not know much about autotools. It could be interesting to try it out. I had been under the impressions that they were mostly used for C/C++ code, but maybe that is a misconception? I have not used other build systems at all. Maybe once the release is up I can spend a little bit of time reading up on build systems and get some pros/cons together and see if it would make sense to change things up for the following release or not.
I'm going to merge this in. This should be the last code push! Just docs from here until release (hopefully, lol).