View Single Post
Ancelad's Avatar
Posts: 1,552 | Thanked: 3,108 times | Joined on Jun 2012 @ Russia, 96
#109
Originally Posted by jackburton View Post
Can you post how you create icons like this? I assume there is some backing script or exe?
Something like this... /opt/switcher/switcher.sh
Code:
#!/bin/bash

reply=$(grep mmc /etc/usb-moded/usb-moded.ini)
if [ "$reply" = "mount = /dev/mmcblk0p1" ]; then
sed -i '/mmc/s/1/4/g' /etc/usb-moded/usb-moded.ini
sed -i '/Name/s/MyDocs/BackupRoom/g' /usr/share/applications/switcher.desktop
else
sed -i '/mmc/s/4/1/g' /etc/usb-moded/usb-moded.ini
sed -i '/Name/s/BackupRoom/MyDocs/g' /usr/share/applications/switcher.desktop
fi
Desktop icon (/usr/share/applications/switcher.desktop)

Code:
[Desktop Entry]
Type=Application
Terminal=false
Name=MyDocs
Categories=System;
Terminal=false
Exec=sh -c "echo rootme | devel-su -c '/opt/switcher/switcher.sh'"
Icon=/path_to_your_icon
rootme is default root-user password, change it to your one.

Last edited by Ancelad; 2013-09-06 at 04:30.
 

The Following User Says Thank You to Ancelad For This Useful Post: