Opened 3 years ago

Last modified 3 years ago

#1928 open enhancement

Make Desktop File for Linux Install

Reported by: lazygravy Owned by: lazygravy
Priority: minor Milestone: 0.9.29
Component: installer Version: 0.9.28
Keywords: usability Cc:
Parent Tickets: Sensitive: no

Description

I saw a post on Reddit where a user was saying they couldn't figure out how to start I2P on his Linux install. I suggest we include an i2p.desktop file with Linux installs.

The desktop file seems to work with Debian and Fedora. I am not sure how many distributions/desktop environments we should target.

Relevant documentation: https://developer.gnome.org/integration-guide/stable/desktop-files.html.en

Subtickets

Attachments (3)

trac-1928.diff (9.1 KB) - added by lazygravy 3 years ago.
patch
0004-i2p-desktop.patch (590 bytes) - added by lazygravy 3 years ago.
i2p.desktop (237 bytes) - added by lazygravy 3 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 3 years ago by lazygravy

Version: 0.9.28

I have a working copy locally, but I need to make it apart of build.xml.

comment:2 Changed 3 years ago by zzz

Component: router/generalinstaller
Status: newopen

There's an easier way. Izpack does most of the work for us. We currently only enable it for Windows but we can add unix. Docs: https://izpack.atlassian.net/wiki/display/IZPACK/Shortcut+Panel

In installer/install.xml in the panels section, add

        <panel classname="ShortcutPanel"><os family="unix" /></panel>

that got me to these errors when running the installer:

/tmp/i2p283foo/Start-I2P-(no-window)-1484487593508.desktop (No such file or directory)
/tmp/i2p283foo/Start-I2P-(restartable)-1484487593510.desktop (No such file or directory)
/tmp/i2p283foo/I2P-router-console-1484487593512.desktop (No such file or directory)

So now take the windows spec file installer/resources/shortcutSpec.xml, copy it to Unix_shortcut_spec.xml, modify as necessary, make sure it's included in build.xml, and add the resources line to install.xml. That part I haven't tried.

comment:3 Changed 3 years ago by zzz

Hopefully the above does not require izpack 5. See #1864

comment:4 Changed 3 years ago by lazygravy

I finally for izback to make a .desktop file, and it turns out that Debian does not like it. :(

Specifically, it generates the "Exec=…" line with the command $INSTALL_DIR/i2prouter.sh start with quotes, which Debian won't run.

What are the disadvantages of using a .desktop file that is written and $INSTALL_DIR is swapped out by izpack?

comment:5 Changed 3 years ago by lazygravy

I do have it working with the debian files, which is nice. I think that would also be a good!

comment:6 Changed 3 years ago by zzz

The good part about using ShortcutPanel? is we get a dialog box in the installer to ask the user if he wants it. The fallback, if you can't get that to work, is just bundling a pre-made desktop file all the time. That's probably fine too, but not ideal. If there are bugs we can't work around, perhaps they are fixed in Izpack 5 #1864 but that could be a lot of work, I think 5 is a lot different.

Sounds like you are making good progress.

comment:7 Changed 3 years ago by lazygravy

I decided to go with the manual approach.

I've attached my patch. I want to test it more with Debian before anything is merged.

Changed 3 years ago by lazygravy

Attachment: trac-1928.diff added

patch

comment:8 Changed 3 years ago by zzz

  • you didn't attach the new files i2p.desktop and 0004-i2p-desktop.patch for review
  • debian patch files are a pain to maintain, if there's a way to avoid it that would be better, but I suspect we'll have to do it
  • unrelated changes readme.license.txt, whitespace changes, debian/control you should just check in, not include here for review
  • I don't see anything that puts the .desktop file in ~/.local/share/applications/ for non-deb installs as specified at https://developer.gnome.org/integration-guide/stable/desktop-files.html.en - how does it get there?
  • I don't think the desktop file needs to be 755 in postinstall.sh, none of the desktop files on my system are executable

Changed 3 years ago by lazygravy

Attachment: 0004-i2p-desktop.patch added

Changed 3 years ago by lazygravy

Attachment: i2p.desktop added

comment:9 Changed 3 years ago by lazygravy

Replying to zzz:

  • you didn't attach the new files i2p.desktop and 0004-i2p-desktop.patch for review

Yeah, sorry about that. Brain fart. Attached now.

  • debian patch files are a pain to maintain, if there's a way to avoid it that would be better, but I suspect we'll have to do it

Since the start script will be in /usr/bin/i2pinstall the patch is needed, but it should be easy enough to maintain.

  • unrelated changes readme.license.txt, whitespace changes, debian/control you should just check in, not include here for review

Ack. I need to sign the CLA, but I won't commit those for now.

For now, I keep the .desktop in %INSTALL_PATH. It gets installed globally for Debian, but I wasn't sure what kind of experience should happen for jar installs.

  • I don't think the desktop file needs to be 755 in postinstall.sh, none of the desktop files on my system are executable

For some reason Nautilus won't show the .desktop file as a clickable icon unless I make it u+x. I will experiment further.

comment:10 Changed 3 years ago by zzz

re: non-Deb installs, that's the problem with doing it manually instead of with ShortcutPanel?. The options are:

  • Don't install it automatically for non-deb installs, this change is only for packages
  • Always install it automatically for non-deb installs
  • Figure out how to fix ShortcutPanel?, either by patching our current 4.3.0, or upgrading to 4.3.5 or 5.0.0 (#1864) if there's a fix in there
  • Add a custom panel that reimplements what we need from ShortcutPanel? but without the bugs

First two are easy, last two are hard. We could also start out not installing it, and defer a solution to a later release.

comment:11 Changed 3 years ago by zzz

One misery with custom panels is translations, although perhaps we could use the same strings as ShortcutPanel?.

Note: See TracTickets for help on using tickets.