diff --git a/public/groups.json b/public/groups.json index 45c417c6d..b97bb9614 100644 --- a/public/groups.json +++ b/public/groups.json @@ -1215,6 +1215,9 @@ "name": "OS Functionality", "id": "os-functionality", "files": [ + { + "path": "json/mwit-taskbar-number-launch-app.json" + }, { "path": "json/F4-desktop.json" }, diff --git a/public/json/mwit-taskbar-number-launch-app.json b/public/json/mwit-taskbar-number-launch-app.json new file mode 100644 index 000000000..c074af7c7 --- /dev/null +++ b/public/json/mwit-taskbar-number-launch-app.json @@ -0,0 +1,180 @@ +{ + "title": "Launch MacOS apps, like on windows + number", + "rules": [ + { + "description": "Launch apps by (left) option + number.", + "manipulators": [ + { + "type": "basic", + "from": { + "key_code": "q", + "modifiers": { + "mandatory": [ + "left_gui" + ] + } + }, + "to": [ + { + "shell_command": "open -a 'Safari.app'" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "w", + "modifiers": { + "mandatory": [ + "left_gui" + ] + } + }, + "to": [ + { + "shell_command": "open -a 'Visual Studio Code.app'" + } + ], + "conditions": [ + { + "type": "frontmost_application_unless", + "bundle_identifiers": [ + "^com\\.apple\\.Terminal$", + "^com\\.brave\\.Browser$", + "^com\\.microsoft\\.VSCode$" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "w", + "modifiers": { + "mandatory": [ + "left_alt" + ] + } + }, + "to": [ + { + "shell_command": "open -a 'Firefox.app'" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "q", + "modifiers": { + "mandatory": [ + "left_alt" + ] + } + }, + "to": [ + { + "shell_command": "open -a 'Safari.app'" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "1", + "modifiers": { + "mandatory": [ + "left_alt" + ] + } + }, + "to": [ + { + "shell_command": "open -a 'Brave Browser.app'" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "2", + "modifiers": { + "mandatory": [ + "left_alt" + ] + } + }, + "to": [ + { + "shell_command": "open -a 'Visual Studio Code.app'" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "3", + "modifiers": { + "mandatory": [ + "left_alt" + ] + } + }, + "to": [ + { + "shell_command": "open -a 'Terminal.app'" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "4", + "modifiers": { + "mandatory": [ + "left_alt" + ] + } + }, + "to": [ + { + "shell_command": "open -a 'Discord.app'" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "5", + "modifiers": { + "mandatory": [ + "left_alt" + ] + } + }, + "to": [ + { + "shell_command": "open -a 'Safari.app'" + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "6", + "modifiers": { + "mandatory": [ + "left_alt" + ] + } + }, + "to": [ + { + "shell_command": "open -a 'Discord.app'" + } + ] + } + ] + } + ] +} diff --git a/src/json/mwit-taskbar-number-launch-app.json.js b/src/json/mwit-taskbar-number-launch-app.json.js new file mode 100644 index 000000000..4bd7338ad --- /dev/null +++ b/src/json/mwit-taskbar-number-launch-app.json.js @@ -0,0 +1,168 @@ +// JavaScript should be written in ECMAScript 5.1. + +function main() { + console.log( + JSON.stringify( + { + title: 'Launch MacOS apps, like on windows + number', + rules: [ + { + description: 'Launch apps by (left) option + number.', + manipulators: [ + { + type: 'basic', + from: { + key_code: 'q', + modifiers: { + mandatory: ['left_gui'], + }, + }, + to: [ + { + shell_command: "open -a 'Safari.app'", + }, + ], + }, + { + type: 'basic', + from: { + key_code: 'w', + modifiers: { + mandatory: ['left_gui'], + }, + }, + to: [ + { + shell_command: "open -a 'Visual Studio Code.app'", + }, + ], + conditions: [ + { + type: 'frontmost_application_unless', + bundle_identifiers: ['^com\\.apple\\.Terminal$', '^com\\.brave\\.Browser$', '^com\\.microsoft\\.VSCode$'], + }, + ], + }, + { + type: 'basic', + from: { + key_code: 'w', + modifiers: { + mandatory: ['left_alt'], + }, + }, + to: [ + { + shell_command: "open -a 'Firefox.app'", + }, + ], + }, + { + type: 'basic', + from: { + key_code: 'q', + modifiers: { + mandatory: ['left_alt'], + }, + }, + to: [ + { + shell_command: "open -a 'Safari.app'", + }, + ], + }, + { + type: 'basic', + from: { + key_code: '1', + modifiers: { + mandatory: ['left_alt'], + }, + }, + to: [ + { + shell_command: "open -a 'Brave Browser.app'", + }, + ], + }, + { + type: 'basic', + from: { + key_code: '2', + modifiers: { + mandatory: ['left_alt'], + }, + }, + to: [ + { + shell_command: "open -a 'Visual Studio Code.app'", + }, + ], + }, + { + type: 'basic', + from: { + key_code: '3', + modifiers: { + mandatory: ['left_alt'], + }, + }, + to: [ + { + shell_command: "open -a 'Terminal.app'", + }, + ], + }, + { + type: 'basic', + from: { + key_code: '4', + modifiers: { + mandatory: ['left_alt'], + }, + }, + to: [ + { + shell_command: "open -a 'Discord.app'", + }, + ], + }, + { + type: 'basic', + from: { + key_code: '5', + modifiers: { + mandatory: ['left_alt'], + }, + }, + to: [ + { + shell_command: "open -a 'Safari.app'", + }, + ], + }, + { + type: 'basic', + from: { + key_code: '6', + modifiers: { + mandatory: ['left_alt'], + }, + }, + to: [ + { + shell_command: "open -a 'Discord.app'", + }, + ], + }, + ], + }, + ], + }, + null, + ' ' + ) + ) +} + +main()