5 gtk-update-icon-cache /usr/share/icons/hicolor
7 #check whether the needed sound systen settings are already in place
9 if ! grep -q KitchenAlert /usr/share/policy/etc/current/pulse/xpolicy.conf
13 #checks whether there is a newline at the end of the file and adds one if there is not and then
14 #checks if there is an ampty line at the end of the file and add one if there is not
16 perl -e 'use strict;' \
18 -e 'open(my $in, "<", "/usr/share/policy/etc/current/pulse/xpolicy.conf") or die "Cannot open /usr/share/policy/etc/current/pulse/xpolicy.conf: $!";' \
19 -e 'my @lines = <$in>;' \
20 -e 'my $lastlineishere = $#lines;' \
21 -e 'my $lastline = $lines[$lastlineishere];' \
22 -e 'unless ($lastline =~ /\n$/){open(my $log, ">>", "/usr/share/policy/etc/current/pulse/xpolicy.conf") or die "Cannot open /usr/share/policy/etc/current/pulse/xpolicy.conf: $!"; print $log "\n"; }' \
23 -e 'unless ($lastline =~ /^\n$/){open(my $log, ">>", "/usr/share/policy/etc/current/pulse/xpolicy.conf") or die "Cannot open /usr/share/policy/etc/current/pulse/xpolicy.conf: $!"; print $log "\n"; }'
25 #writes the sound system settings needed
29 group = alarm" >> /usr/share/policy/etc/current/pulse/xpolicy.conf
31 #restarts the pulseaudio so that the above changed settings take effect
32 #this interrupts all playing sounds (they do not resume play at restart)