App architecture modifications.
Now GUI and the app itself is divided into two different binaries. The app also provides system tray icon. Whereas the GUI can be used to configure the app.
This commit is contained in:
parent
d4fcb0ea9c
commit
4f3d572b26
232 changed files with 5059 additions and 8081 deletions
19
app/commands/browser/ahk/Close browser.ahk
Normal file
19
app/commands/browser/ahk/Close browser.ahk
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
; Rerun as admin, if required
|
||||
If Not A_IsAdmin
|
||||
{
|
||||
Run *RunAs "%A_ScriptFullPath%"
|
||||
ExitApp
|
||||
}
|
||||
|
||||
; set partial title matching mode
|
||||
SetTitleMatchMode, 2
|
||||
|
||||
; list of all browsers to close
|
||||
GroupAdd, browsers, ahk_class MozillaWindowClass
|
||||
GroupAdd, browsers, ahk_class IEFrame
|
||||
GroupAdd, browsers, ahk_exe msedge.exe
|
||||
GroupAdd, browsers, ahk_exe chrome.exe
|
||||
GroupAdd, browsers, ahk_exe firefox.exe
|
||||
|
||||
; kill them all
|
||||
Winclose, ahk_group browsers
|
||||
BIN
app/commands/browser/ahk/Close browser.exe
Normal file
BIN
app/commands/browser/ahk/Close browser.exe
Normal file
Binary file not shown.
11
app/commands/browser/ahk/Run browser.ahk
Normal file
11
app/commands/browser/ahk/Run browser.ahk
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
|
||||
; #Warn ; Enable warnings to assist with detecting common errors.
|
||||
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
|
||||
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
|
||||
|
||||
RegRead, BrowserKeyName, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice, Progid
|
||||
RegRead, BrowserFullCommand, HKEY_CLASSES_ROOT, %BrowserKeyName%\shell\open\command
|
||||
StringGetPos, pos, BrowserFullCommand, ",,1
|
||||
pos := --pos
|
||||
StringMid, BrowserPathandEXE, BrowserFullCommand, 2, %pos%
|
||||
Run, % BrowserPathandEXE
|
||||
BIN
app/commands/browser/ahk/Run browser.exe
Normal file
BIN
app/commands/browser/ahk/Run browser.exe
Normal file
Binary file not shown.
11
app/commands/browser/ahk/Run website.ahk
Normal file
11
app/commands/browser/ahk/Run website.ahk
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
|
||||
; #Warn ; Enable warnings to assist with detecting common errors.
|
||||
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
|
||||
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
|
||||
|
||||
#Include _include.ahk
|
||||
|
||||
args = %1%
|
||||
path := DefaultBrowser()
|
||||
|
||||
Run, %path% %args%
|
||||
BIN
app/commands/browser/ahk/Run website.exe
Normal file
BIN
app/commands/browser/ahk/Run website.exe
Normal file
Binary file not shown.
19
app/commands/browser/ahk/_include.ahk
Normal file
19
app/commands/browser/ahk/_include.ahk
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
DefaultBrowser() {
|
||||
; Find the Registry key name for the default browser
|
||||
RegRead, BrowserKeyName, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice, Progid
|
||||
|
||||
; Find the executable command associated with the above Registry key
|
||||
RegRead, BrowserFullCommand, HKEY_CLASSES_ROOT, %BrowserKeyName%\shell\open\command
|
||||
|
||||
; The above RegRead will return the path and executable name of the brower contained within quotes and optional parameters
|
||||
; We only want the text contained inside the first set of quotes which is the path and executable
|
||||
; Find the ending quote position (we know the beginning quote is in position 0 so start searching at position 1)
|
||||
StringGetPos, pos, BrowserFullCommand, ",,1
|
||||
|
||||
; Decrement the found position by one to work correctly with the StringMid function
|
||||
pos := --pos
|
||||
|
||||
; Extract and return the path and executable of the browser
|
||||
StringMid, BrowserPathandEXE, BrowserFullCommand, 2, %pos%
|
||||
Return BrowserPathandEXE
|
||||
}
|
||||
76
app/commands/browser/command.yaml
Normal file
76
app/commands/browser/command.yaml
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
list:
|
||||
- command:
|
||||
action: ahk
|
||||
exe_path: ahk/Run browser.exe
|
||||
voice:
|
||||
sounds:
|
||||
- ok1
|
||||
- ok2
|
||||
- ok3
|
||||
phrases:
|
||||
- открой браузер
|
||||
- открой хром
|
||||
- гугл хром
|
||||
|
||||
- command:
|
||||
action: ahk
|
||||
exe_path: ahk/Close browser.exe
|
||||
voice:
|
||||
sounds:
|
||||
- ok1
|
||||
- ok2
|
||||
- ok3
|
||||
- ok4
|
||||
phrases:
|
||||
- закрой все браузеры
|
||||
- закрой браузер
|
||||
- выключи браузер
|
||||
- убери браузер
|
||||
|
||||
- command:
|
||||
action: ahk
|
||||
exe_path: ahk/Run website.exe
|
||||
exe_args:
|
||||
- http://google.com
|
||||
voice:
|
||||
sounds:
|
||||
- ok1
|
||||
- ok2
|
||||
- ok3
|
||||
- ok4
|
||||
phrases:
|
||||
- открой гугл
|
||||
- запусти гугл
|
||||
- перейди в гугл
|
||||
|
||||
- command:
|
||||
action: ahk
|
||||
exe_path: ahk/Run website.exe
|
||||
exe_args:
|
||||
- http://youtube.com
|
||||
voice:
|
||||
sounds:
|
||||
- ok1
|
||||
- ok2
|
||||
- ok3
|
||||
- ok4
|
||||
phrases:
|
||||
- открой ютуб
|
||||
- ютуб
|
||||
- запусти ютуб
|
||||
|
||||
- command:
|
||||
action: ahk
|
||||
exe_path: ahk/Run website.exe
|
||||
exe_args:
|
||||
- https://translate.google.com
|
||||
voice:
|
||||
sounds:
|
||||
- ok1
|
||||
- ok2
|
||||
- ok3
|
||||
- ok4
|
||||
phrases:
|
||||
- открой переводчик
|
||||
- переводчик
|
||||
- запусти переводчик
|
||||
Loading…
Add table
Add a link
Reference in a new issue