diff --git a/README.md b/README.md index c9330150e8984b7f8669942df7984c5b846946a6..7315eb760561d5ab6975b9ca4d4c2c4b3f802d52 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,45 @@ -# pling-store +# Pling-Store -Pling store electron \ No newline at end of file +Pling-Store is a Content Management App for OCS-compatible websites like opendesktop.org, gnome-look.org, etc. +It allows to download and install applications, desktop themes, icon themes, wallpapers, or mouse cursors +under various desktop environments using the "Install"-button. + +Currently supported are these desktop environments: +KDE Plasma, Gnome, XFCE, Mate, Cinnamon, Budgie, LXQt, Elementary and Enlightenment. + +## Usage + +Using the Appimage package format, it should work on any distro like Ubuntu, Debian, Arch, Suse, Redhat and many more. + + +### Best with AppImageLauncher + +If you never used an Appimage before, we recommend this tool to make AppImages run, install/uninstall and update on your Linux OS: +https://www.pling.com/p/1228228/ + +*Please see if AppImageLauncher offers native packages for your distro, if not, you may request it in the issue section.* + +After installing AppImageLauncher, you can simply Double-Click on the Pling-Store Appimage to run or install it. + + +### Manual Run + +To try the Pling-Store without installing, you can simply [make it executable](https://youtu.be/nzZ6Ikc7juw?t=78) and (double-)click on it. + +## Development + +The Pling-Store is a regular electron app plus the [ocs-manager](https://git.opendesktop.org/akiraohgaki/ocs-manager/). The first acts as a presentation +layer and the second is the one who handles the intallation of the different products. + +### Project Setup + +``` +npm install +curl -fsSL -o node_modules/.bin/ocs-manager https://git.opendesktop.org/akiraohgaki/ocs-manager/uploads/d3dc42436b82d11360ebc96b38d4aaf4/ocs-manager-0.8.1-1-x86_64.AppImage +chmod +x node_modules/.bin/ocs-manager +``` + + +### AppImage Generation + +`./scripts/package appimage` diff --git a/app/index.html b/app/index.html index c522c34a5b1353788c61a0bd46458e4fa0d4fdb0..63a159d477797cf18f59e35ce5325aa134102fab 100644 --- a/app/index.html +++ b/app/index.html @@ -18,8 +18,8 @@ </head> <body> + <app-root></app-root> - <script> require = require('esm')(module); module.exports = require('./scripts/renderers/browser-window.js'); diff --git a/app/main.js b/app/main.js index ca5172797b7b7c2e0a0066fcbf1c0d5607202877..edda4e9867366f328bfc384b0af2a3dca325e949 100644 --- a/app/main.js +++ b/app/main.js @@ -5,13 +5,16 @@ const {app, BrowserWindow, ipcMain} = require('electron'); const ElectronStore = require('electron-store'); const request = require('request'); +// Set configs dir +app.setPath("userData", app.getPath("appData") + "/OCS-Store") + const appPackage = require('../package.json'); const appConfig = require('./configs/application.json'); const ocsManagerConfig = require('./configs/ocs-manager.json'); const isDebugMode = process.argv.includes('--debug'); const previewpicDirectory = `${app.getPath('userData')}/previewpic`; -const windowIcon = `${__dirname}/images/app-icons/ocs-store.png`; +const windowIcon = `${__dirname}/images/app-icons/pling-store.png`; const indexFileUrl = `file://${__dirname}/index.html`; const appConfigStoreStorage = 'application'; @@ -88,7 +91,7 @@ function createWindow() { } mainWindow.loadURL(indexFileUrl); - + mainWindow.maximize(); mainWindow.on('close', () => { const appConfigStore = new ElectronStore({name: appConfigStoreStorage}); appConfigStore.set('windowBounds', mainWindow.getBounds()); @@ -107,8 +110,7 @@ function isFile(path) { try { const stats = fs.statSync(path); return stats.isFile(); - } - catch (error) { + } catch (error) { console.error(error); return false; } @@ -118,8 +120,7 @@ function isDirectory(path) { try { const stats = fs.statSync(path); return stats.isDirectory(); - } - catch (error) { + } catch (error) { console.error(error); return false; } @@ -159,8 +160,7 @@ function removePreviewpic(itemKey) { app.on('ready', async () => { if (await startOcsManager()) { createWindow(); - } - else { + } else { app.quit(); } }); @@ -220,19 +220,15 @@ ipcMain.on('store', (event, key, value) => { ipcMain.on('previewpic', (event, kind, itemKey, url) => { if (kind === 'directory') { event.returnValue = previewpicDirectory; - } - else if (kind === 'path' && itemKey) { + } else if (kind === 'path' && itemKey) { event.returnValue = `${previewpicDirectory}/${previewpicFilename(itemKey)}`; - } - else if (kind === 'download' && itemKey && url) { + } else if (kind === 'download' && itemKey && url) { downloadPreviewpic(itemKey, url); event.returnValue = undefined; - } - else if (kind === 'remove' && itemKey) { + } else if (kind === 'remove' && itemKey) { removePreviewpic(itemKey); event.returnValue = undefined; - } - else { + } else { event.returnValue = false; } }); diff --git a/app/scripts/components/OmniboxComponent.js b/app/scripts/components/OmniboxComponent.js index a9107a4af490f0bf7e49cb23b57082bac1f00a09..28439df699a77feb920329ecb233d78d2a60faec 100644 --- a/app/scripts/components/OmniboxComponent.js +++ b/app/scripts/components/OmniboxComponent.js @@ -233,11 +233,11 @@ export default class OmniboxComponent extends BaseComponent { <ul> <li><app-button data-action="webview_startPage" data-url="https://www.pling.com/">pling.com</app-button></li> <li><app-button data-action="webview_startPage" data-url="https://www.appimagehub.com/">Appimagehub.com</app-button></li> - <li><app-button data-action="webview_startPage" data-url="https://store.kde.org/">store.kde.org</app-button></li> - <li><app-button data-action="webview_startPage" data-url="https://www.pling.com/s/Artwork">s/Artwork</app-button></li> - <li><app-button data-action="webview_startPage" data-url="https://www.pling.com/s/Gnome">s/Gnome</app-button></li> + <li><app-button data-action="webview_startPage" data-url="https://store.kde.org/">KDE</app-button></li> + <li><app-button data-action="webview_startPage" data-url="https://www.pling.com/s/Artwork">Artwork</app-button></li> + <li><app-button data-action="webview_startPage" data-url="https://www.pling.com/s/Gnome">Gnome</app-button></li> <li><app-button data-action="webview_startPage" data-url="https://www.pling.com/s/Comics">Comics</app-button></li> - <li><app-button data-action="webview_startPage" data-url="https://www.pling.com/s/XFCE">xfce-look.org</app-button></li> + <li><app-button data-action="webview_startPage" data-url="https://www.pling.com/s/XFCE">XFCE</app-button></li> <li><app-button data-action="webview_startPage" data-url="https://www.pling.com/s/Videos">Videos</app-button></li> </ul> </nav> diff --git a/app/scripts/components/common/MenuComponent.js b/app/scripts/components/common/MenuComponent.js index 6b567bf1a8f3fdb83f76c7b5c2ffed4b26247594..04b97cb475e62f76e1a2852038fb223f4f587409 100644 --- a/app/scripts/components/common/MenuComponent.js +++ b/app/scripts/components/common/MenuComponent.js @@ -126,4 +126,4 @@ export default class MenuComponent extends BaseComponent { } } -} +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7b3dcee6c81b20aa6b13a85ae2e146e9258321e2..47b2512edd329e522dc39adfba425d58531615ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { - "name": "ocs-store", - "version": "4.1.1", + "name": "pling-store", + "version": "5.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1743bd550449caf73dd8168ea1c0fb469be46272..1f2ac24c3730e25df75cf58b80f4528bcc53a86a 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,19 @@ { "name": "pling-store", "productName": "Pling-Store", - "version": "4.1.1", + "version": "5.0.1", "description": "Store Frontend and Management Application based on OpenCollaborationServices (OCS) of Opendesktop.org.", - "author": "Opendesktop.org", + "author": "Pling.com", "license": "GPL-3.0", - "homepage": "https://www.opendesktop.org/", + "homepage": "https://www.pling.com/", "repository": "https://www.opencode.net/dfn2/pling-store", "bugs": "https://www.opencode.net/dfn2/pling-store/issues", "main": "app/main.js", "scripts": { "start": "electron .", "debug": "electron . --debug", - "package": "electron-packager . pling-store --platform=linux --arch=x64 --out=dist --overwrite --ignore='^/(\\.gitignore|\\.gitlab\\-ci\\.yml|Makefile|README\\.md|desktop|launcher|pkg|scripts|appimagebuild)($|/)'" + "package": "electron-packager . pling-store --platform=linux --arch=x64 --out=dist --overwrite --ignore='^/(\\.gitignore|\\.gitlab\\-ci\\.yml|Makefile|README\\.md|desktop|launcher|pkg|scripts|appimagebuild)($|/)'", + "watch" : "webpack --mode development --watch" }, "dependencies": { "electron-store": "2.*.*", @@ -22,6 +23,14 @@ }, "devDependencies": { "electron": "4.*.*", - "electron-packager": "13.*.*" + "electron-packager": "13.*.*", + "@babel/core":"*", + "@babel/polyfill":"*", + "@babel/preset-env": "*", + "@babel/preset-react": "*", + "react":"*", + "react-dom":"*", + "webpack":"*", + "webpack-cli":"*" } } diff --git a/pkg/appimage/appimagebuild b/pkg/appimage/appimagebuild index 92e961c71a6933ab6df04c238ff3b650ce2ded9c..38b3384854586193ed981b92eb60450708267caf 100755 --- a/pkg/appimage/appimagebuild +++ b/pkg/appimage/appimagebuild @@ -1,7 +1,7 @@ #!/bin/bash PKGNAME='pling-store' -PKGVER='4.1.1' +PKGVER='5.0.1' PKGREL='1' UPDINFO='zsync|http://dl.opendesktop.org/api/files/download/id/1532435039/as/latest/ocs-store-x86_64.AppImage.zsync' @@ -22,7 +22,7 @@ install -D -m 755 /usr/lib/x86_64-linux-gnu/libgnome-keyring.so.0 ${APPDIR}/usr/ curl -fsSL -o ocs-manager https://git.opendesktop.org/akiraohgaki/ocs-manager/uploads/d3dc42436b82d11360ebc96b38d4aaf4/ocs-manager-0.8.1-1-x86_64.AppImage install -D -m 755 ocs-manager ${APPDIR}/usr/bin/ocs-manager -IMWHEEL_PATH=`which imwheel` +IMWHEEL_PATH=$(which imwheel) install -D -m 755 ${IMWHEEL_PATH} ${APPDIR}/usr/bin/ocs-imwheel install -D -m 644 imwheel.conf ${APPDIR}/usr/share/imwheel/.imwheelrc @@ -31,4 +31,9 @@ chmod 755 appimagetool ./appimagetool --appimage-extract ./squashfs-root/AppRun -u "${UPDINFO}" ${APPDIR} +# Only timestamp development branches +if [ "${CI_COMMIT_REF_SLUG}" != "master" ]; then + PKGREL=dev-${CI_COMMIT_SHORT_SHA}-$(date +"%Y%m%d-%H%M%S") +fi + mv *-x86_64.AppImage ../${PKGNAME}-${PKGVER}-${PKGREL}-x86_64.AppImage