WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Trouble with launching apps from menu and wBar entries (solved)  (Read 4471 times)

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Ok new project in need of a little help please creating wbar and menu items with icons (wbar only) and getting the app to launch from them.


Currently the app will launch from the "Run" menu and from a "terminal window", however attempting to launch from the desktop right click menu and / or the wbar menu fails on both counts.



« Last Edit: July 11, 2011, 06:52:19 PM by coreplayer2 »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Trouble with launching apps from menu and wBar entries
« Reply #1 on: July 06, 2011, 12:06:36 PM »
Using this topic as a guide,  although I fear this is old stuff perhaps no longer valid..
http://forum.tinycorelinux.net/index.php?topic=1508.msg14022#msg14022

I created the directory structure and placed the files for my trial app called "searchmonkey" as described above

(pictures no longer accurate nor needed)

edited the icon and menu file as described then packaged it up
Code: [Select]
tc@box:/tmp/searchmonkey/package$ cd ..
tc@box:/tmp/searchmonkey$ sudo mksquashfs package/ searchmonkey.tcz
Parallel mksquashfs: Using 1 processor
Creating 4.0 filesystem on searchmonkey.tcz, block size 4096.
[========================================================================================================================|] 56/56 100%
Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 4096
        compressed data, compressed metadata, compressed fragments, no xattrs
        duplicates are removed
Filesystem size 99.23 Kbytes (0.10 Mbytes)
        46.13% of uncompressed filesystem size (215.09 Kbytes)
Inode table size 309 bytes (0.30 Kbytes)
        57.43% of uncompressed inode table size (538 bytes)
Directory table size 139 bytes (0.14 Kbytes)
        59.40% of uncompressed directory table size (234 bytes)
Number of duplicate files found 0
Number of inodes 10
Number of files 4
Number of fragments 1
Number of symbolic links  0
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 6
Number of ids (unique uids + gids) 2
Number of uids 1
        tc (1001)
Number of gids 1
        staff (50)
tc@box:/tmp/searchmonkey$ sudo chown tc:staff searchmonkey.tcz
tc@box:/tmp/searchmonkey$

placed the extension in the Optional folder, ran the appbrowser to install it then rebooted.   no icon and no responce from the menu item, however the application still launches as it always has from the terminal and the "run" menu.

I'm guessing the procedure is no longer valid, but can't find an up to date satisfactory method.
« Last Edit: July 09, 2011, 02:42:32 PM by coreplayer2 »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Trouble with launching apps from menu and wBar entries
« Reply #2 on: July 08, 2011, 11:23:37 AM »
Although I'd selected to view this page http://wiki.tinycorelinux.net/wiki:creating_personal_icons before, up until today this page was not accessible eg it was blank  yet the page was apparently updated in May this year???   


This wiki page appears to be the instructions for a menu item and wbar menu icon, both of which may be used to start the application.   Unless anyone has any better suggestions I'll attempt to follow this guide..

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Trouble with launching apps from menu and wBar entries
« Reply #3 on: July 08, 2011, 01:10:22 PM »
Tiny Core is dynamic with regard to menu and icons.
You should make a proper extension. It is really not hard.
Hacking the system directly is at your own risk.
10+ Years Contributing to Linux Open Source Projects.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Trouble with launching apps from menu and wBar entries
« Reply #4 on: July 08, 2011, 03:37:31 PM »
Thanks for the vote of confidence.   Actually I thought I was making a proper extension...  lol

 So it looks like this page is finally up or back up  http://wiki.tinycorelinux.net/wiki:creating_personal_icons  I think this is the guide I should be following right?

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Trouble with launching apps from menu and wBar entries
« Reply #5 on: July 08, 2011, 05:59:39 PM »
That Wiki item still seems very dated to me.

A minimal extension could be as simple as for example, the wifi.tcz
It contains three files:

usr/local/bin/wifi.sh
usr/local/share/applications/wifi.desktop
usr/local/share/pixmaps/wifi.png

The script itself, the freedesktop item which specifies the menu and icon name and location, and finally the icon itself.

Place these three files in a directory of the same name as the extension, e.g., wifi

wifi/usr/local/bin/wifi.sh
wifi/usr/local/share/applications/wifi.desktop
wifi/usr/local/share/pixmaps/wifi.png

