提交 9c4ef7e4 编写于 作者: M muwoo

merge changes

build/icons/256x256.png

18.9 KB | W: | H:

build/icons/256x256.png

15.0 KB | W: | H:

build/icons/256x256.png
build/icons/256x256.png
build/icons/256x256.png
build/icons/256x256.png
  • 2-up
  • Swipe
  • Onion skin
build/icons/icon.ico

18.0 KB | W: | H:

build/icons/icon.ico

15.0 KB | W: | H:

build/icons/icon.ico
build/icons/icon.ico
build/icons/icon.ico
build/icons/icon.ico
  • 2-up
  • Swipe
  • Onion skin
......@@ -75,7 +75,7 @@ rubick 更多支持 API 能力参考:[rubick 全局API](https://github.com/clo
复制 `plugin.json` 文件,在 `rubick` 主窗口执行 `ctrl/command + v` 即可唤起安装插件的功能,选择`新建rubick插件`,进入插件主界面,
开启插件后,在插件主窗口即可通过命令打开插件:
![](/images/5.gif)
![](/rubick/images/5.gif)
本小节所有代码:[rubcik-plugin-demo](https://github.com/clouDr-f2e/rubick-plugin-demo)
......@@ -3,7 +3,7 @@
安装完成后打开 rubick 即可看到主搜索界面:
![](/images/1.png)
![](/rubick/images/1.png)
目前支持 windows 和 macos。linux 小伙伴正在开发中
......@@ -21,7 +21,7 @@
```
也就是说只要当前系统软件安装到这些目录才会被检索到。支持中文搜索和拼音、拼音首字母搜索:
![](/images/2.gif)
![](/rubick/images/2.gif)
`Windows` 内由于安装目录太多不确定,有的在 C盘,有的在D盘,还有的在自定义其他位置,所以该功能还在设计中,如果您有好的方案也欢迎提供:[issues](https://github.com/clouDr-f2e/rubick/issues)
......@@ -42,13 +42,13 @@
点击搜索框右侧 rubick 图标,进入插件市场,选择所需插件,点击下载按钮即可下载,下载完成后在已安装 tab 下可以找到安装插件。
安装完成后,输入插件呼起命令即可使用对应插件:
![](/images/3.gif)
![](/rubick/images/3.gif)
### 4. 右击增强
通常我们需要使用鼠标右击来对桌面属性进行拓展,`Rubick` 支持对右击属性进行增强功能,长按鼠标右键即可呼起。如果安装的插件支持
特殊类型的文件操作,还可以在右键中唤起插件:
![](/images/4.gif)
![](/rubick/images/4.gif)
### 更多功能
如果您还需要更多功能,欢迎来这里给我们提建议:[issues](https://github.com/clouDr-f2e/rubick/issues/20)
......
{
"name": "rubick2",
"version": "0.0.3-beta.1",
"version": "0.0.3-beta.2",
"author": "muwoo <2424880409@qq.com>",
"description": "An electron-vue project",
"license": null,
......@@ -68,6 +68,7 @@
"bplist-parser": "^0.3.0",
"download": "^8.0.0",
"download-git-repo": "^3.0.2",
"electron-is-dev": "^2.0.0",
"electron-store": "^8.0.0",
"iohook": "^0.9.3",
"is-chinese": "^1.4.2",
......@@ -117,7 +118,7 @@
"file-loader": "^1.1.11",
"html-webpack-plugin": "^3.2.0",
"iconv-lite": "^0.6.3",
"less": "^4.1.1",
"less": "^2.7.3",
"less-loader": "^5.0.0",
"listr": "^0.14.3",
"mini-css-extract-plugin": "0.4.0",
......
......@@ -18,6 +18,7 @@ module.exports = () => {
frame: false,
title: '拉比克',
show: false,
skipTaskbar: true,
webPreferences: {
webSecurity: false,
enableRemoteModule: true,
......
......@@ -9,13 +9,6 @@ export default function init(mainWindow) {
listener.registerShortCut(mainWindow);
listener.init(mainWindow);
// 设置开机启动
const config = global.opConfig.get();
app.setLoginItemSettings({
openAtLogin: config.perf.common.start,
openAsHidden: true,
});
mainWindow.once("ready-to-show", () => {
// 非隐藏式启动需要显示主窗口
if (!app.getLoginItemSettings().wasOpenedAsHidden) {
......
import {BrowserWindow, clipboard, globalShortcut, ipcMain, Notification, screen} from "electron";
import {app, BrowserWindow, clipboard, globalShortcut, ipcMain, Notification, screen} from "electron";
import {exec, spawn} from "child_process";
import robot from "robotjs";
import Api from "./api";
import ioHook from 'iohook';
import {throttle} from './utils';
import {throttle, commonConst} from './utils';
const browsers = require("../browsers")();
const {picker, separator, superPanel} = browsers;
......@@ -21,8 +21,7 @@ class Listener {
clipboard.clear();
// 复制选中文案
const platform = process.platform;
if (platform === 'darwin') {
if (commonConst.macOS()) {
robot.keyTap('c', 'command');
} else {
robot.keyTap('c', 'control');
......@@ -55,9 +54,11 @@ class Listener {
const currentDisplay = screen.getDisplayNearestPoint({ x, y });
const wx = parseInt(currentDisplay.workArea.x + currentDisplay.workArea.width / 2 - 400);
const wy = parseInt(currentDisplay.workArea.y + currentDisplay.workArea.height / 2 - 200);
mainWindow.setVisibleOnAllWorkspaces(true);
mainWindow.setAlwaysOnTop(true)
mainWindow.setVisibleOnAllWorkspaces(true, {visibleOnFullScreen: true});
mainWindow.focus();
mainWindow.setVisibleOnAllWorkspaces(false);
mainWindow.setVisibleOnAllWorkspaces(false, {visibleOnFullScreen: true});
mainWindow.setPosition(wx, wy);
mainWindow.show();
});
......@@ -95,6 +96,7 @@ class Listener {
picker.getWindow().webContents.send("updatePicker", colors);
}, 100);
this.setAutoLogin();
this.colorPicker();
this.initPlugin();
this.lockScreen();
......@@ -231,10 +233,21 @@ class Listener {
reRegisterShortCut(mainWindow) {
ipcMain.on('re-register', (event, arg) => {
this.setAutoLogin();
this.registerShortCut(mainWindow);
});
}
setAutoLogin() {
// 设置开机启动
const config = global.opConfig.get();
app.setLoginItemSettings({
openAtLogin: config.perf.common.start,
openAsHidden: true,
});
}
changeSize(mainWindow) {
// 修改窗口尺寸
ipcMain.on('changeWindowSize-rubick', (event, arg) => {
......
......@@ -53,3 +53,22 @@ export function throttle (func, wait, options) {
};
}
export const commonConst = {
linux: function () {
return process.platform === 'linux'
},
macOS () {
return process.platform === 'darwin';
},
windows () {
return process.platform === 'win32'
},
production: function () {
return process.env.NODE_ENV !== 'development';
},
dev: function () {
return process.env.NODE_ENV === 'development';
},
}
import { app } from 'electron'
import { app, globalShortcut } from 'electron'
import '../renderer/store'
import init from './common/common';
import {autoUpdate} from './common/autoUpdate';
import createTray from './tray';
import {commonConst} from './common/utils';
const {main} = require("./browsers")();
/**
* Set `__static` path to static files in production
* https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html
*/
if (process.env.NODE_ENV !== 'development') {
if (commonConst.production()) {
global.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\')
}
// to fix https://github.com/electron/electron/issues/18397
app.allowRendererProcessReuse = false;
if (process.platform === 'darwin') {
app.dock.hide();
}
function createWindow() {
main.init();
init(main.getWindow());
}
class initApp {
launchApp() {
const gotTheLock = app.requestSingleInstanceLock()
if (!gotTheLock) {
app.quit()
} else {
this.beforeReady()
this.onReady()
this.onRunning()
this.onQuit()
}
}
app.on('ready', () => {
createWindow()
createTray(main.getWindow());
autoUpdate();
})
createWindow() {
main.init();
init(main.getWindow());
}
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
beforeReady() {
// 系统托盘
if (commonConst.macOS()) {
if (commonConst.production() && !app.isInApplicationsFolder()) {
app.moveToApplicationsFolder();
} else {
app.dock.hide();
}
}else {
app.disableHardwareAcceleration();
}
}
})
app.on('activate', () => {
createWindow()
});
onReady() {
const readyFunction = () => {
this.createWindow();
createTray(main.getWindow());
autoUpdate();
}
if (!app.isReady()) {
app.on('ready', readyFunction)
} else {
readyFunction()
}
}
onRunning() {
app.on('second-instance', (event, commandLine, workingDirectory) => {
// 当运行第二个实例时,将会聚焦到myWindow这个窗口
const win = main.getWindow();
if (win) {
if (win.isMinimized()) {
win.restore();
}
win.focus();
}
});
app.on('activate', () => {
if (!main.getWindow()) {
this.createWindow();
}
});
}
onQuit () {
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('will-quit', () => {
globalShortcut.unregisterAll()
})
// Exit cleanly on request from parent process in development mode.
if (commonConst.dev()) {
if (process.platform === 'win32') {
process.on('message', data => {
if (data === 'graceful-exit') {
app.quit()
}
})
} else {
process.on('SIGTERM', () => {
app.quit()
})
}
}
}
}
(new initApp()).launchApp();
import { dialog, Menu, Tray, app, shell, ipcMain } from 'electron';
import { dialog, Menu, Tray, app, shell } from 'electron';
import path from 'path';
import pkg from '../../package.json';
import os from 'os';
import {commonConst} from './common/utils';
function createTray(window) {
return new Promise((resolve, reject) => {
const appIcon = new Tray(path.join(__static, './rocket.png'));
let icon;
if (commonConst.macOS()) {
icon = './icon@3x.png'
}else if (commonConst.windows()) {
icon = parseInt(os.release()) < 10 ? './icon@2x.png' : './icon.ico';
}else {
icon = 'icon@2x.png'
}
const appIcon = new Tray(path.join(__static, icon));
const contextMenu = Menu.buildFromTemplate([
{
label: "帮助文档", click: () => {
......
......@@ -44,7 +44,7 @@
:src="selected.icon"
/>
<div v-else class="rubick-logo">
<img src="./assets/logo.png" />
<img src="./assets/imgs/logo.png" />
</div>
</div>
</a-input>
......@@ -362,13 +362,13 @@ export default {
.rubick-logo {
width: 40px;
height: 40px;
background: #314659;
background: #574778;
display: flex;
align-items: center;
justify-content: center;
border-radius: 100%;
img {
width: 28px;
width: 32px;
}
}
.tag-container {
......
@import '~ant-design-vue/dist/antd.less'; // 引入官方提供的 less 样式入口文件
@primary-color: #ff4ea4; // 全局主色
@link-color: #ff4ea4; // 链接色
@error-color: #ff4ea4; // 错误色
.ant-tag-green {
color: #ff4ea4;
background: rgba(255, 159, 180, 0.3);
border-color: #ff9fb4;
}
......@@ -7,7 +7,7 @@ import router from './router'
import store from './store'
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
import './assets/ant-reset.less';
const opConfig = remote.getGlobal('opConfig');
......
......@@ -13,7 +13,7 @@
<a-icon type="right-circle" />
</div>
<div v-for="banner in bannerList">
<img width="100%" :src="banner.src" />
<img @click="jumpTo(banner.link)" width="100%" :src="banner.src" />
</div>
</a-carousel>
<a-divider v-if="bannerList && !!bannerList.length"></a-divider>
......@@ -73,6 +73,7 @@
import api from '../../../assets/api';
import {mapActions, mapState} from 'vuex';
import marked from "marked";
import {shell} from "electron";
const rendererMD = new marked.Renderer();
export default {
......@@ -114,6 +115,11 @@ export default {
this.currentSelect = item;
this.currentSelect.index = index;
},
jumpTo(link) {
if (link) {
shell.openExternal(link)
}
},
...mapActions('main', ['downloadPlugin'])
},
computed: {
......
static/rocket.png

873 字节 | W: | H:

static/rocket.png

1.4 KB | W: | H:

static/rocket.png
static/rocket.png
static/rocket.png
static/rocket.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册