mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-13 23:06:57 +08:00
ref: 支持win搜索快捷启动
This commit is contained in:
parent
04e674d1cd
commit
bdae8c280b
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rubick",
|
||||
"version": "2.0.1-beta.14",
|
||||
"version": "2.0.1-beta.15",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
|
@ -6,8 +6,14 @@ import { shell } from "electron";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const fileIcon = require("extract-file-icon");
|
||||
|
||||
const filePath = path.resolve("C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs");
|
||||
|
||||
|
||||
const appData = path.join(os.homedir(), "./AppData/Roaming");
|
||||
|
||||
const startMenu = path.join(appData, "Microsoft\\Windows\\Start Menu\\Programs");
|
||||
|
||||
const fileLists: any = [];
|
||||
const isZhRegex = /[\u4e00-\u9fa5]/;
|
||||
|
||||
@ -58,7 +64,10 @@ function fileDisplay(filePath) {
|
||||
} catch(e) {
|
||||
//
|
||||
}
|
||||
if (!appDetail.target || appDetail.target.toLowerCase().indexOf("unin") >= 0) return;
|
||||
if (!appDetail.target || appDetail.target.toLowerCase().indexOf("unin") >= 0 || appDetail.args) return;
|
||||
|
||||
// C:/program/cmd.exe => cmd
|
||||
keyWords.push(path.basename(appDetail.target, ".exe"));
|
||||
|
||||
if (isZhRegex.test(appName)) {
|
||||
const py = translate(appName);
|
||||
@ -101,5 +110,6 @@ function fileDisplay(filePath) {
|
||||
|
||||
export default () => {
|
||||
fileDisplay(filePath);
|
||||
fileDisplay(startMenu);
|
||||
return fileLists;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user