Skip to content

Commit

Permalink
test new snapcraft file (#73)
Browse files Browse the repository at this point in the history
* test new snapcraft file

* fixed snap file with picker feature
  • Loading branch information
Toinane authored Apr 8, 2020
1 parent b7bad0f commit 9c8f1d6
Show file tree
Hide file tree
Showing 9 changed files with 523 additions and 323 deletions.
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
/node_modules
/out
node_modules/
out/
parts/
stage/
prime/
snap/.snapcraft
*.snap
3 changes: 0 additions & 3 deletions colorpicker-build-nightly.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
"category": "Graphics",
"executableName": "colorpicker-app"
},
"snap": {
"plugs": ["default", "desktop"]
},
"win": {
"icon": "build/icon-nightly.ico"
},
Expand Down
3 changes: 0 additions & 3 deletions colorpicker-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
"category": "Graphics",
"executableName": "colorpicker-app"
},
"snap": {
"plugs": ["default", "desktop"]
},
"win": {
"icon": "build/icon.ico"
},
Expand Down
710 changes: 403 additions & 307 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
{
"name": "colorpicker",
"productName": "Colorpicker",
"version": "2.0.3",
"productName": "colorpicker",
"version": "2.0.4",
"description": "Colorpicker is a little Electron app that can show colors with hex/rgb code, and generate shading for your color.",
"main": "src/main.js",
"scripts": {
"start": "npx electron src/main.js",
"standard": "standard",
"pack": "electron-builder --dir",
"publish": "snapcraft push --release=stable out/*.snap",
"publish": "snapcraft push --release=stable *.snap",
"release": "electron-builder --publish=never --config colorpicker-build.json",
"release-linux": "electron-builder --publish=never --config colorpicker-build.json --linux deb appImage",
"release-snap": "snapcraft snap",
"release-window": "electron-builder --publish=never --config colorpicker-build.json --win nsis portable",
"nightly": "electron-builder --publish=never --config colorpicker-build-nightly.json",
"nightly-linux": "electron-builder --publish=never --config colorpicker-build-nightly.json --linux deb appImage",
"rebuild": "npm rebuild --runtime=electron --target=7.1.7 --disturl=https://atom.io/download/electron --abi=75"
"rebuild": "npm rebuild --runtime=electron --target=8.2.1 --disturl=https://atom.io/download/electron --abi=76"
},
"repository": "https://github.com/toinane/colorpicker",
"keywords": [
Expand All @@ -32,17 +33,17 @@
"request": "^2.88.2",
"robotjs": "git+https://github.com/Toinane/robotjs",
"sortablejs": "^1.10.2",
"tippy.js": "^6.0.3"
"tippy.js": "^6.1.1"
},
"optionalDependencies": {
"osx-mouse": "git+https://github.com/Toinane/osx-mouse",
"win-mouse": "git+https://github.com/Toinane/win-mouse",
"iohook": "^0.6.5"
},
"devDependencies": {
"electron": "7.1.7",
"electron": "8.2.1",
"electron-builder": "22.4.1",
"standard": "^14.3.1"
"standard": "14.3.3"
},
"author": {
"name": "Toinane",
Expand All @@ -54,7 +55,7 @@
"license": "GPL-3.0",
"iohook": {
"targets": [
"electron-75"
"electron-76"
],
"platforms": [
"linux"
Expand Down
10 changes: 10 additions & 0 deletions snap/gui/colorpicker-app.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Name=Colorpicker
Exec=colorpicker-app --no-sandbox %U
Terminal=false
Type=Application
Icon=${SNAP}/usr/share/icons/hicolor/256x256/apps/colorpicker-app.png
StartupWMClass=Colorpicker
Comment=Colorpicker
MimeType=x-scheme-handler/colorpicker;
Categories=Graphics;Utility;
Binary file added snap/gui/colorpicker-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 91 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: colorpicker-app
version: '2.0.4'
base: core18
summary: A mininal but complete Colorpicker desktop app
description: |
Colorpicker is a desktop tool with Electron to get and save colors code quickly for OSX, Windows and Linux!
Colorpicker's menu come with a lot of cool features :
- Pin : pin Colorpicker to the foreground;
- Picker: open an eyedropper who can pick a color from your desktop;
- Colorsbook: open Colorsbook, a color manager;
- Shading: show three bar of shading — hue bar, natural bar and lightness bar;
- Opacity: toggle Opacity range;
- Clean Vue: unshow menu, ranges and inputs;
- Magic color: show colors from the clipboard;
- Random: show a random color;
- Settings: open the preferences panel.
grade: stable
confinement: strict

apps:
colorpicker-app:
extensions: [gnome-3-28]
command: opt/Colorpicker/colorpicker-app --no-sandbox
desktop: usr/share/applications/colorpicker-app.desktop
autostart: colorpicker-app.desktop
plugs:
- desktop
- desktop-legacy
- home
- opengl
- x11
- unity7
- wayland
- browser-support
- network
- gsettings
- pulseaudio
environment:
TMPDIR: $XDG_RUNTIME_DIR
GSETTINGS_SCHEMA_DIR: $SNAP/usr/share/glib-2.0/schemas
XDG_CURRENT_DESKTOP: Unity
DISABLE_WAYLAND: 1

parts:
libxkbcommon-x11-0:
plugin: nil
stage-packages:
- libxkbcommon-x11-0
prime:
- usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libxkbcommon*.so*
- usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libxkbcommon-x11*.so*

colorpicker-app:
after: [libxkbcommon-x11-0]
plugin: dump
source: ./out/colorpicker_2.0.3_amd64.deb
source-type: deb
override-build: |
snapcraftctl build
sed -i 's|Icon=colorpicker-app|Icon=/usr/share/icons/hicolor/256x256/apps/colorpicker-app.png|' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/colorpicker-app.desktop
prime:
- -opt/Colorpicker/chrome-sandbox
stage-packages:
- libasound2
- libgconf2-4
- libnotify4
- libnspr4
- libnss3
- libpcre3
- libpulse0
- libxss1
- libxtst6
- libpng++-dev
- libx11-dev
- libxtst-dev
- libxt-dev
- libx11-xcb-dev
- libxkbcommon-dev
- libxkbcommon-x11-dev

cleanup:
after: [colorpicker-app]
plugin: nil
build-snaps: [ gnome-3-28-1804 ]
override-prime: |
set -eux
cd /snap/gnome-3-28-1804/current
find . -type f,l -exec rm -f $SNAPCRAFT_PRIME/{} \;
3 changes: 3 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const touchbar = require('./touchbar')(__dirname, eventEmitter)
const browsers = require('./browsers')(__dirname, storage, {touchbar, eventEmitter})
const {colorpicker, colorsbook, picker, settings} = browsers

// @TODO remove when [email protected]
app.allowRendererProcessReuse = true

require('./events')(storage, browsers, eventEmitter)

if (process.platform === 'linux') {
Expand Down

0 comments on commit 9c8f1d6

Please sign in to comment.