├── .npmrc ├── .gitattributes ├── .gitignore ├── test ├── fixtures │ └── unicorn.gif └── test.js ├── .github ├── funding.yml └── workflows │ └── main.yml ├── .editorconfig ├── readme.md ├── package.json ├── index.js └── license /.npmrc: -------------------------------------------------------------------------------- 1 | package-lock=false 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | yarn.lock 3 | -------------------------------------------------------------------------------- /test/fixtures/unicorn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sindresorhus/kap-gifski/HEAD/test/fixtures/unicorn.gif -------------------------------------------------------------------------------- /.github/funding.yml: -------------------------------------------------------------------------------- 1 | github: sindresorhus 2 | open_collective: sindresorhus 3 | custom: https://sindresorhus.com/donate 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.yml] 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /test/test.js: -------------------------------------------------------------------------------- 1 | import test from 'ava'; 2 | 3 | // TODO: Need to mock the used Electron methods to make this work. 4 | // import kapPluginTest from 'kap-plugin-test'; 5 | // 6 | // test('main', async t => { 7 | // const plugin = kapPluginTest('unicorn.gif'); 8 | // 9 | // await plugin.run(); 10 | // }); 11 | 12 | test('main', t => { 13 | t.pass(); 14 | }); 15 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # kap-gifski 2 | 3 | > [Kap](https://github.com/wulkano/kap) plugin - Export to high-quality GIFs using [Gifski](https://github.com/sindresorhus/Gifski) 4 | 5 | ## Install 6 | 7 | In the `Kap` menu, go to `Preferences…`, select the `Plugins` pane, find this plugin, and toggle it. 8 | 9 | ## Usage 10 | 11 | In the editor, after recording, select `GIF`, and then `Export With Gifski`. 12 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | - push 4 | - pull_request 5 | jobs: 6 | test: 7 | name: Node.js ${{ matrix.node-version }} 8 | runs-on: ubuntu-latest 9 | strategy: 10 | fail-fast: false 11 | matrix: 12 | node-version: 13 | - 14 14 | - 12 15 | steps: 16 | - uses: actions/checkout@v2 17 | - uses: actions/setup-node@v1 18 | with: 19 | node-version: ${{ matrix.node-version }} 20 | - run: npm install 21 | - run: npm test 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "kap-gifski", 3 | "version": "1.0.1", 4 | "description": "Export to high-quality GIFs using Gifski", 5 | "license": "MIT", 6 | "repository": "sindresorhus/kap-gifski", 7 | "author": { 8 | "name": "Sindre Sorhus", 9 | "email": "sindresorhus@gmail.com", 10 | "url": "https://sindresorhus.com" 11 | }, 12 | "scripts": { 13 | "test": "xo && ava" 14 | }, 15 | "files": [ 16 | "index.js" 17 | ], 18 | "keywords": [ 19 | "kap-plugin", 20 | "gifski", 21 | "gif", 22 | "export", 23 | "high-quality", 24 | "quality" 25 | ], 26 | "dependencies": { 27 | "app-exists": "^1.0.0" 28 | }, 29 | "devDependencies": { 30 | "ava": "^2.2.0", 31 | "kap-plugin-test": "^0.5.0", 32 | "xo": "^0.30.0" 33 | }, 34 | "kap": { 35 | "kapVersion": ">=3.0.0", 36 | "macosVersion": ">=10.14.4" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const childProcess = require('child_process'); 3 | const {dialog, shell} = require('electron'); 4 | const appExists = require('app-exists'); 5 | 6 | const gifskiBundleId = 'com.sindresorhus.Gifski'; 7 | 8 | const action = async context => { 9 | const isGifskiInstalled = await appExists(gifskiBundleId); 10 | if (!isGifskiInstalled) { 11 | const {response: buttonIndex} = await dialog.showMessageBox({ 12 | message: 'The kap-gifski plugin requires the Gifski app, but the app was not found.', 13 | buttons: [ 14 | 'Get Gifski', 15 | 'Cancel' 16 | ] 17 | }); 18 | 19 | if (buttonIndex === 0) { 20 | await shell.openExternal('https://github.com/sindresorhus/Gifski'); 21 | } 22 | 23 | context.cancel(); 24 | return; 25 | } 26 | 27 | const filePath = await context.filePath({fileType: 'mp4'}); 28 | 29 | childProcess.spawn('open', ['-b', gifskiBundleId, filePath]); 30 | }; 31 | 32 | const gifski = { 33 | title: 'Export With Gifski', 34 | formats: [ 35 | 'gif' 36 | ], 37 | action 38 | }; 39 | 40 | exports.shareServices = [gifski]; 41 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Sindre Sorhus (https://sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | --------------------------------------------------------------------------------