From 75b9660e00f84f8dc358d4d5219a97db1cb52bdf Mon Sep 17 00:00:00 2001 From: rwxrob Date: Fri, 25 Mar 2022 19:59:01 -0400 Subject: [PATCH] Add inital files, starting to mig bash scripts --- README.md | 4 ++++ go.work | 4 ++++ main.go | 10 +++++++--- tmux.go | 25 +++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 tmux.go diff --git a/README.md b/README.md index de37fbc..4c33170 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,10 @@ connection and `z update`. ## Install +Note: you'll have to remove `go.work` yourself if you want to use this +build yourself (or clone all my structure the same way). I'm saving my +`go.work` in this Go repo only because it is a personal build. + ``` go install github.com/rwxrob/z@latest ``` diff --git a/go.work b/go.work index 3350b9b..32a02bb 100644 --- a/go.work +++ b/go.work @@ -3,5 +3,9 @@ go 1.19 use ( . ../bonzai + ../fs + ../config + ../term + ../twitch ../yaml2json ) diff --git a/main.go b/main.go index ef93c74..d6fef0a 100644 --- a/main.go +++ b/main.go @@ -1,8 +1,10 @@ package main import ( - "github.com/rwxrob/bonzai" + Z "github.com/rwxrob/bonzai" "github.com/rwxrob/bonzai/inc/help" + "github.com/rwxrob/config" + "github.com/rwxrob/twitch" "github.com/rwxrob/yaml2json" ) @@ -10,11 +12,13 @@ func main() { Cmd.Run() } -var Cmd = &bonzai.Cmd{ +var Cmd = &Z.Cmd{ Name: `z`, Summary: `rwxrob's bonzai command tree`, Version: `v0.0.1`, Copyright: `Copyright 2021 Robert S Muhlestein`, License: `Apache-2.0`, - Commands: []*bonzai.Cmd{help.Cmd, yaml2json.Cmd}, + Commands: []*Z.Cmd{ + help.Cmd, yaml2json.Cmd, twitch.Cmd, config.Cmd, tmux, + }, } diff --git a/tmux.go b/tmux.go new file mode 100644 index 0000000..c4d5a4e --- /dev/null +++ b/tmux.go @@ -0,0 +1,25 @@ +package main + +import ( + "strings" + + Z "github.com/rwxrob/bonzai" + "github.com/rwxrob/bonzai/inc/help" +) + +var tmux = &Z.Cmd{ + Name: `tmux`, + Summary: `make tmux updates`, + Commands: []*Z.Cmd{help.Cmd, tmuxUpdate}, +} + +var tmuxUpdate = &Z.Cmd{ + Name: `update`, + Summary: `update the onscreen status`, + Call: func(_ *Z.Cmd, args ...string) error { + msg := strings.Join(args, " ") + return Z.Exec( + "tmux", "-L", "live", "set", "-g", "status-right", msg, + ) + }, +}