Loading install_catfish.sh 0 → 100755 +35 −0 Original line number Diff line number Diff line #!/bin/bash if [ -z "$(dpkg -l | grep catfish)" ] then export DEBIAN_FRONTEND=noninteractive apt-get install -y catfish fi USERS="prof direction administrateur" for u in $USERS do launcher_path="/home/$u/.config/xfce4/panel/launcher-18/catfish.desktop" mkdir -p /home/$u/.config/xfce4/panel/launcher-18 cp /usr/share/applications/catfish.desktop $launcher_path xml_path="/home/$u/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml" if [ -z "`grep plugin-18 $xml_path`" ] then sed -i.bak \ -e 's@\(\s*\)\(<value type="int" value="2"/>\)@\1<value type="int" value="18"/>\n\1\2@' \ $xml_path tmp_path="/tmp/$$" head -n -2 $xml_path > $tmp_path cat << EOF >> $tmp_path <property name="plugin-18" type="string" value="launcher"> <property name="items" type="array"> <value type="string" value="catfish.desktop"/> </property> </property> </property> </channel> EOF mv /tmp/$$ $xml_path chown -R $u:$u $xml_path chown $u:$u $xml_path fi done Loading
install_catfish.sh 0 → 100755 +35 −0 Original line number Diff line number Diff line #!/bin/bash if [ -z "$(dpkg -l | grep catfish)" ] then export DEBIAN_FRONTEND=noninteractive apt-get install -y catfish fi USERS="prof direction administrateur" for u in $USERS do launcher_path="/home/$u/.config/xfce4/panel/launcher-18/catfish.desktop" mkdir -p /home/$u/.config/xfce4/panel/launcher-18 cp /usr/share/applications/catfish.desktop $launcher_path xml_path="/home/$u/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml" if [ -z "`grep plugin-18 $xml_path`" ] then sed -i.bak \ -e 's@\(\s*\)\(<value type="int" value="2"/>\)@\1<value type="int" value="18"/>\n\1\2@' \ $xml_path tmp_path="/tmp/$$" head -n -2 $xml_path > $tmp_path cat << EOF >> $tmp_path <property name="plugin-18" type="string" value="launcher"> <property name="items" type="array"> <value type="string" value="catfish.desktop"/> </property> </property> </property> </channel> EOF mv /tmp/$$ $xml_path chown -R $u:$u $xml_path chown $u:$u $xml_path fi done