Adding things to the menu and taskbarIf a program is already in the main menu, adding it to the taskbar can be done various ways, fairly simply. First, try showing it in the main menu, then right clicking it - often "add to taskbar" will show up. But what if you have something that didn't have the install for an icon and menu entry that *really* wants a taskbar entry?
Here, I'm thinking of scrot, a screen capture utility that is, as installed, command-line only. Do I really want a screen shot of my typing in of the screen capture command?
To be fair, scrot does allow for a delay so you can hide that before the shot is taken..but it's a pain. Set the delay long, and it's wearisome, set it short and you've got to move fast. Lose-lose.
I started with this link:
http://wiki.lxde.org/en/Main_Menuwhich gives some of the info on how to do this, though if you look at most of the system-supplied .desktop files, you'll find a lot of other things in them, often translations to many languages. I'm not going to do that here, as I speak US English (sorta).
Obviously, to show an icon, you need to have one. By looking for the name of a relatively rare app I have installed that works correctly, I found a whole directory of tons of icons, most of which aren't in use and probably will never be - who's going to run virtual-box on a Pi, for example? Or use this tiny thing to capture raw many-megapixel camera data? Fair game to use icons no one else is using, and saves you the trouble of making your own.
Here's where to look: /usr/share/app-install/icons
(there are probably other spots as well)
I'm going to use this one: /usr/share/app-install/icons/gtkam-camera.png
The SD card in my camera is bigger than most in Pi's, I won't be using them to store what they can't hold anyway. That said - I can get pix from my camera and put them on my big wifi share, then post them from the pi, like this:
- Yes, we are setup for maximum fun here. Pi's, cameras, kludge boards, big USB sticks....touchscreens...
Well, it turns out some of the info at the links above is just plain wrong. The menuing system has changed,, and following the directions on the *official LXDE site* doesn't work! Hence the value of this series of posts - this works.
Install the program, in this case, scrot (I used synaptic).
Make the .desktop file. Here is mine for this case:
- Code: Select all
[Desktop Entry]
Encoding=UTF-8
Exec=scrot
Icon=/usr/share/app-install/icons/gtkam-camera.png
Type=Application
Terminal=false
Name=scrot
GenericName=Screenshot
StartupNotify=false
Categories=Accessories
I was too lazy to make my own icon, and found a bunch of unused ones at the directory shown in the scrot.desktop file above, which I put where the LXDE site said (both places, actually, while I was thrashing round trying to make their way work). Then I tried their commands for adding it to the menu. No go, no matter what I used for categories...it did show up as an "Other" which the new LXDE won't display anymore (maybe good, it tended to be very cluttered and have absolutely everything in it). What do do? Ah, totally unmentioned in all the dox is where the taskbar setup file is, and its syntax, though it's fairly easy to guess given an example (thank heavens, as there appears to be zero documentation out there).
Here's my copy after editing:
- Code: Select all
# lxpanel <profile> config file. Manually editing is not recommended.
# Use preference dialog in lxpanel to adjust config when you can.
Global {
edge=bottom
allign=left
margin=0
widthtype=percent
width=100
height=36
transparent=0
tintcolor=#ffffff
alpha=0
autohide=1
heightwhenhidden=2
setdocktype=1
setpartialstrut=1
usefontcolor=0
fontsize=12
fontcolor=#b25d5d
usefontsize=1
background=0
backgroundfile=/usr/share/lxpanel/images/background.png
iconsize=36
}
Plugin {
type=space
Config {
Size=2
}
}
Plugin {
type=menu
Config {
name=Menu
image=/usr/share/raspberrypi-artwork/raspitr.png
system {
}
separator {
}
item {
name=Run...
image=gnome-run
command=run
}
separator {
}
item {
name=Shutdown...
image=gnome-logout
command=logout
}
}
}
Plugin {
type=space
Config {
Size=8
}
}
Plugin {
type=launchbar
Config {
Button {
id=/usr/share/applications/iceweasel.desktop
}
Button {
id=/usr/share/applications/pcmanfm.desktop
}
Button {
id=/usr/share/applications/lxterminal.desktop
}
Button {
id=/usr/share/applications/arduino.desktop
}
Button {
id=/usr/share/applications/gedit.desktop
}
Button {
id=/usr/share/raspi-ui-overrides/applications/galculator.desktop
}
Button {
id=/usr/share/applications/geany.desktop
}
Button {
id=/usr/share/applications/ghex.desktop
}
Button {
id=/usr/share/applications/scrot.desktop
}
}
}
Plugin {
type=space
Config {
Size=8
}
}
Plugin {
type=taskbar
expand=1
Config {
tooltips=1
IconsOnly=0
ShowAllDesks=0
UseMouseWheel=1
UseUrgencyHint=1
FlatButton=0
MaxTaskWidth=200
spacing=1
GroupedTasks=0
}
}
Plugin {
type=space
Config {
Size=2
}
}
Plugin {
type=tray
Config {
}
}
Plugin {
type=space
Config {
Size=2
}
}
Plugin {
type=cpu
Config {
ShowPercent=1
}
}
Plugin {
type=dclock
Config {
ClockFmt=%R
TooltipFmt=%A %x
BoldFont=0
IconOnly=0
CenterText=0
}
}
Plugin {
type=space
Config {
Size=2
}
}
The part I added is in color. (well, I tried, the board sofware evidently doesn't color things inside code tags. Here is is outsite them:
Button {
id=/usr/share/applications/scrot.desktop
} Obviously, the other stuff had to be done for this to be able to point to it. the filepath is:
/home/pi/.config/lxpanel/LXDE-pi/panels/panel (no kidding, and thet period in the front of the .config means it's hidden and you have to use ctrl-h in the file browser to even see it or anything under it). Of course, most apps do all this and more - just in case, due to the changing standards and shall I call it bloat? typical of all modern opsys - we leave some old junk in there just in case someone has an older version for backward incompatability just in case.
Two for the price of one - the above pic but shown on the pi screen via this mechanism at work:
- Heh, take a picture of yourself...
This post was generated on the pi-2 using iceweasel, gimp, scrot, gedit...all the usual suspects. A little slower than my super-machines, but not enough to make me get up and do it over there.
The sharp eyed will notice some wratten IR pass filters in the picture, so we can have more fun with that NOIR filter camera...
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.