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 #35 from billyvg/master
Add settings to set the dock's screen edge position as well as pinning position
- Loading branch information
Showing
5 changed files
with
118 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
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,15 @@ | ||
# Public: Sets the icons's size | ||
# Can be 'start', 'middle', or 'end' | ||
# System Default: 'middle' | ||
class osx::dock::pin_position($position = 'start') { | ||
include osx::dock | ||
|
||
boxen::osx_defaults { 'pin position': | ||
domain => 'com.apple.dock', | ||
key => 'pinning', | ||
type => 'string', | ||
value => $position, | ||
user => $::boxen_user, | ||
notify => Exec['killall Dock']; | ||
} | ||
} |
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,25 @@ | ||
# Public: Sets the dock position | ||
# | ||
# position - 'bottom', 'top', 'right',left' | ||
# | ||
# Examples | ||
# | ||
# # set the position to be on the bottom | ||
# include osx::dock::position | ||
# | ||
# # ...or pick your own position! | ||
# class { 'osx::dock::position': | ||
# position => 'left' | ||
# } | ||
class osx::dock::position($position = 'right') { | ||
include osx::dock | ||
|
||
boxen::osx_defaults { 'position': | ||
domain => 'com.apple.dock', | ||
key => 'orientation', | ||
type => 'string', | ||
value => $position, | ||
user => $::boxen_user, | ||
notify => Exec['killall Dock']; | ||
} | ||
} |
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,26 @@ | ||
require 'spec_helper' | ||
|
||
describe 'osx::dock::pin_position' do | ||
let(:facts) { {:boxen_user => 'ilikebees'} } | ||
|
||
it do | ||
should include_class('osx::dock') | ||
should contain_boxen__osx_defaults('pin position').with_value('start') | ||
end | ||
|
||
describe 'with parameters' do | ||
let(:params) { {:position => 'end'} } | ||
|
||
it 'allows you to pass a position' do | ||
should include_class('osx::dock') | ||
|
||
should contain_boxen__osx_defaults('pin position').with({ | ||
:key => 'pinning', | ||
:domain => 'com.apple.dock', | ||
:value => 'end', | ||
:notify => 'Exec[killall Dock]', | ||
:user => facts[:boxen_user] | ||
}) | ||
end | ||
end | ||
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,26 @@ | ||
require 'spec_helper' | ||
|
||
describe 'osx::dock::position' do | ||
let(:facts) { {:boxen_user => 'ilikebees'} } | ||
|
||
it do | ||
should include_class('osx::dock') | ||
should contain_boxen__osx_defaults('position').with_value('right') | ||
end | ||
|
||
describe 'with parameters' do | ||
let(:params) { {:position => 'left'} } | ||
|
||
it 'allows you to pass a position' do | ||
should include_class('osx::dock') | ||
|
||
should contain_boxen__osx_defaults('position').with({ | ||
:key => 'orientation', | ||
:domain => 'com.apple.dock', | ||
:value => 'left', | ||
:notify => 'Exec[killall Dock]', | ||
:user => facts[:boxen_user] | ||
}) | ||
end | ||
end | ||
end |