Cookbook to install the GNOME gui and manage settings and keyboard shortcuts.
- Debian Stretch
- Chef 15.3+
Add the cookbook to your Berksfile or Metadata of your (wrapper) cookbook and then use the resources as needed.
The codenamephp_gnome_package
resource installs or uninstalls the gnome gui.
:install
: Installs the gui using apt:uninstall
: Uninstalls the gui using apt
package_name
: The name of the apt package to use for install, defaults to 'gnome-core' for a "minimal" install
# Minmal parameters
codenamephp_gnome_package 'install gnome gui'
# Custom package name
codenamephp_gnome_package 'install gnome gui' do
package_name 'gnome'
end
# Uninstall
codenamephp_gnome_package 'install gnome gui' do
action :uninstall
end
Resource to set gsettings configurations. There are constants in CodenamePHP::Gnome::GSettings
that can be used for known schemas and keys
:set
: Sets the configuration
schema
: The schema the configuration is located in, e.g. 'org.gnome.desktop.session'key
: The key within the schema to be set, e.g. 'idle-delay'value
: The value to set, e.g. '0'users
: The users to set the settings for as array of usernames
# Minimal parameters
codenamephp_gnome_gsettings 'Set display idle delay' do
schema CodenamePHP::Gnome::GSettings::SCHEMA_DESKTOP_SESSION
key CodenamePHP::Gnome::GSettings::KEY_DESKTOP_SESSION_IDLE_DELAY
value '0'
users ['test']
end
The codenamephp_gnome_keyboard_shortcuts
resource adds custom shortcuts for the gnome desktop. This is done by getting the custom shortcuts using gsettings
and then adding the new shortcut and adds back all shortcuts. If a shortcut with the same name already exists it is replaced by the new one
set
: Sets a new or replaces an existing shortcut
shortcut_name
: The name of the shortcut to set, defaults to the resource namecommand
: The command the shortcut should executebinding
: The keys the shortcut consists of, also see theCodenamePHP::Gnome::GSettings::Keys::*
constantsusers
: The users to set the shortcuts for as array of usernames
codenamephp_gnome_keyboard_shortcut 'Terminal' do
command 'gnome-terminal --maximize'
binding "#{CodenamePHP::Gnome::GSettings::Keys::SUPER}#{CodenamePHP::Gnome::GSettings::Keys::ALT}t"
users ['test']
end