Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Commit

Permalink
Merge pull request #35 from billyvg/master
Browse files Browse the repository at this point in the history
Add settings to set the dock's screen edge position as well as pinning position
  • Loading branch information
fromonesrc committed Nov 22, 2013
2 parents d07ee23 + 658681c commit 62605e3
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,39 @@ class { 'osx::universal_access::cursor_size':
`osx::dock::icon_size` - the size of the dock icons, in pixels

```puppet
# Set the default value (36)
include osx::dock::icon_size
# ... or set your own
class { 'osx::dock::icon_size':
size => 36
}
```

`osx::dock::position` - the location of the dock on the screen ('right', 'left', 'top', 'bottom')

```puppet
# Set the default value ('right')
include osx::dock::position
# ... or set your own
class { 'osx::dock::position':
position => 'right'
}
```

`osx::dock::pin_position` - the location to pin the dock to ('start', 'middle', 'end')

```puppet
# Set the default value ('start')
include osx::dock::pin_position
# ... or set your own
class { 'osx::dock::pin_position':
size => 36
}
```

## Required Puppet Modules

* boxen
Expand Down
15 changes: 15 additions & 0 deletions manifests/dock/pin_position.pp
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'];
}
}
25 changes: 25 additions & 0 deletions manifests/dock/position.pp
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'];
}
}
26 changes: 26 additions & 0 deletions spec/classes/dock/pin_position_spec.rb
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
26 changes: 26 additions & 0 deletions spec/classes/dock/position_spec.rb
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

0 comments on commit 62605e3

Please sign in to comment.