Added xdg module
This commit is contained in:
parent
7a9911a54d
commit
a7b15a5930
1 changed files with 26 additions and 0 deletions
26
xdg/manifests/init.pp
Normal file
26
xdg/manifests/init.pp
Normal file
|
@ -0,0 +1,26 @@
|
|||
# Edit xdg autostart settings.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# $name:
|
||||
# Service name.
|
||||
# $enable:
|
||||
# Whether to start service, true or false.
|
||||
#
|
||||
define xdg::autostart($enable) {
|
||||
|
||||
exec { "xdg-autostart-set-${name}":
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
cwd => "/etc/xdg/autostart",
|
||||
command => "echo 'X-GNOME-Autostart-enabled=${enable}' >> ${name}.desktop",
|
||||
unless => "grep -q 'X-GNOME-Autostart-enabled' ${name}.desktop",
|
||||
before => Exec["xdg-autostart-sub-${name}"],
|
||||
}
|
||||
exec { "xdg-autostart-sub-${name}":
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
cwd => "/etc/xdg/autostart",
|
||||
command => "ruby -pi -e 'sub(/^(X-GNOME-Autostart-enabled).*/, \"\\\1=${enable}\")' ${name}.desktop",
|
||||
unless => "grep -q 'X-GNOME-Autostart-enabled=${enable}' ${name}.desktop",
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue