added License, updated readme with readme of original project for later revision

This commit is contained in:
yuriy 2023-08-19 22:15:28 -04:00
parent 1d4ee1549e
commit 9e1b93af75
2 changed files with 108 additions and 1 deletions

21
LICENSE.txt Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Asger Juul Brunshøj
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -19,3 +19,89 @@ Activate the launcher with `Control + E` hotkey
# Settings
WIP
# Old Description:
### What it is
This is a small GUI that allows you to run any normal AutoHotkey command or block of code by typing a name for the command you want to run. I wrote this script because I was creating more and more hotkeys for various things, but I ran out of keys on my keyboard to assign hotkeys to. It is designed to be as minimal as possible.
![Screenshot](/img/ahk_launcher.png "Screenshot of the GUI")
### How to use it
Run the `Host.ahk` file.
This entire script is build around the `CapsLock` key.
The GUI is activated by `CapsLock`+`Space`.
Normal `CapsLock` functionality is preserved, and can be toggled by `Alt`+`CapsLock`.
When typing something in the GUI, whatever you type is matched up against the commands in `UserCommands.ahk`. These are normal AutoHotkey commands so you can and should write your own. I have supplied some sample commands to show some ideas. But it only becomes truly powerful once you customize it with commands to suit your specific needs.
##### Trying it out yourself
1. Make sure `Host.ahk` is running.
* Open the GUI with `CapsLock`+`Space`.
* Type `face` into the GUI to open facebook.com.
* Open the GUI again. Type `note` into the GUI to open Notepad.
* While in Notepad, type `@` into the GUI. It will write your e-mail address (but you need to go into `UserCommands.ahk` later to specify your own address).
* Try typing `down` into the GUI to open your Downloads folder or `rec` to open the Recycle Bin.
* You can search google by typing `g` followed by a space. A new input field should appear. Type your search query and press enter. Use `l ` if you are 'Feeling Lucky'.
* You can search Youtube with `y `, search Facebook with `f ` or the torrent networks with `t `.
* If you like Reddit, you can visit a specific subreddit by typing `/` into the GUI and then the name of the subreddit you have in mind.
* Try `week` or `date`. (I can never remember the week number so this is useful when on the phone with somebody who insists on comparing calendars going by week number).
* Type `ping` into the GUI to quickly ping www.google.com to see if your internet connection works.
There are some additional example commands included. Try typing simply `?`, and you should see a tooltip with all defined commands and a description of what they do. You may also explore all the sample commands in detail by looking in `UserCommands.ahk`. Now it is time for you to start filling in your own personalized commands.
My own personal `UserCommands.ahk` file is huge, but it is tailored to the things I do everyday and would not be much use for anybody else.
##### How to write your own commands
The variable `Pedersen` contains your text from the input field.
The first thing to do is often to hide the GUI and reset the input field. Do this by calling `gui_destroy()`.
After that, you can run any normal AHK block of code. If for example you have some program you use all the time, you can create a shortcut to that program by
else if Pedersen = prog
{
gui_destroy()
run "C:\Program Files\Company\That awesome program.exe"
}
That's it! now you can launch your favourite program by typing `prog` into the input field.
There is a function, `gui_search(url)`, defined in this script that you can call if you want to search some specific website. So for example if you translate from English to Korean using Google Translate all the time, and you want a shortcut for that, then the way to go about it is the following:
1. Go to Google Translate.
* Translate something. For example try translating `Winged turtle`.
* Google Translate tells you that a winged turtle would be 날개 달린 거북이 in Korean. But the URL is the interesting part. The URL is `https://translate.google.com/#en/ko/winged%20turtle`.
* Replace your query with the word `REPLACEME`. Like this: `https://translate.google.com/#en/ko/REPLACEME`.
* Then the code could be:
else if Pedersen = kor ; Translate English to Korean
{
gui_search_title = English to Korean
gui_search("https://translate.google.com/#en/ko/REPLACEME")
}
Now we can translate from English to Korean in a heartbeat.
### How it works
Disclaimer: Initially, this was not really written to be shared or used by others, so it is not properly documented and some of the variable names are not self-explanatory and some are in danish. I'm sorry about that. However if you don't go digging too deep, you should not get in trouble. The `UserCommands.ahk` file should be easy to edit.
Here are some quick tips about the script and how it works:
##### Function `gui_destroy()`
Hides and resets the GUI window.
##### Function `gui_search(url)`
`gui_search(url)` was made to search websites like Google and Reddit and so on. It will make a new text input field in the GUI where you can type your search query.
Then it will look at the supplied URL and find 'REPLACEME' and replace it
with your search query.
Example:
else if Pedersen = y%A_Space% ; Search Youtube
{
gui_search_title = Youtube
gui_search("https://www.youtube.com/results?search_query=REPLACEME")
}