User avatar
jonwitts
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 67
Joined: Fri Oct 17, 2014 3:45 pm
Location: Kingston upon Hull
Contact: Website

Adding Scratch 2 and Thonny to the Application launcher bar

Thu Jul 20, 2017 7:54 pm

Hi there,

I manually installed Scratch 2 and Thonny on my Pi the other day as I have lots of files and settings on this Pi which I did not want to reinstall after loading a fresh image. All seems well and Thonny is now my default editor for my Python files (Yeah - no more IDLE!). So I wanted to replace my launcher icon for IDLE on my Task Bar with a launcher for Thonny, but it does not appear in the list of applications and neither does Scratch 2 - see attachment...
menus.jpg
menus.jpg (59.4 KiB) Viewed 7115 times
Is this a bug with the manual install of these two packages or is this the same with the current image?

Cheers,
Jon

User avatar
jonwitts
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 67
Joined: Fri Oct 17, 2014 3:45 pm
Location: Kingston upon Hull
Contact: Website

Re: Adding Scratch 2 and Thonny to the Application launcher

Thu Jul 20, 2017 7:56 pm

Just realised that image is a bit tiny... You can see the full sized one here: https://drive.google.com/open?id=0B37Gg ... G51N241cnc

User avatar
bensimmo
Posts: 5500
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Adding Scratch 2 and Thonny to the Application launcher

Fri Jul 21, 2017 9:37 am

It's a feature of the Raspbian Desktop, it's always been like that. Same thing has happened though pre-PIXEL, PIXEL, Raspberry Pi Desktop now. It's the flaw with everything not reading from the same place, or lightweight desktops.

User avatar
bensimmo
Posts: 5500
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Adding Scratch 2 and Thonny to the Application launcher

Fri Jul 21, 2017 9:54 am

ok so, grabbed a recent Pi I updated the same as you.

blah blah blah
we need to copy from
/usr/share/applications
to
/usr/share/raspi-ui-overrides/applications

it seems
and a quick cut and paste from the file manager for path and names we get

Code: Select all

sudo cp /usr/share/applications/Thonny.desktop /usr/share/raspi-ui-overrides/applications
and

Code: Select all

sudo cp /usr/share/applications/scratch2.desktop /usr/share/raspi-ui-overrides/applications
and they should be there with no need to restart.
sudo because it wouldn't copy otherwise.

User avatar
jonwitts
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 67
Joined: Fri Oct 17, 2014 3:45 pm
Location: Kingston upon Hull
Contact: Website

Re: Adding Scratch 2 and Thonny to the Application launcher

Sat Jul 22, 2017 12:10 am

bensimmo wrote:It's a feature of the Raspbian Desktop, it's always been like that
Feature or bug? Surely it should be there when I add a new application? I will check to see if it is available on the latest image without having to copy it over...

Thanks for the tip BTW :-D

User avatar
bensimmo
Posts: 5500
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Adding Scratch 2 and Thonny to the Application launcher

Sat Jul 22, 2017 6:56 am

I think feature, since it installs fine but doesn't make it's way into the customised area. It has always been like that it's not a bug ;-)
It would be a bug if they actually tried to get it to copy across and it wasn't.
Fresh installs tend to have it there.

I've posted to the blog announcement, as this is Simon Long area.
Last edited by bensimmo on Sat Jul 22, 2017 7:11 am, edited 1 time in total.

gkreidl
Posts: 6345
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Adding Scratch 2 and Thonny to the Application launcher

Sat Jul 22, 2017 7:09 am

All Debian (Raspbian) GUI applications store their desktop files in /usr/share/applications. That's the rule. If an application does not appear in the program menu afterwards I call that a bug.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

User avatar
bensimmo
Posts: 5500
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Adding Scratch 2 and Thonny to the Application launcher

Sat Jul 22, 2017 7:12 am

And I can't find where in github this would be at the moment.
Last edited by bensimmo on Sat Jul 22, 2017 7:13 am, edited 1 time in total.

User avatar
jonwitts
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 67
Joined: Fri Oct 17, 2014 3:45 pm
Location: Kingston upon Hull
Contact: Website

Re: Adding Scratch 2 and Thonny to the Application launcher

Sat Jul 22, 2017 7:12 am

gkreidl wrote:All Debian (Raspbian) GUI applications store their desktop files in /usr/share/applications. That's the rule. If an application does not appear in the program menu afterwards I call that a bug.
Yeah, I would tend to agree. Surely we would want all new applications to also be present in the applications launcher menu too?

User avatar
bensimmo
Posts: 5500
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Adding Scratch 2 and Thonny to the Application launcher

Sat Jul 22, 2017 7:14 am

No, Raspian uses its own GUI overrides area away from the debian default.
It does need fixing though.

User avatar
jonwitts
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 67
Joined: Fri Oct 17, 2014 3:45 pm
Location: Kingston upon Hull
Contact: Website

Re: Adding Scratch 2 and Thonny to the Application launcher

Sat Jul 22, 2017 7:29 am

I've just started up my Pi to test out the copy operation and lo and behold; there is Scratch2 and Thonny in the list... I wonder if it needed a reboot for the menus to get updated?
menus2.jpg
menus2.jpg (56.39 KiB) Viewed 6962 times
And just to show they haven't been copied over...
menus3.jpg
menus3.jpg (56.48 KiB) Viewed 6962 times

