install_conky.sh 1.05 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
#!/bin/bash
USERS="prof direction administrateur"

for u in $USERS
do
    launcher_path="/home/$u/.config/xfce4/panel/launcher-11/15502394761.desktop"
    xml_path="/home/$u/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml"
    if [ -z "`grep -R conky /home/$u/.config/xfce4/panel`" ]
    then
    mkdir /home/$u/.config/xfce4/panel/launcher-11
        cat << EOF > $launcher_path
[Desktop Entry]
Version=1.0
Type=Application
Name=Conky
Comment=
Exec=/usr/bin/conky
Icon=4137_winhlp32.0
Path=
Terminal=false
StartupNotify=false
EOF
    sed -i.bak \
        -e 's@\(\s*\)\(<value type="int" value="2"/>\)@\1\2\n\1<value type="int" value="11"/>@' \
    $xml_path
    tmp_path="/tmp/$$"
    head -n -2 $xml_path > $tmp_path
    cat << EOF >> $tmp_path
    <property name="plugin-11" type="string" value="launcher">
      <property name="items" type="array">
        <value type="string" value="15502394761.desktop"/>
      </property>
    </property>
  </property>
</channel>
EOF
    mv /tmp/$$ $xml_path
    chown -R $u:$u $xml_path
    chown $u:$u $xml_path
fi
done