I'm trying to make a snappy package, I'm not a developer but want to give this a go anyway and any help is appreciated.
The snapcraft.yaml
I have made is as follows (you save this file in a folder, then run snapcraft prime
in the folder, then sudo snap try prime/ --devmode
to test Devmode or sudo snap try prime/
to test Strict. Then use sudo snap connect neofetch:hardware-observe core:hardware-observe
so that the Model entry works. You can then use neofetch
in Terminal or snap run neofetch
to ensure you're running the snap you just built. To update, just change the source
to the new release and run snapcraft again, or you can even point the URL to the GitHub repo (and change grade
to devel
) and you can update it every now and then so it's using the new master code):
name: neofetch
version: 3.1.0
summary: Neofetch
description: A fast, highly customizable system info script
confinement: strict
grade: stable
apps:
neofetch:
# Export LC_ALL to workaround [LP: #1576411] (still get an error with this workaround though)
command: env LC_ALL=C.UTF-8 $SNAP/neofetch
plugs:
- hardware-observe
parts:
neofetch:
plugin: dump
source: https://github.com/dylanaraps/neofetch.git
source-tag: 3.1.0
stage-packages:
- w3m
- imagemagick
- cmus
- feh
- mpc
- nitrogen
- scrot
- x11-utils
- moc
after:
# wimpress said this would help with Themes and Fonts but it doesn't seem to do so
- desktop-glib-only
We may not need all the stage-packages, they are just the suggests from the Debian package which I thought I'd add to see if it would get more of Neofetch working, we should probably remove them one-by-one and see if doing that removes any functionality (I'm assuming we don't need to install Bash?!). I think the dependencies are included in the snap, so doing so would bring down the file size (with those stage-packages it is 63.7 MB, without them it is 65.5 KB).
Also note that we need to confine the snap. If I don't give it any interfaces, we get the following from snap run neofetch
:
In devmode, where the snap isn't confined:
With stage-packages:
Without stage-packages:
We're losing Model, Theme and Icons when we confine the snap.
We can also see from this that we're losing Resolution and WM without stage-packages.
However, when I use usr/bin/neofetch
to load the PPA package version of Neofetch...:
We get Packages, WM Theme and GPU. The most important of these is probably GPU (since this is a snap, do we need to know how many Debs are installed? Or maybe we need a new feature which can detect Deb and snap packages when snapd is on the system).
Also, it's meant to say what the wallpaper is and what music is playing? That doesn't seem to work for the PPA Deb package either for me (not when playing music in Rhythmbox), so that's not a fault in the snap I don't think. What other features in Neofetch are there which should be supported by the snap? I've only tried running neofetch
so far, with the Deb and with the snap.
Any thoughts?
Btw, justification for making a snap package, it's like a PPA in that it can be updated to the latest version on any Ubuntu system, except there's no risk of dependency hell because dependencies can be included if Ubuntu Core doesn't provide the necessary versions. It's confined (more secure) and simpler (once we've made the first working snap anyway) and you can install it with just one command (once we've uploaded it to the store). It also works on any distro with snapd
installed.
Thanks @dylanaraps for trying to get your program working on as many platforms as possible and for encouraging me to open this issue!
Ubuntu 16.10