Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for mac #16

Closed
guruor opened this issue Apr 15, 2024 · 0 comments
Closed

Support for mac #16

guruor opened this issue Apr 15, 2024 · 0 comments

Comments

@guruor
Copy link
Contributor

guruor commented Apr 15, 2024

I was looking for system tray for mac os and found this comment: jtroo/kanata#29 (comment), I gave it a try and I was able to successfully build the app on my M1 Mac after adding sys_proc_attr_darwin.go in os_specific directory:

package os_specific

import "syscall"

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

@rszyma You can call the app cross-platform, thanks for the app.


I did not find a discussion so creating this issue so people can find the instructions to setup.

Build instructions

# Make sure your system golang version matches the project version
git clone https://github.com/rszyma/kanata-tray /tmp/kanata-tray
cd /tmp/kanata-tray
GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 GO111MODULE=on go build -ldflags "-s -w -X 'main.buildVersion=latest' -X 'main.buildHash=$(git rev-parse HEAD)' -X 'main.buildDate=$(date -u)'" -trimpath -o dist/kanata-tray
cp ./dist/kanata-tray ~/.local/bin

Default config was read from $HOME/Library/Application\ Support/kanata-tray/kanata-tray.toml path, my working config:

'$schema' = 'https://raw.githubusercontent.com/rszyma/kanata-tray/main/doc/config_schema.json'

[general]
allow_concurrent_presets = false

[defaults]
kanata_executable = '' # if empty or omitted, system $PATH will be searched.
kanata_config = ''     # if empty or not omitted, kanata default config locations will be used.
tcp_port = 5829        # if not specified, defaults to 5829

[defaults.layer_icons]
# mouse = 'mouse.png'
# qwerty = 'qwerty.ico'
# '*' = 'other_layers.ico'


[presets.'main cfg']
kanata_config = '~/.config/kanata/kanata.kbd'
autorun = true
# kanata_executable = ''
# layer_icons = {  }
# tcp_port = 1234

NOTE: Since kanata requires sudo permission to run the app, you'll need to run kanata-tray also with sudo.

Sample screenshot:
Screenshot 2024-04-15 at 4 05 02 PM

@rszyma rszyma pinned this issue Apr 15, 2024
@rszyma rszyma closed this as completed Apr 18, 2024
@rszyma rszyma unpinned this issue Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants