![]() |
Newbie: How do I code/write scripts?
Hi,
I'm trying to execute the suggestions by more senior members in order to install/use multiple GVM installations* on my n810 and also to set up shortcuts to launch individual Palm apps. I'd also like to do a script to set the Hotsync ID (since it often gets lost after a Hotsync). My question: What script editor would people recommend? How should line breaks be set? I have TextWrangler (donateware) on my Powerbook G4 and it has worked well with Supermemo files, but it gives 3 options for line breaks: CR (Mac), LF (Unix) and CRLF (Windows). I assume LF would be the correct choice for scripts in Maemo. I've also read that some people use nano to edit--what's that? Another poster mentioned vim. My Application Manager says that I have vim installed, but I can't find an icon to launch it in the launch menu. [If I understand the procedure: 1. I should create the script file and save it as a *.sh file where "*" is, of course, the name of your file. 2. copy the *.sh file to the /home/user folder 3. become root, i.e.: sudo gainroot [with Becomeroot, rootSH or OpenSSH installed] 4. change to the correct directory with: cd /home/user 5. execute a command to change the *.sh files to *.desktop files: chmod +x *.sh 6. copy the new *.desktop file to the "Extra's" directory: copy to /usr/share/applications/hildon 7. Use Control Panel-->Panels-->Organize to move the application to the panel of my choice For one-line scripts, I've found options listed by bunanson here: http://www.internettablettalk.com/fo...9&postcount=10 Both bunanson and Mara have posted directions for saving scripts as applications. Mara's are here: http://www.internettablettalk.com/fo...0&postcount=12 For creating multiple GVM installations, I found burmashave's code here: http://www.internettablettalk.com/fo...ad.php?t=15518 TA-t3's instructions for launching individual Palm apps (bypassing the GVM launcher) via shortcuts: http://www.internettablettalk.com/fo...ad.php?t=12297 Thanks!] |
Re: Newbie: How do I code/write scripts?
it looks like you've figured out many pieces to this puzzle, but you're missing a few that i can offer:
".desktop" files are not scripts. they're shortcuts to scripts/programs. the format of these files is explained in the wiki. "chmod +x" merely makes a script file executable. it's a necessary step, but it won't change your .sh file into a .desktop file. you don't want to do that anyway. you just want to create a .desktop file that links/points to your .sh/script file. oh, and as far as text editors go, i use the one that's built into emelfm2. then again, i don't do much scripting.... you should download emelfm2 regardless. it's the best file manager out there. very powerful, once you figure out what each button does. |
Re: Newbie: How do I code/write scripts?
nano and vim and text mode (X-Terminal) editors. You probably would prefer a graphical mode one while starting out. Leafpad might be a good choice.
|
Re: Newbie: How do I code/write scripts?
Quote:
2. vim is invoked by using in a command line. (vim is a vi editor compatible.) You have to go to a xterm and type: vim <filename> Google "vi commands" and test vim out! |
Re: Newbie: How do I code/write scripts?
jmjanzen, pelago, nhanquy, thank you!
I will try the script + shortcut thing soon, but I have another question: I looked at the format of the .desktop file in the wiki and saw nothing about the icon. Is there a way to assign a user-defined icon to each script shortcut? |
All times are GMT. The time now is 09:25. |
vBulletin® Version 3.8.8