From 8d44ba85b4e4fa25fbf84881285f2fd7d8f3ee14 Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 16 Oct 2023 08:56:23 -0400 Subject: [PATCH] Update to reflect calling from code --- README.md | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 766dbf2..ccc4b31 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,29 @@ keep waking Windows up -[![Go Report Card](https://goreportcard.com/badge/github.com/shu-go/vvin)](https://goreportcard.com/report/github.com/shu-go/vvin) ![MIT License](https://img.shields.io/badge/License-MIT-blue) # Usage +``` +package main + +import ( + "git.bigun.dev/evan/vvin" +) + +// program implements vvin + +func main() { + + // Bring this program's window to the top. + err := vvin.Vvin([]string{"topmost"}) + if err != nil { + log.Println(err) + } +} + +``` + ``` Sub commands: minimize, min minimize/restore @@ -21,31 +40,32 @@ Options: ## minimize/restore ``` -> ./vvin -t Notepad min +vvin.Vvin([]string{"-t", "notepad", "min"}) -> ./vvin -t Notepad min --restore -> ./vvin -t Notepad min -r +vvin.Vvin([]string{"-t", "notepad", "min", "--restore"}) +vvin.Vvin([]string{"-t", "notepad", "min", "-r"}) ``` ## resize ``` -> ./vvin -t notepad resize -x 0 -y 0 -w 60% -h 100% +vvin.Vvin([]string{"-t", "notepad", "resize", "-x", "0", "-y", "0", "-w", "60%", "-h", "100%"}) ``` ## alpha ``` -> ./vvin -t notepad alpha 75% +vvin.Vvin([]string{"-t", "notepad", "alpha", "75%"}) ``` ## always on top ``` +vvin.Vvin([]string{"-t", "notepad", "topmost"}) > ./vvin -t notepad topmost -> ./vvin -t notepad topmost --restore -> ./vvin -t notepad topmost -r +vvin.Vvin([]string{"-t", "notepad", "topmost", "--restore"}) +vvin.Vvin([]string{"-t", "notepad", "topmost", "-r"}) ``` ## wait @@ -53,12 +73,13 @@ Options: ### wait for a window to appear ``` +vvin.Vvin([]string{"wait", "notepad"}) > ./vvin wait notepad ``` ### wait closed ``` -> ./vvin wait notepad --closed +vvin.Vvin([]string{"wait", "notepad", "--closed"}) ```