Skip to content

Commit

Permalink
Add macOS support (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
guruor authored Apr 18, 2024
1 parent 4e74cda commit 000b8aa
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
go-version: [1.21.x]
platform: [ubuntu-latest, windows-latest]
platform: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.platform }}

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
version=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
just build_release_linux $version
just build_release_windows $version
just build_release_macos $version
- name: Release
uses: softprops/action-gh-release@v1
Expand All @@ -36,4 +37,5 @@ jobs:
files: |
./dist/kanata-tray.exe
./dist/kanata-tray
./dist/kanata-tray-macos
LICENSE
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# kanata-tray

A simple wrapper for [kanata](https://github.com/jtroo/kanata) to control it from tray icon.
Works on Windows and Linux.
Works on Windows, Linux and macOS.

## Features

Expand All @@ -17,8 +17,10 @@ You can access it from from: `Click Tray Icon > Configure`.

Config file name is `kanata-tray.toml`.

On Linux, the config folder location is `~/.config/kanata-tray`.
On Windows, it's `C:\Users\<YourUsername>\AppData\Roaming\kanata-tray`
The config folder location:
- Linux `~/.config/kanata-tray`.
- Windows `C:\Users\<YourUsername>\AppData\Roaming\kanata-tray`
- macOS `$HOME/Library/Application\ Support/kanata-tray`

Alternatively, you can place your config file in the same folder as kanata-tray executable,
and it will be have higher priority than the global config in user folder.
Expand Down
3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ run:
build_release_linux version="latest":
GOOS=linux CGO_ENABLED=1 GO111MODULE=on go build -ldflags "-s -w -X 'main.buildVersion={{version}}' -X 'main.buildHash=$(git rev-parse HEAD)' -X 'main.buildDate=$(date -u)'" -trimpath -o dist/kanata-tray

build_release_macos version="latest":
GOOS=darwin CGO_ENABLED=1 GO111MODULE=on go build -ldflags "-s -w -X 'main.buildVersion={{version}}' -X 'main.buildHash=$(git rev-parse HEAD)' -X 'main.buildDate=$(date -u)'" -trimpath -o dist/kanata-tray-macos

build_release_windows version="latest":
GOOS=windows CGO_ENABLED=1 GO111MODULE=on go build -ldflags "-H=windowsgui -s -w -X 'main.buildVersion={{version}}' -X 'main.buildHash=$(git rev-parse HEAD)' -X 'main.buildDate=$(date -u)'" -trimpath -o dist/kanata-tray.exe

Expand Down
5 changes: 5 additions & 0 deletions os_specific/sys_proc_attr_darwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package os_specific

import "syscall"

var ProcessAttr *syscall.SysProcAttr = &syscall.SysProcAttr{}

0 comments on commit 000b8aa

Please sign in to comment.