User avatar
bensimmo
Posts: 5500
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Adding Scratch 2 and Thonny to the Application launcher

Sat Jul 22, 2017 7:41 am

Reboots didn't do it for me and I have a few setups like that.

Though you did make me go and find a way to fix it for my setups.

Unless there has been another update to rpd-whatever-mystical-stuff that has come afterwards adding them and I've not picked that up.

Anyways, see you at #HullRaspJam when you pick a date and I guess we may see SonicPi v3 in the next Raspbian update. (I missed that event :-( )

gkreidl
Posts: 6345
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Adding Scratch 2 and Thonny to the Application launcher

Sat Jul 22, 2017 7:50 am

bensimmo wrote:No, Raspian uses its own GUI overrides area away from the debian default.
It does need fixing though.
That's not "Raspbian" (which is behaving bravely), but the set of changes implemented by raspberrypi-ui-mods. Sometime newly installed GUI programs appear in the program menu, sometimes not. Sometimes re-installation helps, sometimes not. The overrives folder does not contain all the desktop files which appear in the menu.

Meanwhile I have removed the ui-mods from all my RPis but one (for testing new software) and everything works as it should.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

User avatar
jonwitts
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 67
Joined: Fri Oct 17, 2014 3:45 pm
Location: Kingston upon Hull
Contact: Website

Re: Adding Scratch 2 and Thonny to the Application launcher

Sat Jul 22, 2017 8:23 am

bensimmo wrote:Anyways, see you at #HullRaspJam when you pick a date and I guess we may see SonicPi v3 in the next Raspbian update. (I missed that event :-( )
Yeah I missed it too :-(

At the kids swimming lessons ATM. Looking like first or second Saturday of September for the Jam, just need to sort logistics...

User avatar
jonwitts
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 67
Joined: Fri Oct 17, 2014 3:45 pm
Location: Kingston upon Hull
Contact: Website

Re: Adding Scratch 2 and Thonny to the Application launcher

Sat Jul 22, 2017 8:27 am

gkreidl wrote:Sometime newly installed GUI programs appear in the program menu, sometimes not. Sometimes re-installation helps, sometimes not. The overrives folder does not contain all the desktop files which appear in the menu.

Meanwhile I have removed the ui-mods from all my RPis but one (for testing new software) and everything works as it should.
There was someone over on the RCE Slack channel who was experiencing issues with Scratch2 not appearing in the menu at all. Guess it will come down to the same issue...

I have another Pi I can test this on at work, but that'll have to wait as I have two weeks leave from now! :-D

User avatar
bensimmo
Posts: 5500
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Adding Scratch 2 and Thonny to the Application launcher

Sat Jul 22, 2017 10:54 am

You'll be able to build some PiZero waterproof transponders and monitors to track the kids efforts while they swim and pack a nice HUD into the goggles.

:lol:


gkriel, the desktop is classed as raspbian here, it comes as part of it for us normal users, by default.
It only doesn't if you choose to use a light version of Raspbian or remove it.

spl23
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 440
Joined: Fri Dec 26, 2014 11:02 am

Re: Adding Scratch 2 and Thonny to the Application launcher

Sat Jul 22, 2017 2:57 pm

The /usr/share/raspi-ui-overrides/applications directory is prepended to the path where the menu launcher looks for desktop files, but /usr/share/applications should still be on the path. This means that any desktop file in the raspi-ui-overrides/applications directory overrides any file with the same name in the /usr/share/applications directory - we do this to hide some applications which get installed by default and which otherwise would reappear whenever software was updated.

This mechanism works for me - if I install applications via apt, they appear in the menu when the installer puts a desktop file into /usr/share/applications. If it isn't working for you, I suspect that somehow /usr/share/applications has vanished from your desktop file search path.

Check the environment variable XDG_DATA_DIRS - it should be something like "/usr/local/share:/usr/share/raspi-ui-overrides:/usr/share:..." - if /usr/share isn't in it, that's why the applications aren't showing up.

This is set by default in the first line of /usr/bin/startlxde-pi - if you are using some other means to start your desktop, or that file is incorrect for some reason, you'll need to amend the search path by setting XDG_DATA_DIRS correctly as above.

User avatar
jonwitts
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 67
Joined: Fri Oct 17, 2014 3:45 pm
Location: Kingston upon Hull
Contact: Website

Re: Adding Scratch 2 and Thonny to the Application launcher

Sat Jul 22, 2017 3:07 pm

The programs were appearing in the menu for me after installing, they were not appearing in the list of applications available to add to the taskbar application launcher (see screen grabs in earlier post).

That said after a reboot of the Pi the new applications are now showing in the taskbar application launcher list...

Thanks,
Jon

spl23
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 440
Joined: Fri Dec 26, 2014 11:02 am

Re: Adding Scratch 2 and Thonny to the Application launcher

Sat Jul 22, 2017 3:27 pm

jonwitts wrote:The programs were appearing in the menu for me after installing, they were not appearing in the list of applications available to add to the taskbar application launcher (see screen grabs in earlier post).
I've got no idea why programs aren't appearing in that plug-in, but I've not changed any code in it that should affect this - that said, there are lots of bugs lurking in various parts of LXDE that I haven't got around to tracking down yet. I'd guess that the settings box only scans the relevant directories at boot; not really the right way to do it, but probably makes opening the settings box faster.

Return to “Raspberry Pi OS”