mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 07:06:40 +00:00
feat(xbar/brew-services): show Start command first if relevant
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# <xbar.title>Brew Services</xbar.title>
|
||||
# <xbar.version>v2.2.1</xbar.version>
|
||||
# <xbar.version>v2.2.2</xbar.version>
|
||||
# <xbar.author>Jim Myhrberg</xbar.author>
|
||||
# <xbar.author.github>jimeh</xbar.author.github>
|
||||
# <xbar.desc>List and manage Homebrew Services</xbar.desc>
|
||||
@@ -310,6 +310,13 @@ module Brew
|
||||
end
|
||||
|
||||
printer.item("#{icon} #{service.name}") do |printer|
|
||||
if service.stopped? || service.unknown_status?
|
||||
printer.item(
|
||||
'Start',
|
||||
terminal: false, refresh: true,
|
||||
shell: [brew_path, 'services', 'start', service.name]
|
||||
)
|
||||
end
|
||||
if service.started? || service.error? || service.unknown_status?
|
||||
printer.item(
|
||||
'Stop',
|
||||
@@ -322,13 +329,6 @@ module Brew
|
||||
shell: [brew_path, 'services', 'restart', service.name]
|
||||
)
|
||||
end
|
||||
if service.stopped? || service.unknown_status?
|
||||
printer.item(
|
||||
'Start',
|
||||
terminal: false, refresh: true,
|
||||
shell: [brew_path, 'services', 'start', service.name]
|
||||
)
|
||||
end
|
||||
|
||||
printer.sep
|
||||
printer.item("State: #{service.status}")
|
||||
|
||||
Reference in New Issue
Block a user