This repository has been archived by the owner on Dec 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from moexmen/jsyeo-show-battery-percent
Add osx::menubar::show_battery_percent
- Loading branch information
Showing
4 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Internal: Restart the Menubar aka the SystemUIServer when necessary. | ||
# | ||
# Example | ||
# | ||
# boxen::osx_defaults { 'Do a thing': | ||
# # ... other stuff here ... | ||
# notify => Exec['killall SystemUIServer']; | ||
# } | ||
class osx::menubar { | ||
exec { 'killall SystemUIServer': | ||
refreshonly => true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Public: Shows battery percentage | ||
# | ||
# Example | ||
# | ||
# include osx::menubar::show_battery_percent | ||
# | ||
class osx::menubar::show_battery_percent { | ||
include osx::menubar | ||
|
||
boxen::osx_defaults { 'Shows battery percentage': | ||
domain => 'com.apple.menuextra.battery', | ||
key => 'ShowPercent', | ||
type => 'string', | ||
value => 'YES', | ||
user => $::boxen_user, | ||
notify => Exec['killall SystemUIServer']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require 'spec_helper' | ||
|
||
describe 'osx::menubar::show_battery_percent' do | ||
should contain_boxen__osx_defaults('Shows battery percentage').with({ | ||
:key => 'ShowPercent', | ||
:domain => 'com.apple.menuextra.battery', | ||
:value => 'YES', | ||
:user => facts[:boxen_user], | ||
:notify => 'Exec[killall SystemUIServer]' | ||
}) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'spec_helper' | ||
|
||
describe 'osx::menubar' do | ||
it do | ||
should contain_exec('killall SystemUIServer').with( {:refreshonly => true} ) | ||
end | ||
end |