Issue the command:

mksquashfs wifi/  wifi.tcz

The only caveats are to ensure that the permission of the /usr/local/... directories are not changed from the existing ones.

« Last Edit: July 09, 2011, 11:09:07 AM by roberts »
10+ Years Contributing to Linux Open Source Projects.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Trouble with launching apps from menu and wBar entries
« Reply #6 on: July 09, 2011, 11:02:39 AM »
ok thanks I think I got it now :)

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Trouble with launching apps from menu and wBar entries
« Reply #7 on: July 09, 2011, 02:35:52 PM »
Oh yeah,  the secret sauce tastes so good!!

As described above thank you roberts (although followed and used the mindfield5 files and layout as templates)

placed the following files in their respective directories, then packaged them up into a tcz extension

application binary file  in a directory of the same name under usr/local/searchmonkey
the desktop configuration file (as shown here) in its usr/local/share/applications directory
the icon in usr/local/share/pixmaps directory



Now the menu item and wbar icon both launch the application promptly
Thanks guys

« Last Edit: July 09, 2011, 02:40:47 PM by coreplayer2 »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Trouble with launching apps from menu and wBar entries (almost)
« Reply #8 on: July 09, 2011, 11:29:23 PM »
Only issue with this approach is that the above app only shows an icon in the wbar when the app is set to load OnBoot,  when set to OnDemand there is no way to launch it from the wbar.

investigating

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11576
Re: Trouble with launching apps from menu and wBar entries (almost)
« Reply #9 on: July 10, 2011, 01:48:58 AM »
Hi coreplayer2
That's probably because it hasn't been mounted/loaded yet. Click on an empty part of the desktop and
go to the OnDemand part of the pop up menu. Your application should be there. Click on it and see
if the icon appears in the wbar.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Trouble with launching apps from menu and wBar entries (almost)
« Reply #10 on: July 10, 2011, 02:40:44 AM »
hi Rich,  yes I had run the app from the desktop menu and the icon does appear.  However the icon only stays there for the remainder of the session.    Loading/starting the app by any method places the icon on the wbar, (including when set to load OnBoot)   just the icon will never appear on the wbar when the app is set to load OnDemand.      

So i was wondering if there was some mechanism in place which creates an icon in the OnDemand directory when ever the app is loaded when OnDemand?   whether it is supposed to or not I don't know but icons are not created again if removed from OnDemand directory and the app started.  ??   Curiously, there are two apps which have their accompanying icons in the OnDemand directory, go figure because I didn't put them there, so there is some mechanism in place that does right?     50% of the apps in the OnDemand directory have icons with an img extension and the remaining apps at that location do not!?

More interestingly I created an icon for the above app and placed it along side within the OnDemand directory, rebooted and Voila!  The same icon appeared on reboot.  one step further, selecting the icon (which is nothing more than an icon with the same name) opened the application.!!

So if I may ask, what or who produces the icon for an app/extension when it is placed in a persistent OnDemand Folder please??  Maybe there was never meant for an icon to appear on the wbar when set to load OnDemand, this I am not aware of, but some apps have icons in this scenario.

My wild theory is perhaps TC is complying with the freedesktop through a app.desktop config file whilst attempting to accommodate any previous method, which I suspect is to display an app with an icon present in  OnDemand directory.   

any ideas?
« Last Edit: July 10, 2011, 03:24:11 AM by coreplayer2 »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Trouble with launching apps from menu and wBar entries (almost)
« Reply #11 on: July 11, 2011, 12:31:43 PM »
What, no more ideas?    Looks like two different mechanisms going on here??

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Trouble with launching apps from menu and wBar entries (almost)
« Reply #12 on: July 11, 2011, 02:53:28 PM »
Not every extension has an icon.

Only extensions with a single binary and with its freedesktop item having the specification X-FullPathIcon

Then when AppBrowser or AppsAdudit ondemand function is used a system generated startup script and system extracted icon will be placed in your tce/ondemand directory. 
10+ Years Contributing to Linux Open Source Projects.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Trouble with launching apps from menu and wBar entries (almost)
« Reply #13 on: July 11, 2011, 06:51:52 PM »
Thank you for the explanation, all makes sense now  kinda :)