A plugin for managing links (or 'shortcuts'). Will open anything in default program. That is, any protocol URL (local filepath, directory path, external URL, etc).
#list
lists currently available links (if any)#add google http://www.google.com/
adds#google
as a link#add cc C:\Program Files\CCleaner\CCleaner64.exe
adds#cc
as a link#google
launcheshttp://www.google.com/
in the default browser#cc
launches CCleaner#remove google
removes#google
link
Type this command in the Hain input:
/hpm install hain-plugin-link
Command | Arguments | Result |
---|---|---|
# |
[link] | launch the [target] that [link] points at |
#add |
[link] [target] | link [link] to [target] (persistent) |
#remove |
[link] | remove [link] (warning: no confirmation) |
#list |
list all current links |
Links must be a single word (no spaces) and must not already exist. Built-in commands (add, remove, list) are reserved and cannot be used. Filepaths to executables can be with either forward or backward slashes, or even spaces.
- Add icons depicting the types of links.
- Allow shortcuts to be given arguments (eg. a query)
- Check if the given target is valid(?)
- Option to override 'link already exists'
- Option to conform removal
Linking #vpn
to the shortcut Cisco AnyConnect Secure Mobility Client
would be possible by rightclicking your cisco shortcut (not through Hain), copying the target out of the properties of the shortcut and then: #add vpn "C:\Whatever\The\Path\To\Your\File\Is.exe"
resulting in a persistent command (stored in Hain's localstorage): #vpn
To remove it again you'd use #remove vpn
More examples: #add google www.google.com
results in #google
opening google in your default browser #add cmd cmd
results in #cmd
opening a command prompt (in the hain directory, though)
If this will currently suffice as a solution (even if it won't, to be honest), I'll share the code soon.
-
I have only tested this on Windows
-
Paths will not be checked to see if they exist
-
Apart from URLs and file paths, this also works for single commands recognized by the commandline, but I have yet to figure out if parameters can be passed
-
You can pass parameters by manually creating a shortcut, though this is far from nice:
#add test file:///C:\some-shortcut.lnk
withsome-shortcut.lnk
having the targetping google.com
will result in#test
pinging google indefinitely
-
-
You can use file paths to non-executables (and they will be opened in a default application)
- Example:
#add test file:///C:\Users\Public\Desktop\test.txt
will make#test
open the textfile with your default text editor
- Example:
The above two examples use the file:/// protocol. the three slashes are all necessary
Plugin by Lawgsy ([email protected]).