GeoGebra

GeoGebra in Linux

Jump to: navigation, search

This article contains some simple "howtos" to make your work in Linux with GeoGebra more convenient. Some of them work only for Gnome and have been tested only on Ubuntu.

Contents

Installation

Portable version

Download the archive from http://www.geogebra.org/cms/en/portable. When you extract this archive, a sub-directory called geogebra-portable-<version> will be created. To run GeoGebra Portable, execute the start script geogebra-portable, which you find in this sub-directory.

If you want to run GeoGebra Portable from command line, you should make a symbolic link called geogebra somewhere in your PATH (e.g. /usr/bin/), that points to the start script. For example, if you have extracted the archive into /usr/share/ and want to create the symlink in /usr/bin/, type

sudo ln -s /usr/share/geogebra-portable-<version>/geogebra-portable /usr/bin/geogebra

This will allow you to open ggb files from terminal using command

geogebra "myfilename.ggb"

You may also use command line arguments to add options:

geogebra [OPTIONS] [FILE]

For example, the following command starts GeoGebra in German and opens myfilename.ggb:

geogebra --language=de "myfilename.ggb"

Use option --help for more information.

Debian/Ubuntu

Main article: Package for Ubuntu and Debian

ArchLinux

There is an AUR package for geogebra, wich provides a desktop item, MIME-types and file association. The KDE thumbnailer (by Ariel Constenla-Haile) provided below is packaged as geogebra-thumbnailer-kde.

Webstart

You can run and install GeoGebraWebstart from http://www.geogebra.org/webstart/geogebra.jnlp.

Icon in KDE

In KDE, the JavaWebstart does not insert an Icon on the dektop like it is done in Windows. There are two possibilities to use Webstart on you Linux-PC:

  • Create an Icon that refers to the Webstart-Version
  • Use the ... of Webstart

Icon in Gnome

In new versions of Gnome an (ugly looking text-style) icon is created on the Desktop. It is named similar to "jws_app_shortcut_1264508015747.desktop" and starts GeoGebra from Java-cache (it usually runs offline from cache and checks for / installs updates automatically when Internet is available). When you mark it trustworthy, the GeoGebra icon is displayed and its display name changes to "GeoGebra WebStart". In some versions of gnome, there is no "Mark trustworthy option". You can do it by changing the file to executable, e.g. by running

 chmod +x ~/Desktop/jws*

If the "jws_app_shortcut..." Icon doesn't appear you can run:

javaws -viewer

In "Java Cache Viewer" (accessible via General - Temporary Internet Files - View... ) choose GeoGebra and press the button "Install shortcuts".

To add GeoGebraWebstart to the Gnome applications menu (yes, it works offline, too) use alacarte (the Gnome menu editor). The command to enter can be found in the mentioned "jws_app_shortcut_... .desktop" file (see the line "Exec=..."). The path to your local GeoGebra icon is found there, too.

Of course you instead can copy / move the file to ~/.local/share/applications/geogebra.desktop . To put it in the "Education" folder, edit the file and add ";Education;Math;" to the line starting with "Categories=".

Startscript

If you want to run GeoGebra WebStart from command line, you should make a script called geogebra (without extension) somewhere in your PATH (e.g. /usr/bin/). Content of such a script can be:

#!/bin/bash
if [ -z "$1" ]; then
    exec javaws 'http://www.geogebra.org/webstart/geogebra.jnlp'
else
    exec javaws -open "$1" 'http://www.geogebra.org/webstart/geogebra.jnlp'
fi

Setting mime-type

If GeoGebra files aren't recognized as application/vnd.geogebra.file (this can be checked using right click on the file + properties), we might want to fix it so that we can associate GeoGebra files with GeoGebra.

To achieve this we will have to add a mime info file to the folder /usr/share/mime/packages describing the GeoGebra mime-type. You can download such file this way:

cd /usr/share/mime/packages
sudo wget http://www.geogebra.org/svn/branches/ggb32/geogebra/unix/usr/share/mime/packages/geogebra.xml
sudo update-mime-database /usr/share/mime

After restarting the X-server mime-types should be recognized correctly.

Associating files with application

... with Gnome

If Gnome recognizes the mime type, you can associate GeoGebra files with GeoGebra. Right-click the file, in menu select "Open with ...". Click "custom command" and type "geogebra". Note this would work only if you have file geogebra somewhere in your path with content described above.

If you use GeoGebra WebStart you instead can enter the "custom command" (in "Open with ..."):

javaws -open %C -localfile /home/user/.java/deployment/cache/6.0/2/5cf48382-...

Please change the path to your localfile as it contains a username and a number that seems to be randomly choosen. To find your correct path and filename just drag the Webstart-Icon (on the Desktop) to gedit and look at the line starting with "Exec=...".

... with KDE

If KDE recognizes the mime type, you can associate GeoGebra files with GeoGebra. To do so, it is sufficient to copy geogebra.desktop file into /usr/share/applications/ .

Note this would work only if you have file geogebra somewhere in your path with content described above.

Icons

To make Gnome and KDE show icons (application symbol and MIME type symbols), copy GeoGebra_hicolor_icons.tar.gz into /usr/share/icons/ and extract it this way:

cd /usr/share/icons
sudo tar -xvzf GeoGebra_hicolor_icons.tar.gz

To make Gnome and KDE show MIME type icons that integrate well into the KDE/Oxygen icon theme (http://www.oxygen-icons.org), copy GeoGebra_oxygen_icons.tar.gz into /usr/share/icons/ and extract it this way:

cd /usr/share/icons
sudo tar --strip-components=1 -xvzf GeoGebra_oxygen_icons.tar.gz

Thumbnails

... with Gnome 2

To make Gnome show thumbnails of our files we have to create a thumbnailer script like this:

#!/bin/bash

urldecode(){
  echo -e "$(sed 'y/+/ /; s/%/\\x/g')"
}

mkdir /tmp/ggthumb
f=`echo -n $3| sed 's/file:\/\///'|urldecode`
cp "$f" /tmp/ggthumb/ggt.zip
unzip -qq /tmp/ggthumb/ggt.zip -d /tmp/ggthumb
convert -resize $2 /tmp/ggthumb/geogebra_thumbnail.png $4 2>/dev/null
echo "$3 $f $?">>/tmp/glog
rm -rf /tmp/ggthumb 

Save this content to file called "ggthumb" (without extension) and change it to executable (chmod +x in console). Now we must make Gnome associate our thumbnailer. Let's suppose the script is located in /home/kondr/bin. We run these commands

gconftool -s /desktop/gnome/thumbnailers/application@vnd.geogebra.file/enable true --type boolean
gconftool -s /desktop/gnome/thumbnailers/application@vnd.geogebra.file/command "/home/kondr/bin/ggthumb -s %s %u %o" --type string

and icons of newly saved files should appear.

... with KDE 4 by Ariel Constenla-Haile

http://www.geogebra.org/download/GeoGebra_Thumbnail_KDE.tar.gz