mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-09-24 04:53:31 +08:00
新增MacOS专区分类,新增应用管理功能,支持获取前台应用、获取活动应用、启动、退出、隐藏、显示应用、最大化、最小化、获取窗口信息、获取应用脚本字典
This commit is contained in:
@@ -39,7 +39,7 @@ export default defineComponent({
|
||||
},
|
||||
props: {
|
||||
config: {
|
||||
type: Array,
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
modelValue: {
|
||||
|
@@ -16,6 +16,7 @@ import { audioCommands } from "./audioCommands";
|
||||
import { imageCommands } from "./imageCommands";
|
||||
import { windowsCommands } from "./windowsCommands";
|
||||
import { statusCommands } from "./statusCommands";
|
||||
import { macosCommands } from "./macosCommands";
|
||||
|
||||
let commands = [
|
||||
fileCommands,
|
||||
@@ -40,6 +41,10 @@ if (window.utools.isWindows()) {
|
||||
commands.push(windowsCommands);
|
||||
}
|
||||
|
||||
if (window.utools.isMacOS()) {
|
||||
commands.push(macosCommands);
|
||||
}
|
||||
|
||||
commands.push(otherCommands);
|
||||
|
||||
export const commandCategories = commands;
|
||||
|
445
src/js/composer/commands/macosCommands.js
Normal file
445
src/js/composer/commands/macosCommands.js
Normal file
@@ -0,0 +1,445 @@
|
||||
export const macosCommands = {
|
||||
label: "MacOS专区",
|
||||
icon: "laptop_mac",
|
||||
defaultOpened: false,
|
||||
commands: [
|
||||
{
|
||||
value: "quickcomposer.macos.app.getFrontmost",
|
||||
label: "应用管理",
|
||||
desc: "应用程序管理功能",
|
||||
icon: "apps",
|
||||
isAsync: true,
|
||||
subCommands: [
|
||||
{
|
||||
value: "quickcomposer.macos.app.getFrontmost",
|
||||
label: "获取前台应用",
|
||||
desc: "获取当前前台运行的应用信息",
|
||||
icon: "front_hand",
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.app.getRunningApps",
|
||||
label: "获取活动应用",
|
||||
desc: "获取所有正在运行的应用列表",
|
||||
icon: "list",
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.app.launch",
|
||||
label: "启动应用",
|
||||
desc: "启动指定的应用程序",
|
||||
icon: "launch",
|
||||
config: [
|
||||
{
|
||||
key: "appName",
|
||||
label: "应用名称",
|
||||
component: "VariableInput",
|
||||
icon: "apps",
|
||||
width: 12,
|
||||
placeholder: "输入应用名称",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.app.quit",
|
||||
label: "退出应用",
|
||||
desc: "退出指定的应用程序",
|
||||
icon: "close",
|
||||
config: [
|
||||
{
|
||||
key: "appName",
|
||||
label: "应用名称",
|
||||
component: "VariableInput",
|
||||
icon: "apps",
|
||||
width: 12,
|
||||
placeholder: "输入应用名称",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.app.hide",
|
||||
label: "隐藏应用",
|
||||
desc: "隐藏指定的应用程序",
|
||||
icon: "visibility_off",
|
||||
config: [
|
||||
{
|
||||
key: "appName",
|
||||
label: "应用名称",
|
||||
component: "VariableInput",
|
||||
icon: "apps",
|
||||
width: 12,
|
||||
placeholder: "输入应用名称",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.app.show",
|
||||
label: "显示应用",
|
||||
desc: "显示指定的应用程序",
|
||||
icon: "visibility",
|
||||
config: [
|
||||
{
|
||||
key: "appName",
|
||||
label: "应用名称",
|
||||
component: "VariableInput",
|
||||
icon: "apps",
|
||||
width: 12,
|
||||
placeholder: "输入应用名称",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.app.minimize",
|
||||
label: "最小化窗口",
|
||||
desc: "最小化指定应用的窗口",
|
||||
icon: "minimize",
|
||||
config: [
|
||||
{
|
||||
key: "appName",
|
||||
label: "应用名称",
|
||||
component: "VariableInput",
|
||||
icon: "apps",
|
||||
width: 12,
|
||||
placeholder: "输入应用名称",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.app.maximize",
|
||||
label: "最大化窗口",
|
||||
desc: "最大化指定应用的窗口",
|
||||
icon: "maximize",
|
||||
config: [
|
||||
{
|
||||
key: "appName",
|
||||
label: "应用名称",
|
||||
component: "VariableInput",
|
||||
icon: "apps",
|
||||
width: 12,
|
||||
placeholder: "输入应用名称",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.app.getWindows",
|
||||
label: "获取窗口信息",
|
||||
desc: "获取指定应用的所有窗口信息",
|
||||
icon: "window",
|
||||
config: [
|
||||
{
|
||||
key: "appName",
|
||||
label: "应用名称",
|
||||
component: "VariableInput",
|
||||
icon: "apps",
|
||||
width: 12,
|
||||
placeholder: "输入应用名称",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.app.getScriptDictionary",
|
||||
label: "获取应用脚本字典",
|
||||
desc: "获取应用程序的AppleScript字典内容",
|
||||
icon: "code",
|
||||
config: [
|
||||
{
|
||||
key: "appName",
|
||||
label: "应用名称",
|
||||
component: "VariableInput",
|
||||
icon: "apps",
|
||||
width: 12,
|
||||
placeholder: "输入应用名称",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.system",
|
||||
label: "系统管理",
|
||||
desc: "系统级别的控制功能",
|
||||
icon: "settings",
|
||||
isAsync: true,
|
||||
subCommands: [
|
||||
{
|
||||
value: "quickcomposer.macos.system.controlCenter",
|
||||
label: "控制中心",
|
||||
desc: "打开或关闭控制中心",
|
||||
icon: "toggle_on",
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.system.notificationCenter",
|
||||
label: "通知中心",
|
||||
desc: "打开或关闭通知中心",
|
||||
icon: "notifications",
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.system.setVolume",
|
||||
label: "系统音量",
|
||||
desc: "调整系统音量",
|
||||
icon: "volume_up",
|
||||
config: [
|
||||
{
|
||||
key: "volume",
|
||||
label: "音量",
|
||||
component: "NumberInput",
|
||||
icon: "volume_up",
|
||||
min: 0,
|
||||
max: 100,
|
||||
defaultValue: 50,
|
||||
width: 12,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.system.setBrightness",
|
||||
label: "屏幕亮度",
|
||||
desc: "调整屏幕亮度",
|
||||
icon: "brightness_medium",
|
||||
config: [
|
||||
{
|
||||
key: "brightness",
|
||||
label: "亮度",
|
||||
component: "NumberInput",
|
||||
icon: "brightness_medium",
|
||||
min: 0,
|
||||
max: 100,
|
||||
defaultValue: 50,
|
||||
width: 12,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.system.lockScreen",
|
||||
label: "锁定屏幕",
|
||||
desc: "锁定系统屏幕",
|
||||
icon: "lock",
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.system.sleep",
|
||||
label: "进入睡眠",
|
||||
desc: "使系统进入睡眠状态",
|
||||
icon: "bedtime",
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.system.setDockPosition",
|
||||
label: "Dock位置",
|
||||
desc: "设置Dock栏位置",
|
||||
icon: "swap_horiz",
|
||||
config: [
|
||||
{
|
||||
key: "position",
|
||||
label: "位置",
|
||||
component: "ButtonGroup",
|
||||
width: 12,
|
||||
options: [
|
||||
{ label: "底部", value: "bottom" },
|
||||
{ label: "左侧", value: "left" },
|
||||
{ label: "右侧", value: "right" },
|
||||
],
|
||||
defaultValue: "bottom",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.system.setDockSize",
|
||||
label: "Dock大小",
|
||||
desc: "设置Dock栏大小",
|
||||
icon: "aspect_ratio",
|
||||
config: [
|
||||
{
|
||||
key: "size",
|
||||
label: "大小",
|
||||
component: "NumberInput",
|
||||
min: 16,
|
||||
max: 128,
|
||||
defaultValue: 48,
|
||||
width: 12,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.system.toggleDockAutohide",
|
||||
label: "Dock自动隐藏",
|
||||
desc: "设置Dock栏自动隐藏",
|
||||
icon: "visibility_off",
|
||||
config: [
|
||||
{
|
||||
key: "enabled",
|
||||
label: "启用",
|
||||
component: "CheckButton",
|
||||
width: 12,
|
||||
defaultValue: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.system.toggleMenuBarAutohide",
|
||||
label: "菜单栏自动隐藏",
|
||||
desc: "设置菜单栏自动隐藏",
|
||||
icon: "visibility_off",
|
||||
config: [
|
||||
{
|
||||
key: "enabled",
|
||||
label: "启用",
|
||||
component: "CheckButton",
|
||||
width: 12,
|
||||
defaultValue: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.system.setClockFormat",
|
||||
label: "时钟格式",
|
||||
desc: "设置菜单栏时钟显示格式",
|
||||
icon: "schedule",
|
||||
config: [
|
||||
{
|
||||
key: "format",
|
||||
label: "格式",
|
||||
component: "TextInput",
|
||||
width: 12,
|
||||
placeholder: "EEE MMM d H:mm:ss",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.system.toggleDarkMode",
|
||||
label: "深色模式",
|
||||
desc: "切换系统深色模式",
|
||||
icon: "dark_mode",
|
||||
config: [
|
||||
{
|
||||
key: "enabled",
|
||||
label: "启用",
|
||||
component: "CheckButton",
|
||||
width: 12,
|
||||
defaultValue: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.finder",
|
||||
label: "访达管理",
|
||||
desc: "访达操作和文件管理功能",
|
||||
icon: "folder",
|
||||
isAsync: true,
|
||||
subCommands: [
|
||||
{
|
||||
value: "quickcomposer.macos.finder.getSelection",
|
||||
label: "获取选中项",
|
||||
desc: "获取访达中当前选中的项目",
|
||||
icon: "select_all",
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.finder.getCurrentFolder",
|
||||
label: "获取当前文件夹",
|
||||
desc: "获取访达当前打开的文件夹路径",
|
||||
icon: "folder_open",
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.finder.newFolder",
|
||||
label: "新建文件夹",
|
||||
desc: "在当前位置创建新文件夹",
|
||||
icon: "create_new_folder",
|
||||
config: [
|
||||
{
|
||||
key: "name",
|
||||
label: "文件夹名称",
|
||||
component: "TextInput",
|
||||
width: 12,
|
||||
placeholder: "新建文件夹",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.finder.moveToTrash",
|
||||
label: "移到废纸篓",
|
||||
desc: "将选中项目移动到废纸篓",
|
||||
icon: "delete",
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.finder.emptyTrash",
|
||||
label: "清空废纸篓",
|
||||
desc: "清空废纸篓",
|
||||
icon: "delete_forever",
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.finder.showPackageContents",
|
||||
label: "显示包内容",
|
||||
desc: "显示应用程序包内容",
|
||||
icon: "folder_zip",
|
||||
config: [
|
||||
{
|
||||
key: "path",
|
||||
label: "应用路径",
|
||||
component: "FilePicker",
|
||||
width: 12,
|
||||
placeholder: "选择应用程序",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.finder.setShowHiddenFiles",
|
||||
label: "显示隐藏文件",
|
||||
desc: "设置是否显示隐藏文件",
|
||||
icon: "visibility",
|
||||
config: [
|
||||
{
|
||||
key: "show",
|
||||
label: "显示",
|
||||
component: "CheckButton",
|
||||
width: 12,
|
||||
defaultValue: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.finder.setShowPathbar",
|
||||
label: "显示路径栏",
|
||||
desc: "设置是否显示路径栏",
|
||||
icon: "wrap_text",
|
||||
config: [
|
||||
{
|
||||
key: "show",
|
||||
label: "显示",
|
||||
component: "CheckButton",
|
||||
width: 12,
|
||||
defaultValue: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.finder.setShowStatusBar",
|
||||
label: "显示状态栏",
|
||||
desc: "设置是否显示状态栏",
|
||||
icon: "info",
|
||||
config: [
|
||||
{
|
||||
key: "show",
|
||||
label: "显示",
|
||||
component: "CheckButton",
|
||||
width: 12,
|
||||
defaultValue: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.macos.finder.setShowPreviewPane",
|
||||
label: "显示预览面板",
|
||||
desc: "设置是否显示预览面板",
|
||||
icon: "preview",
|
||||
config: [
|
||||
{
|
||||
key: "show",
|
||||
label: "显示",
|
||||
component: "CheckButton",
|
||||
width: 12,
|
||||
defaultValue: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
@@ -67,7 +67,7 @@ const RECT_DICT_EDITOR = {
|
||||
|
||||
export const screenCommands = {
|
||||
label: "显示器",
|
||||
icon: "screenshot_monitor",
|
||||
icon: "display_settings",
|
||||
commands: [
|
||||
{
|
||||
value: "utools.getPrimaryDisplay",
|
||||
|
@@ -2,7 +2,7 @@ import { newVarInputVal } from "js/composer/varInputValManager";
|
||||
|
||||
export const systemCommands = {
|
||||
label: "系统操作",
|
||||
icon: "computer",
|
||||
icon: "settings_suggest",
|
||||
defaultOpened: false,
|
||||
commands: [
|
||||
{
|
||||
|
@@ -1,7 +1,5 @@
|
||||
import { newVarInputVal } from "js/composer/varInputValManager";
|
||||
|
||||
export const windowsCommands = {
|
||||
label: "Windows工具",
|
||||
label: "Windows专区",
|
||||
icon: "window",
|
||||
defaultOpened: false,
|
||||
commands: [
|
||||
|
Reference in New Issue
Block a user