Remove iceweasel desktop icon.
[inetstation.git] / modules / desktop / manifests / init.pp
index 553cd80..a1dcd2c 100644 (file)
@@ -13,6 +13,57 @@ class desktop {
                require => Package['xinit'],
        }
 
+       $dms = [
+               'lightdm*',
+               'kdm',
+               'gdm3',
+               'nodm',
+               'wdm',
+               'xdm',
+               'slim',
+       ]
+
+       package { $dms:
+               ensure => absent,
+               require => Package['lxde'],
+       }
+
+       package { 'xscreensaver':
+               ensure => absent,
+       }
+
+       $packages = [
+               'pcmanfm',
+               'firefox-esr',
+               'firefox-esr-l10n-*',
+               'gstreamer1.0-libav',
+               'gstreamer1.0-plugins-good',
+               'flashplugin-nonfree',
+               'chromium',
+               'chromium-l10n',
+               'libreoffice',
+#              'libreoffice-help-*',
+#              'libreoffice-l10n-*',
+               'ttf-mscorefonts-installer',
+               'ttf-liberation',
+               'fonts-crosextra-carlito',
+               'fonts-crosextra-caladea',
+                'florence',
+
+       ]
+  
+       package { $packages:
+               ensure => installed,
+       }
+
+       file { '/etc/skel/Desktop/libreoffice-startcenter.desktop':
+               source => '/usr/share/applications/libreoffice-startcenter.desktop',
+               require => [
+                       Package['libreoffice'],
+                       File['/etc/skel/Desktop'],
+               ],
+       }
+
        file { '/etc/skel/Desktop/lxde-logout.desktop':
                source => '/usr/share/applications/lxde-logout.desktop',
                require => [
@@ -23,54 +74,115 @@ class desktop {
 
        file { '/etc/skel/Desktop/leafpad.desktop':
                source => '/usr/share/applications/leafpad.desktop',
+               replace => false,
                require => [
                        Package['lxde'],
                        File['/etc/skel/Desktop'],
                ],
        }
 
+       exec { 'fix-desktop-leafpad':
+               command => '/bin/sed -i "/^Name/ s/=.*/=Notes/;" /etc/skel/Desktop/leafpad.desktop',
+               unless => '/bin/grep -q "^Name=Notes" /etc/skel/Desktop/leafpad.desktop',
+               require => File['/etc/skel/Desktop/leafpad.desktop'],
+       }
+
        file { '/etc/skel/Desktop/galculator.desktop':
                source => '/usr/share/applications/galculator.desktop',
+               replace => false,
                require => [
                        Package['lxde'],
                        File['/etc/skel/Desktop'],
                ],
        }
 
-       package { 'lightdm':
-               ensure => absent,
-               require => Package['lxde'],
+       exec { 'fix-desktop-galculator':
+               command => '/bin/sed -i "/^Name/ s/=.*/=Calculator/;" /etc/skel/Desktop/galculator.desktop',
+               unless => '/bin/grep -q "^Name.*=Calculator" /etc/skel/Desktop/galculator.desktop',
+               require => File['/etc/skel/Desktop/galculator.desktop'],
        }
 
-       $packages = [
-               'iceweasel',
-               'iceweasel-l10n-*',
-       ]
-  
-       package { $packages:
-               ensure => installed,
+       file { '/etc/skel/Desktop/chromium-l10n.desktop':
+               source => '/usr/share/applications/chromium.desktop',
+               require => [
+                       Package['chromium'],
+                       File['/etc/skel/Desktop'],
+               ],
+       }
+       
+       file { '/etc/skel/Desktop/florence.desktop':
+               source => '/usr/share/applications/florence.desktop',
+               replace => false,
+               require => [
+                       Package['florence'],
+                       File['/etc/skel/Desktop'],
+               ],
+       }
+
+       exec { 'fix-desktop-florence':
+               command => '/bin/sed -i "/^Name/ s/=.*/=Keyboard/;" /etc/skel/Desktop/florence.desktop',
+               unless => '/bin/grep -q "^Name.*=Keyboard" /etc/skel/Desktop/florence.desktop',
+               require => File['/etc/skel/Desktop/florence.desktop'],
+       }
+
+       file { '/etc/skel/Desktop/pcmanfm.desktop':
+               source => '/usr/share/applications/pcmanfm.desktop',
+               replace => false,
+               require => [
+                       Package['pcmanfm'],
+                       File['/etc/skel/Desktop'],
+               ],
+       }
+
+       exec { 'fix-desktop-pcmanfm':
+               command => '/bin/sed -i "/^Name/ s/=.*/=Filemanager/;" /etc/skel/Desktop/pcmanfm.desktop',
+               unless => '/bin/grep -q "^Name.*=Filemanager" /etc/skel/Desktop/pcmanfm.desktop',
+               require => File['/etc/skel/Desktop/pcmanfm.desktop'],
        }
 
        file { '/etc/skel/Desktop/iceweasel.desktop':
-               source => '/usr/share/applications/iceweasel.desktop',
+               ensure => absent,
+       }
+
+       file { '/etc/skel/Desktop/firefox-esr.desktop':
+               source => '/usr/share/applications/firefox-esr.desktop',
+               replace => false,
                require => [
-                       Package['iceweasel'],
+                       Package['firefox-esr'],
                        File['/etc/skel/Desktop'],
                ],
        }
 
+       exec { 'fix-desktop-firefox-esr':
+               command => '/bin/sed -i "/^Name/ s/=.*/=Webbrowser/;" /etc/skel/Desktop/firefox-esr.desktop',
+               unless => '/bin/grep -q "^Name.*=Webbrowser" /etc/skel/Desktop/firefox-esr.desktop',
+               require => File['/etc/skel/Desktop/firefox-esr.desktop'],
+       }
+
+       file { '/etc/firefox-esr/prefs.js':
+               source => 'puppet:///modules/desktop/etc/firefox-esr/prefs.js',
+               require => [
+                       Package['firefox-esr'],
+               ],
+       }
+
        group { 'guest':
                ensure => 'present'
        }
 
        user { 'guest':
                uid => 5000,
-               home => '/run/user/5000',
+               home => '/run/user/5000/home',
                # password: guest
                password => '$6$pheeghohphaikuka$lJodCaTfZG4IhXw9.htxDsMDAiQrhOsXyJR.nvCdWc2EHgmstkTrpn/8LWi83e9Ac.WFDfzmQ1phpDII/npl/0',
                managehome => false,
                gid => 'guest',
-               groups => [ 'plugdev' ],
+               groups => [
+                               'plugdev',
+                               'cdrom',
+                               'audio',
+                               'video',
+                       ],
                shell => '/bin/bash',
                require => Group['guest'],
                ensure => 'present',
@@ -98,7 +210,7 @@ class desktop {
                ensure => installed,
                require => [
                                Exec['add-architecture-i386'],
-                               Exec['aptget-update'],
+                               Exec['apt_update'],
                        ],
        }
 
@@ -141,10 +253,9 @@ class desktop {
                ensure => file,
        }
 
-       file { '/etc/skel/.bashrc':
-               source => 'puppet:///modules/desktop/etc/skel/.bashrc',
-               mode => 'a=r',
-               ensure => file,
+       file { '/etc/skel':
+               source => 'puppet:///modules/desktop/etc/skel',
+               recurse => true,
        }
 
        file { '/etc/systemd/system/guestx11.service':
@@ -154,7 +265,7 @@ class desktop {
                                Package['lxde'],
                                File['/etc/skel/Desktop'],
                                File['/usr/local/sbin/x11login'],
-                               File['/etc/skel/.bashrc'],
+                               File['/etc/skel'],
                        ],
                notify => [
                                Exec['enable-guestx11'],
@@ -162,5 +273,5 @@ class desktop {
                        ],
                ensure => file,
        }
-
+       
 }