LWRP to manage desktop's settings for an user.
There are a lot of user's settings that are managed by a desktop setting system as gconf, gsetting and so. This LWRP let you manage the keys and values for those settings.
Right now it's just supported gconf and gsettings, but I hope that more desktop settings systems be supported in the future. For example, the one used by KDE.
This LWRP born as a need for a project called GECOS which is being developed by the Junta de Andalucía, a local government from the lovely region of Spain: Andalusia.
In order to use this LWRP from your cookbook or recipe you need to add
this cookbook as a dependency at the
After doing that you can do things like:
node['my_cookbook']['users'].each do |username| desktop_settings "picture-uri" do schema "org.gnome.desktop.background" type "string" value "/usr/share/background/supecoolbackgroung.jpg" user username end end
To see how this works and how could be used from another cookbook, let's see some examples.
The LWRP provider by default is
gsettings as this is the new kid on the block
and the current default system for GNOME and GNOME apps.
If you like to set a specific background to an user you could do something like:
Let's say we have a recipe named
background with this at the
defaults['background']['image'] = '/usr/share/background/supecoolbackgroung.jpg' defaults['background']['user'] = 'joe'
And this inside the recipe:
desktop_settings "picture-uri" do schema "org.gnome.desktop.background" type "string" value node['background']['image'] user node['background']['user'] end
But we can use also the
gconf provider to set the background is this is
the setting system that use our desktop:
desktop_settings '/desktop/gnome/background/picture_filename' do type 'string' value node['background']['image'] user node['background']['user'] provider 'desktop_gconf' end
Copyright 2011-2012 Junta de Andalucía
Copyright 2012 Juanje Ojeda firstname.lastname@example.org
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.