Skip to content

Commit

Permalink
Merge branch 'master' of github.com:simonharrer/mob
Browse files Browse the repository at this point in the history
  • Loading branch information
simonharrer committed Apr 15, 2020
2 parents f4ab356 + b00163e commit b89bd7c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 13 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![mob Logo](logo.svg)

Swift handover for remote mobs using git.
Swift handover for [remote mobs](https://remotemobprogramming.org) using git.
`mob` is a CLI tool written in GO.
It keeps your master branch clean and creates WIP commits on `mob-session` branch.

Expand All @@ -14,7 +14,7 @@ Simon $ cd secret-git-project
Simon $ mob start 10
# WORK with Simon as typist
# after 10 minutes, the timer triggers (you'll hear a 'mob next' from your speakers)
Simon $ mob next
Simon $ mob next
# Carola takes over as the second typist
Carola $ mob start 10
# WORK with Carola as typist
Expand All @@ -30,17 +30,17 @@ Maria $ git commit --message "describe what the mob session was all about"
## How does it work?

- `mob start 10` creates branch `mob-session` and pulls from `origin/mob-session`, and creates a ten minute timer
- `mob start 10 share` also activates screenshare in zoom (macOS only, requires zoom configuration)
- `mob start 10 share` also activates screenshare in zoom (macOS or Linux with xdotool, requires zoom configuration)
- `mob next` pushes all changes to `origin/mob-session`in a `mob next [ci-skip]` commit
- `mob done` squashes all changes in `mob-session` into staging of `master` and removes `mob-session` and `origin/mob-session`

- `mob status` display the mob session status and all the created WIP commits
- `mob reset` deletes `mob-session` and `origin/mob-session`
- `mob share` start screenshare with zoom (macOS only, requires configuration in zoom to work)
- `mob share` start screenshare with zoom (macOS or Linux with xdotool, requires configuration in zoom to work)

### Zoom Screenshare

The `mob share` feature only works if you activate make the screenshare hotkey in zoom globally available, and keep the default shortcut at CMD+SHIFT+S.
The `mob share` feature only works if you activate make the screenshare hotkey in zoom globally available, and keep the default shortcut at CMD+SHIFT+S (macOS)/ ALT+S (Linux).

## How to install

Expand Down
5 changes: 3 additions & 2 deletions install
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /usr/bin/env bash
target=/usr/local/bin/
go build mob.go && cp -f mob $target
echo "installed 'mob' to $target"
go build mob.go &&
cp -f mob "$target" &&
echo "installed 'mob' to $target"
9 changes: 6 additions & 3 deletions install.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

echo Installing 'mob' ...

setx MOB_HOME "%USERPROFILE%\.mob"
REM set variable for local script
set MOB_HOME=%USERPROFILE%\.mob
REM set for user, not visible for current shell
setx MOB_HOME "%MOB_HOME%"
set target="%MOB_HOME%"

if not exist %target% (
Expand All @@ -15,8 +18,8 @@ go build mob.go
copy mob.exe %target%
echo 'mob.exe' installed to %target%

REM add MOB_HOME to PATH
echo %path%|find /i "%MOB_HOME%">nul || set path=%path%;%MOB_HOME%
REM add MOB_HOME to PATH, not used in current shell
echo %path%|find /i "%MOB_HOME%">nul || setx path "%path%;%MOB_HOME%"

echo 'mob' successfully installed.
pause
19 changes: 16 additions & 3 deletions mob.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"
"os/exec"
"runtime"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -187,16 +188,28 @@ func start(parameter []string) {
}

func startZoomScreenshare() {
command := exec.Command("sh", "-c", "(osascript -e 'tell application \"System Events\" to keystroke \"S\" using {shift down, command down}')")
commandStr := "(osascript -e 'tell application \"System Events\" to keystroke \"S\" using {shift down, command down}')"

if runtime.GOOS == "linux" {
commandStr = "(xdotool windowactivate $(xdotool search --name --onlyvisible 'zoom meeting') && xdotool keydown Alt s)"

}

command := exec.Command("sh", "-c", commandStr)

if debug {
fmt.Println(command.Args)
}
err := command.Start()
if err != nil {
sayError("screenshare couldn't be started... (screenshare only works on OSX)")
sayError("screenshare couldn't be started... (screenshare only works on OSX or Linux with xdotool installed)")
sayError(err)
} else {
sayOkay("Sharing screen with zoom (requires the global shortcut SHIFT+COMMAND+S)")
if runtime.GOOS == "linux" {
sayOkay("Sharing screen with zoom (requires the global shortcut ALT+S)")
} else {
sayOkay("Sharing screen with zoom (requires the global shortcut SHIFT+COMMAND+S)")
}
}
}

Expand Down

0 comments on commit b89bd7c

Please sign in to comment.