Commit a10f5008 authored by DFN2's avatar DFN2
Browse files

Merge branch 'development' into 'master'

Development

See merge request dfn2/pling-store!9
parents 3f749cba 8c880fc0
# 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`
......@@ -18,8 +18,8 @@
</head>
<body>
<app-root></app-root>
<script>
require = require('esm')(module);
module.exports = require('./scripts/renderers/browser-window.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;
}
});
......@@ -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>
......
......@@ -126,4 +126,4 @@ export default class MenuComponent extends BaseComponent {
}
}
}
}
\ No newline at end of file
{
"name": "ocs-store",
"version": "4.1.1",
"name": "pling-store",
"version": "5.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
{
"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":"*"
}
}
#!/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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment