LinkedIn Sourceforge Twitter

Vincent's Blog

Pleasure in the job puts perfection in the work (Aristote)

Freeplane on OpenBSD

Posted on 2017-01-24 22:29:00 from Vincent in Open Bsd Project Management

As you can find in this blog, I'm a fervent user of freeplane to structure tasks, ideas, ...
With this new post on this blog, I will show you how simple it is to have such great tool on an OpenBSD desktop machine. So, you just need to have Xorg running. It can be via a windowing manager (Openbox, lumina, xfce, Gnome, ...)


Installation

Since freeplane is fully written in Java, the first step is to have the required java package installed on your machine.

pkg_add jdk

Once done, you can download the last stable version of"freeplane.zip" from sourceforge.net.

ftp -o download.zip  https://sourceforge.net/projects/freeplane/files/latest/download

Then, just unzip it.

unzip download.zip

If "unzip" is not present on your system, just add it by doing:

pkg_add unzip

Running it

To run freeplane, you just have to do:

java -jar <freeplane>/freeplanelauncher.jar

Installing it

To make is a bit more "better", I propose you to place the whole code pf freeplane in /usr/loca/libexec/

mv <freeplane> /usr/local/libexec

Then, we make a small startup script like this:

#!/bin/sh
/usr/local/jdk-?.?.?/bin/java -jar /usr/local/libexec/<freeplane>/freeplanelauncher.jar

We will place it in /usr/local/bin.

Going further

To go a bit further, you could create a “.desktop” file so that your window-environment will add it automatically in the correct menu of your system.

Just create a file called “freeplane.desktop” with this content:

[Desktop Entry]
Exec=freeplane.sh
Icon=<ICON>
Terminal=false
Type=Application
StartupNotify=true
Categories=Office;
Name=Freeplane
Comment=Mind mapping tool

Where will be /usr/local/libexec//freeplane.png

I propose you to put this .desktop file in /usr/local/share/applications

All steps in one.

To simplify the tasks, I propose you a simple script which does all those tasks in once.
Just run it and all steps described here above will be done for you.

Just copy/paste it in a file and turn this file as "executable".

#!/bin/sh -ex

VERSION=""

downnload() {
   if [ -f download.zip ]; then
      rm download.zip
   fi
   ftp -o download.zip https://sourceforge.net/projects/freeplane/files/latest/download 
}

uncompress () {
   unzip download.zip
}

getversion () {
   VERSION=`ls | grep freeplane`
}

mv_freeplane () {
doas mv $VERSION /usr/local/libexec
}

create_exec () {
  cat <<_EOF > freeplane.sh
#!/bin/sh
/usr/local/jdk-?.?.?/bin/java -jar /usr/local/libexec/$VERSION/freeplanelauncher.jar
_EOF
  chmod +x freeplane.sh
}

install_exec () {
  doas mv freeplane.sh /usr/local/bin
}

create_desktop () {
ICON="/usr/local/libexec/$VERSION/freeplane.png"
  cat <<_EOF > freeplane.desktop
[Desktop Entry]
Exec=freeplane.sh
Icon=$ICON
Terminal=false
Type=Application
StartupNotify=true
Categories=Office;
Name=Freeplane
Comment=Mind mapping tool
_EOF

}

install_desktop () {
  doas mv freeplane.desktop /usr/local/share/applications
}

#if you just want to skip one step, comment it
downnload
uncompress
getversion
echo "VERSION: $VERSION"
mv_freeplane
create_exec
install_exec
create_desktop
install_desktop


2, 2
displayed: 685



What is the second letter of the word Python?