Page not found :(
The page you are looking for doesn't exist or has been moved.
diff --git a/content/docs/kbdemu/_index.md b/content/docs/kbdemu/_index.md index 3de452a..93a4647 100644 --- a/content/docs/kbdemu/_index.md +++ b/content/docs/kbdemu/_index.md @@ -1,6 +1,6 @@ --- title: "KbdEmu Docs" -draft: true +draft: false description: "Documentation for KbdEmu, the HID emulator" menu: docs: diff --git a/content/docs/kbdemu/usage.md b/content/docs/kbdemu/usage.md index 993d4c6..36c76a4 100644 --- a/content/docs/kbdemu/usage.md +++ b/content/docs/kbdemu/usage.md @@ -6,64 +6,276 @@ description: "Using kbdemu" {{< appveyor-ci project="kbdemu" projectID="km2f1wiy7enuh6il" >}} {{< minio-s3 project="kbdemu" >}} -This page assumes you have already installed KbdEmu. If not, follow the installation -instructions on the installation page. +This page assumes you have already installed KbdEmu. If not, follow the installation instructions on the installation page: -{{< button text="Installation" link="../installation" color="blue">}} +{{< button text="Installation" bgcolor="#357edd" fgcolor="white" link="../installation" >}} -### Configs +## Scripts -KbdEmu uses TOML configs to tell it what to do. This is the example config which -contains all supported features: +KbdEmu uses [scpt](https://gitea.arsenm.dev/Arsen6331/scpt) as its scripting language. The example script for kbdemu looks like this: -```toml -[[action]] -type = "var" -action = "set key to z" - - [[action]] -type = "kbd" -action = "hold key @key@" - - [[action]] -type = "misc" -action = "wait 1 second" - - [[action]] -type = "kbd" -action = "release key @key@" - - [[action]] -type = "kbd" -action = "press space" - - [[action]] -type = "kbd" -action = "type AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz" - - [[action]] -type = "mse" -action = "scroll up 5" - - [[action]] -type = "mse" -action= "right click" - - [[action]] -type = "mse" -action = "move to {0,0}" - - [[action]] -type = "misc" -action = "show message Actions complete!" +``` +set testKey to "x" +keystroke $testKey with action "hold" +sleep "1s" +keystroke $testKey with action "release" +type "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz" +scroll 5 with direction "up" +click "right" +move-mouse [0, 0] +send-notification "Test" +beep +open-location "https://www.arsenm.dev/" +set showDetails to (display-dialog "Show details?" with type "yesno") +if $showDetails { + display-dialog {"Color: " + (pixel-color [100, 100]) + ", Mouse: " + (str (mouse-position))} with title "Details" +} +print {"\n" + (user-choice "test" with items ["Hello", "World", 3.1415926535, $GOOS, $GOARCH, true, false, (numcpu)])} +log "Complete!" ``` -As you can see, the configs are pretty simple. Here is a list of all the currently -supported features: -{{
The page you are looking for doesn't exist or has been moved.
The page you are looking for doesn't exist or has been moved.
AdvMake +
AdvMake uses Starlark as the format for its build files. Modules are also defined for both convenience and extra functionality.
Starlark is a Python-like language meant for configuration files.
Build files are by default called AdvMakefile
, but that can be set via -f
An AdvMakefile example can be found at AdvMake’s repo as it uses AdvMake itself.
AdvMake runs functions exposed by starlark in the format <name>_<target>
.
To set the default name and target, the global variables defaultName
, and defaultTarget
must be set.
@@ -76,4 +76,5 @@ Godoc
shell.Setenv()
log
The log module contains functions to log events at various levels
The available levels are:
Info
Debug
Warn
Fatal
log.<Level>()
Definition: log.<Level>(message)
Logs a message at the specified level. The fatal level quits after logging the message.
Examples:
log.Info("Test log")
log.Fatal("Error")
fmt
The fmt module exposes all the text functions from the golang fmt package except for all the Fprint
and Fscan
functions.
fmt.Sprintf("Print %s string", "formatted") # "Print formatted string"
-
⇐ Docs
AdvMake +
AdvMake is hosted on my Gitea instance. If that is down, it is also mirrored on Gitlab.
To download AdvMake, you can either use the download button on Gitea or Gitlab, or you can use the git CLI
To clone AdvMake using the CLI, run one of the following commands:
git clone https://gitea.arsenm.dev/Arsen6331/advmake.git
OR
@@ -11,4 +11,4 @@ linux distros call the package that provides it either go
or
To compile AdvMake, run
go build
To install AdvMake, run:
sudo install -Dm755 advmake /usr/bin
Once the command completes, AdvMake should be ready and you can run the following to make sure it works:
advmake -h
-
⇐ Docs
KbdEmu uses continuous integration to compile. You can find the binary by +clicking the CI badge above, selecting “Ubuntu2004” for the linux build or +“macOS” for the macOS build, and then going to the artifacts tab.
KbdEmu is hosted in two places, Gitea and Gitlab. Either one can be used as +it is mirrored from Gitea to Gitlab
To download kbdemu, you can either use the download button on one of the above, or +you can use the git command
To clone kbdemu using the command, run one of the following commands:
git clone https://gitea.arsenm.dev/Arsen6331/kbdemu
+OR
+git clone https://gitlab.com/moussaelianarsen/kbdemu
+
Now, you will want to cd
into the root of this repo before completing the rest
+of these instructions
Since KbdEmu is written in go, you will need go installed in order to compile it.
+Most linux distros call the package providing it either go
or golang
.
Once go is installed, you can check that it runs by running
go version
+
To compile KbdEmu, run the following commands:
go get github.com/go-vgo/robotgo
+go get github.com/BurntSushi/toml
+go get github.com/rs/zerolog/log
+source .envrc
+go build
+
To install kbdemu, run the following command:
sudo install -Dm755 kbdemu /usr/bin
+
Once this command completes, to test whether kbdemu was installed properly, run +this command:
kbdemu
+
You should get an error warning you that kbdemu cannot find a TOML file. If you do, +kbdemu is properly installed.
This page assumes you have already installed KbdEmu. If not, follow the installation instructions on the installation page:
InstallationKbdEmu uses scpt as its scripting language. The example script for kbdemu looks like this:
set testKey to "x"
+keystroke $testKey with action "hold"
+sleep "1s"
+keystroke $testKey with action "release"
+type "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz"
+scroll 5 with direction "up"
+click "right"
+move-mouse [0, 0]
+send-notification "Test"
+beep
+open-location "https://www.arsenm.dev/"
+set showDetails to (display-dialog "Show details?" with type "yesno")
+if $showDetails {
+ display-dialog {"Color: " + (pixel-color [100, 100]) + ", Mouse: " + (str (mouse-position))} with title "Details"
+}
+print {"\n" + (user-choice "test" with items ["Hello", "World", 3.1415926535, $GOOS, $GOARCH, true, false, (numcpu)])}
+log "Complete!"
+
By default, the kbdemu
command will look for and execute a file called kbdemu.scpt
, but that can be changed using the --file
flag.
KbdEmu comes with some extra functions for automation
numcpu
Returns the amount of available CPUs as a number.
Example:
print (numcpu)
+
sleep
Sleeps for a duration as specified by an unnamed string argument formatted according to the specification of golang’s time.ParseDuration()
:
Examples:
sleep "1s"
+sleep "1h2m"
+
display-dialog
Displays a dialog window with the specified parameters.
Examples:
display-dialog "Test1"
+display-dialog "Test2" with title "Title Test"
+print (display-dialog "Test3" with title "Entry Test" with type "entry")
+
These are all the supported dialog types:
Default dialog type is info.
send-notification
Sends a notification according to the specified parameters
Examples:
send-notification "Test"
+send-notification "Test" with title "Title"
+send-notification "Test" with title "Title" with icon "test.png"
+
beep
Creates a beep sound, if impossible, falls back to sending bell character.
Examples:
beep
+beep "3s"
+
click
Emulates a mouse click
Example:
click "right"
+
scroll
Scrolls the specifed amount in the specified direction
Example:
scroll 5 with direction "up"
+
move-mouse
Moves the cursor to the specified coordinates
Example:
move-mouse [100, 200]
+
keystroke
Emulates a key event
Examples:
keystroke "y" with action "hold"
+sleep "2s"
+keystroke "y" with action "release"
+keystroke "x"
+
Default action is tap
which presses and releases the key.
type
Types a string using the keyboard
Example:
type "Hello, World"
+
mouse-position
Returns the current mouse position in the form of an array containing two number elements.
Example:
print (mouse-position) # [0 0]
+
pixel-color
Returns a string containing the hex color of the given coordinates.
Example:
print (pixel-color [100, 100]) # ffffff
+
log
Logs the provided message at the given level.
Examples:
log "Complete"
+log "Error" with level "fatal"
+
The available levels are:
Default log level is info
user-choice
Displays a user choice dialog window with provided items, returns selected item.
Example:
user-choice "Choose an option" with items ["Hello", "World", 1, 3.14159, 6.28318]
+
open-location
Opens given URL in the default application set to open it.
Examples:
open-location "https://www.arsenm.dev"
+open-location "/home"
+
KbdEmu exposes some variables for use in scripts.
$GOOS
The value from golang’s runtime.GOOS
$GOARCH
The value from golang’s runtime.GOARCH
$arguments
Non-flag command line arguments provided to KbdEmu
Example:
Command:
kbdemu --file script.scpt "Hello, World"
+
Contents of script.scpt
:
print $arguments[0] # Hello, World
+
This page assumes you have already installed Opensend. If not, follow the installation instructions on the installation page.
InstallationOpensend GUI has been written in golang using fyne. Its source code can be found here:
Opensend GUITo download Opensend GUI, run the following command
git clone https://gitea.arsenm.dev/opensend/opensend-gui.git
To build Opensend GUI, go
must be installed. The process for that is explained in the installation instructions for Opensend. Once go
is installed, run:
go build
-
This may take a while as go
downloads and compiles Opensend GUI and Fyne.
Once the build is complete, there should be a file named opensend-gui
in the directory. Run this file to open the GUI which should look like this:
This may take a while as go
downloads and compiles Opensend GUI and Fyne.
Once the build is complete, there should be a file named opensend-gui
in the directory. Run this file to open the GUI which should look like this:
⇐ Docs
Opensend uses continuous integration to compile. You can find the binary by clicking the download binary badge above.
Opensend is hosted on Gitea.
To download opensend, you can either use the download button on one of the above, or you can use the git command
To clone opensend using the command, run the following command:
git clone https://gitea.arsenm.dev/opensend/opensend.git
@@ -13,4 +13,4 @@ Most linux distros call the package providing it either go
or # macOS
Once this command completes, to test whether opensend was installed properly, run this command:
opensend -h
-
You should get the usage for opensend.
You should get the usage for opensend.
This page assumes you have already installed Opensend. If not, follow the installation instructions on the installation page.
InstallationOpensend allows configuration by TOML and by command line flags. It looks at the following paths for configs in the specified order:
--config
flag~/.config/opensend.toml
/etc/opensend.toml
The purpose of the mdns-skipping flags is to account for the iSH app in iOS, as the mdns resolver and registration fails on it.
The purpose of the mdns-skipping flags is to account for the iSH app in iOS, as the mdns resolver and registration fails on it.
Pak uses a custom config file at /etc/pak.cfg
. For example, this is what the
apt config looks like:
# Write the name of the package manager in all lowercase below
apt
@@ -19,4 +19,4 @@ apt config looks like:
This file is read by pak to tell it what to do. The comments above each keyword
explain what it’s for.
Here is a list of all the fields and their uses:
- Command to invoke the package manager.
- Comma-separated list of commands supported by the package manager.
- Whether or not to invoke the root command.
- Command to use for root invocation (
sudo
, doas
, etc.) - Comma-separated list of shortcuts for pak to accept
- Comma-separated list of shortcut mappings (what each shortcut sends to the
package manager). These do not necessarily need to be in the commands list.
Once you have made the config, just place it at /etc/pak.cfg
and pak will
-automatically use it.
Pak uses continuous integration to compile. You can find the binary by clicking the download badge above.
If you are running an arch-based linux distro, you can use the Arch User Repository
to install pak. First, make sure the yay
AUR helper is installed, then run the following:
yay -S pak
Pak is hosted on my Gitea instance. If that is down, it is also mirrored on Gitlab.
Pak @@ -17,4 +17,4 @@ of package managers with ready to use configs:
If your package manager is in the list, use one of these:
sudo make aptinstall
sudo make aptitude
sudo make brewinstall
sudo make yayinstall
sudo make pacinstall
sudo make zyppinstall
sudo make snapinstall
sudo make installbinonly
Once the command completes, unless you’re using a custom config, pak should be ready and you can run the following to make sure it works:
pak
Go to the Configuration page for instructions on making a custom config, you must -have a config for pak to function.
Using pak is simple, just run pak
and one of the commands from the config file.
Pak understands partial commands, so these commands will be identical:
pak in <package>
OR
@@ -11,4 +11,4 @@ pak install <package>
The lack of sudo
is intentional. Pak will not allow running from root by default
as it already invokes root internally. To bypass this, simply give pak the -r
flag.
Using shortcuts in pak is just as simple as commands, just run pak
and a shortcut,
like this:
pak rm <package>
-