doesnt work
boo any other suggestions?
Isn't this sort of easily scriptable?
The below instructions expect that you know how to automate a program (like with cron) to make it run periodically. If I get a chance to think harder (and if I get a Pandora so I can actually play around), I can probably just make an easily installable package that will magically make this all happen.
Make a file called Card.desktop on the root of the card with the following contents:
Code:
[Desktop Entry]
Name=SomeFancyNameOfYourChoosing Spaces Are Okay
Terminal=false
Type=Application
Categories=Other
Also, make a file called "icon.png" on the root of the card. This should be the icon you want to represent the card.
Now, using a text editor, make a script like so and save it to the home directory with the name "autocard" (or some other appropriate path and name).
Code:
#!/usr/bin/env bash
slot="/media/mmcblk0p1"; icon="~/Desktop/Card1.desktop"
if [[ -e "${slot}/Card.desktop" ]]; then
cp ${slot}/Card.desktop" "${icon}";
echo "Exec=thunar ${slot}" >> ${icon}
echo "Icon=${slot}/icon.png" >> ${icon}
else
rm ${icon};
fi
slot="/media/mmcblk0p2"; icon="~/Desktop/Card2.desktop"
if [[ -e "${slot}/Card.desktop" ]]; then
cp ${slot}/Card.desktop" "${icon}";
echo "Exec=thunar ${slot}" >> ${icon}
echo "Icon=${slot}/icon.png" >> ${icon}
else
rm ${icon};
fi
(note: "/media/mmcblk0p1" and soforth may or may not be correct -- it should refers to the card slot paths when mounted)
Afterward, make it executable by either typing "chmod a+x ~/autocard" in a terminal or browsing to the file's location, right clicking on the file, clicking "Properties", clicking "Permissions" and selecting "Allow this file to run as a program" (hopefully, the checkbox for this exists):
Now, you just have to automate it. There are two ways. One involves slightly editing the script then putting it in a special place called "/etc/init.d". That's a better way, but I'll do it the simpler way for now. As I don't have a Pandora, I'm making a lot of assumptions here:
Open up a terminal and type the following:
Code:
EDITOR=mousepad crontab -e
I'm assuming that mousepad is the Pandora's built-in text editor. The above line (and capitalization matters there!) will open up the editor, and it will probably be blank. Add a line at the bottom like so:
It is important to hit Enter at the end of the line -- it will fail to work if the last line isn't a blank line! Anyway, save and close. The terminal will say "installing new crontab" if you typed it in correctly or "errors in crontab file" if something went wrong. Now, if everything went well (especially making it executable, as mentioned above!), it will run autocard once a minute, so it will take as much as 60 seconds for the card to appear. The "/etc/init.d" thing I mentioned can be used to make it check more frequently (like every second or five), but I'd need to have a Pandora and know its particulars to be sure about how to get it working right, since different operating systems treat init.d differently.
The above instructions assume that the Pandora desktop environment (xfce, right?) automatically refreshes the desktop when there is a change. The Web tells me that it does or doesn't, depending on how it's set up (whether or not the "gamin" library is installed). So this may or may not have been an exercise in futility.
Also.... I can safely assume that the Pandora has bash, right?
Note: Sorry the response took so long. I kept erasing and recreating the script and .desktop file, because I'm not 100% sure about the particulars of the Pandora and because I tried to cut corners initially (read: at each step).