Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
wiki:creating_personal_icons [2011/04/18 07:25] – external edit 127.0.0.1wiki:creating_personal_icons [2011/05/03 14:16] (current) gutmensch
Line 1: Line 1:
-    This guide will help you create an extension with a wbar icon and/or menu entry for a command.  As an example, I will use an extension I created for an icon and menu entry to mount my networked mp3 directory. +This guide will help you create an extension with a wbar icon and/or menu entry for a command.  As an example, I will use an extension I created for an icon and menu entry to mount my networked mp3 directory. The extension is named zzzmymount.tcz
-The extension is name zzzmymount.tcz+
  
-==== #Create a temporary dir to work from ==== +==== Create a temporary dir to work from ==== 
-^tc@box:~$ mkdir /tmp/extension && cd /tmp/extension^ +<code>tc@box:~$ mkdir /tmp/extension && cd /tmp/extension</code> 
-==== #Write the script ==== + 
-    Use your favorite editor (for me its nano) +==== Write the script ==== 
-^tc@box:/tmp/extension$ mkdir -p usr/local/bin +Use your favorite editor (for me its nano) 
-tc@box:/tmp/extension$ nano usr/local/bin/mountmp3s^ +<code> 
-^#!/bin/sh +tc@box:/tmp/extension$ mkdir -p usr/local/bin 
-|[[[ -d /home/tc/mnt/mp3s ]] || mkdir /home/tc/mnt/mp3s| +tc@box:/tmp/extension$ nano usr/local/bin/mountmp3s 
-sudo mount -t cifs //192.168.1.100/mp3s /home/tc/mnt/mp3s -o uid=1001,gid=50,username=tc,password=xxxx^ +</code> 
-    Dont forget to make it executable + 
-^tc@box:~$ chmod +x usr/local/bin/mountmp3s^ +<code> 
-==== #Create the menu entry ====+#!/bin/sh 
 +[ -d /home/tc/mnt/mp3s ] || mkdir /home/tc/mnt/mp3s 
 +sudo mount -t cifs //192.168.1.100/mp3s /home/tc/mnt/mp3s -o uid=1001,gid=50,username=tc,password=xxxx 
 +</code> 
 + 
 +Dont forget to make it executable 
 +<code> 
 +tc@box:~$ chmod +x usr/local/bin/mountmp3s 
 +</code> 
 + 
 +==== Create the menu entry ====
 (note: even if you do not wish to have a menu entry, you must have a menu file to trigger the setup) (note: even if you do not wish to have a menu entry, you must have a menu file to trigger the setup)
-^tc@box:/tmp/extension$ mkdir usr/local/tce.menu^+<code> 
 +tc@box:/tmp/extension$ mkdir usr/local/tce.menu 
 +</code>
 If you do not want a menu entry: If you do not want a menu entry:
-^tc@box:/tmp/extension$ touch usr/local/tce.menu/zzzmymount^+<code> 
 +tc@box:/tmp/extension$ touch usr/local/tce.menu/zzzmymount 
 +</code>
 If you do: If you do:
-^tc@box:/tmp/extension$ nano usr/local/tce.menu/zzzmymount^ +<code> 
-^<JWM>+tc@box:/tmp/extension$ nano usr/local/tce.menu/zzzmymount 
 +</code> 
 +<code> 
 +<JWM>
 <Program label="Mount MP3s">/usr/local/bin/mountmp3s</Program> <Program label="Mount MP3s">/usr/local/bin/mountmp3s</Program>
-</JWM>^+</JWM> 
 +</code>
 (note: capitalization is important in the tags) (note: capitalization is important in the tags)
-==== #Create icon entry ==== + 
-^tc@box:/tmp/extension$ mkdir usr/local/tce.icons +==== Create icon entry ==== 
-tc@box:/tmp/extension$ nano usr/local/tce.icons/zzzmymount^ +<code> 
-^i: /usr/local/tce.icons/mountmp3s.png+tc@box:/tmp/extension$ mkdir usr/local/tce.icons 
 +tc@box:/tmp/extension$ nano usr/local/tce.icons/zzzmymount 
 +</code> 
 +<code> 
 +i: /usr/local/tce.icons/mountmp3s.png
 t: Mount MP3s t: Mount MP3s
 c: /usr/local/bin/mountmp3s c: /usr/local/bin/mountmp3s
- +</code>
-^+
 (note: make sure this file end in a newline. most editors do this automatically) (note: make sure this file end in a newline. most editors do this automatically)
-==== Add the icon ====+ 
 +==== Add the icon ====
 Search around the web for an icon you like. A good place to look is: Search around the web for an icon you like. A good place to look is:
 [[http://www.iconspedia.com|www.iconspedia.com]] Remember to use the name you specified in the icon file above. [[http://www.iconspedia.com|www.iconspedia.com]] Remember to use the name you specified in the icon file above.
-^tc@box:/tmp/extension$ wget -O usr/local/tce.icons/mountmp3s.png http://www.iconspedia.com/dload.php?up_id=16386^ +<code> 
-==== #Check permissions and ownership ==== +tc@box:/tmp/extension$ wget -O usr/local/tce.icons/mountmp3s.png http://www.iconspedia.com/dload.php?up_id=16386 
-^tc@box:/tmp/extension$ cd usr/local+</code> 
 + 
 +==== Check permissions and ownership ====
 +<code> 
 +tc@box:/tmp/extension$ cd usr/local
 tc@box:/tmp/extension/usr/local$ sudo chown -R root.staff tce* tc@box:/tmp/extension/usr/local$ sudo chown -R root.staff tce*
-tc@box:/tmp/extension/usr/local$ sudo chmod 775 tce*^ +tc@box:/tmp/extension/usr/local$ sudo chmod 775 tce* 
-==== Create the exension  ==== +</code> 
-(note: this requires squashfs-tools-4.0.tcz) + 
-^tc@box:/tmp/extension$ mksquashfs . ../zzzmymount.tcz^+==== Create the exension  ==== 
 +(note: this requires squashfs-tools-4.x.tcz) 
 +<code> 
 +tc@box:/tmp/extension$ mksquashfs . ../zzzmymount.tcz 
 +</code>
 The extension will be in /tmp. You can now load it to test it out: The extension will be in /tmp. You can now load it to test it out:
-^tc@box:/tmp/extension$ tce-load -i /tmp/zzzmymount.tcz^+<code> 
 +tc@box:/tmp/extension$ tce-load -i /tmp/zzzmymount.tcz 
 +</code>
 The icon and menu should now be visible and usable. The icon and menu should now be visible and usable.
 Finally move the new extension into your personal repo: Finally move the new extension into your personal repo:
-^tc@box:/tmp/extension$ cp ../zzzmymount.tcz $(cat /opt/.tce_dir)^+<code> 
 +tc@box:/tmp/extension$ cp ../zzzmymount.tcz $(cat /opt/.tce_dir) 
 +</code>
  
-==== Troubleshooting ====+==== Troubleshooting ====
 If you are creating icons for a package, pre-existing freedesktop configuration files may conflict with custom wbar icon files and settings. Check for a pre-existing freedesktop configuration at: /usr/local/share/applications/PACKAGENAME.desktop  If you are creating icons for a package, pre-existing freedesktop configuration files may conflict with custom wbar icon files and settings. Check for a pre-existing freedesktop configuration at: /usr/local/share/applications/PACKAGENAME.desktop 
 For details on how to configure that file for Tiny Core, read [[iconmenuinfo]]. For details on how to configure that file for Tiny Core, read [[iconmenuinfo]].
Print/export
QR Code
QR Code wiki:creating_personal_icons (generated for current page)