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

use service instead of plist #25

Closed
wants to merge 1 commit into from
Closed

use service instead of plist #25

wants to merge 1 commit into from

Conversation

glepnir
Copy link

@glepnir glepnir commented Feb 6, 2023

recently homebrew had deprecated the plist_options suggest use the service.require_root instead . I am not familiar the homebrew just read the doc of it then write this. not sure is correct so i only write the yabai .if this is no problem i can add skhd thanks.

Copy link

@mvllow mvllow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of this was discovered through trial and error so some suggestions may be overkill or unnecessary but this does work when installing locally via brew install ./yabai.rb. Hope this helps!

service do
run opt_bin/"yabai"
require_root true
environment_variables HOMEBREW_PREFIX/"bin:/usr/bin:/bin:/usr/sbin:/sbin"
Copy link

@mvllow mvllow Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saw this used in a few other formulae and it seems to fix the error.

Suggested change
environment_variables HOMEBREW_PREFIX/"bin:/usr/bin:/bin:/usr/sbin:/sbin"
environment_variables PATH: std_service_path_env

keep_alive true
interval 30
log_path var/"log/yabai/yabai.out.log"
err_log_path var"/log/yabai/yabai.err.log"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this option is called error_log_path.
https://docs.brew.sh/Formula-Cookbook#page

Suggested change
err_log_path var"/log/yabai/yabai.err.log"
error_log_path "#{var}/log/yabai/yabai.err.log"

environment_variables HOMEBREW_PREFIX/"bin:/usr/bin:/bin:/usr/sbin:/sbin"
keep_alive true
interval 30
log_path var/"log/yabai/yabai.out.log"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this matters (pretty unfamiliar with ruby) but Homebrew complains about "var" specifically and string interpolation seems to make that error go away.

Suggested change
log_path var/"log/yabai/yabai.out.log"
log_path "#{var}/log/yabai/yabai.out.log"

</plist>
EOS
service do
run opt_bin/"yabai"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could probably be ignored, just suggesting for consistency.

Suggested change
run opt_bin/"yabai"
run "#{opt_bin}/yabai"

EOS
service do
run opt_bin/"yabai"
require_root true
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need root?

Suggested change
require_root true

require_root true
environment_variables HOMEBREW_PREFIX/"bin:/usr/bin:/bin:/usr/sbin:/sbin"
keep_alive true
interval 30
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seem like this only request when run_type is set to interval

Suggestion per @hunterliao29 on #27

Suggested change
interval 30

@koekeishiya
Copy link
Owner

Track #31 instead.

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

Successfully merging this pull request may close these issues.

3 participants