Gtk+3 Setup for Linux Mint

Linux specific questions.
Post Reply
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Gtk+3 Setup for Linux Mint

Post by lizard »

Here i want to share my experiences with setup Gtk+3 on Mint 18.2 Cinnamon. i have written it in a shell-script for later use. It was saved with extension .bash and made executable with chmod +x. All the examples that come with fbc in folder gui/gtk+ compile (except one of the deprecated).

Code: Select all

#!/bin/bash
# install_freebasic.bash

# download freebasic32 from:
# https://www.freebasic-portal.de/downloads/aktuelle-compiler/freebasic-1-05-0-fuer-linux-x86-376.html

# german documentation in .chm:
# https://www.freebasic-portal.de/befehlsreferenz/

# install FreeBasic 1.05 32bit
cd ~/downloads/FreeBASIC-1.05.0-linux-x86
sudo ./install.sh -i

# update system
sudo apt-get update

# install dependencies
sudo apt-get install gcc libncurses5-dev libffi-dev libgl1-mesa-dev
sudo apt-get install libx11-dev libxext-dev libxrender-dev libxrandr-dev libxpm-dev

# cairo and goocanvas
sudo apt-get install libcairo2-dev libgoocanvas-dev

# find packages if necessary
# apt-cache search libgtk-3-0

# install gtk+
sudo apt-get install libgtk2.0-dev libgtk-3-dev libgtksourceview-3.0-dev
#sudo apt-get install  libglade2-dev 

# install geany and  kchmviewer for use with geany
sudo apt-get install geany kchmviewer
Thats what i copied from terminal. Hope i haven't forgotten something.
Last edited by lizard on Dec 17, 2017 8:44, edited 6 times in total.
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: Gtk+3 Setup for Linux Mint

Post by Munair »

Looks pretty OK to me. If you want to use GtkSourceView from FreeBASIC, it needs to be installed too.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: Gtk+3 Setup for Linux Mint

Post by lizard »

Is that useful?

That would be

sudo apt-get install libgtksourceview-3.0-dev

Right?
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: Gtk+3 Setup for Linux Mint

Post by Munair »

Yes that's the one, it is only useful if you want a syntax highlight editor. It is based on GtkTextView. But unlike GtkTextView, it is not installed by default.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: Gtk+3 Setup for Linux Mint

Post by lizard »

Pasted it in first post listing. Naturallly it would be possible to do all in one line with only one sudo. It's fascinating how easy it is with apt-get, compared to find, download and compile everything.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: Gtk+3 Setup for Linux Mint

Post by lizard »

Installed now on Kubuntu that way, Seems to work on all Ubuntu or maybe debian derivates.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: Gtk+3 Setup for Linux Mint

Post by lizard »

Commented libglade2-dev out in script. It installs loads of libraries, but seems to have no sense.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: Gtk+3 Setup for Linux Mint

Post by lizard »

It may seem unsecure to install packets in this way. But it is actually the same system as if you install with the systemmenu or with synaptic. Normally all the thousands packets of the ubuntu repository match perfectly together, thats my experience. Only if you switch the box off while installing, then in seldom cases it maybe the packet system don't work anymore. Then you can do a "sudo apt-get update" to get the errormessage and google for it. It may be necessary to delete a single file like "extended-properties" and everything works again.

A second common problem is when the boot process stops, saying you should "do fsck manually". Then you have to start the live dvd and in terminal do a "sudo fsck /dev/hda" or similar to check that partition where the errors occured. Then everything is fine again.

Strange, normally you would think an OS does such things automatically. But aside of such little problems Linux Mint 18.2 works perfectly here. It is fast, has a lot of software, looks good and i am really glad to have such an great OS.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: Gtk+3 Setup for Linux Mint

Post by lizard »

As i myself am delving into Linux more and more i feel to talk about how to optimize Linux in general, Ubuntu and Mint with FreeBasic in particular.

After installation you may find your Linux sometimes to be fast as a snail. Then there are two steps to speed up:

1. Installing propiertary drivers with menu. In this window it searches the net for avaiable drivers. Usuallly there are two, one for the graphics card, one for the mainboard. Installing them mostly speeds up a lot.

2. If the machine has less than 2 GB ram it will usually slow down when begin swapping. Thats why it is useful to reduce the happiness to swap (swappiness). To see the actual swappiness of your box type following line in terminal:

Code: Select all

cat /proc/sys/vm/swappiness
The result will probably be 60. That may be good for a server but not for a box with less than 2 GB ram. Thats why to install a few tools quickly which are not included in standard installation.

Code: Select all

sudo apt-get install synaptic dconf-tools gksu gdebi inxi leafpad catfish p7zip-rar pavucontrol
Now we can do a

Code: Select all

gksudo leafpad /etc/sysctl.conf
and add the following after the last line

Code: Select all

# Decrease swap usage to a more reasonable level
vm.swappiness=10
If ram is below 1 GB it may be even good to reduce swappiness to 5.

Save, reboot and enjoy your fast and shiny Linux Mint. :-)


Feel free to tell your experiences with optimizing Linux for FreeBasic.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: Gtk+3 Setup for Linux Mint

Post by lizard »

Once Mint is installed, one may want to install further distros. Mint or other ubuntus require at least 5-8 GB + some space for extra stuff ~ 30 GB each on a separate partition. On installatlion already installed distros are detected, but Grub displays them in the bootloader in a limited list. A distro can occupy up to 7 entrys, so that you can`t see all entries of all distros, and thus not choose each distro when booting.

Thats when Grub-customizer comes handy:

Code: Select all

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer
from here (german)
https://www.linuxmintusers.de/index.php?topic=2457.0

With this tool it is easy to create a proper boot menu even with background pic. Here it worked in first attempt. I only wonder why it is not included in standard mint and ubuntu distros.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: Gtk+3 Setup for Linux Mint

Post by lizard »

If building up a complete new box i would do it this way:

1. On a unpartitioned HD of, say, 500 GB create a ntfs partition of 100 GB for windows, that should be enough.
2. Leave the rest of HD unpartitioned. That can be done later with GParted in Mint.
2. Install windows.
4. Install Mint from live dvd on a new created ext4 partition with ~30 GB.
5. Now Grub has created a boot menu where you can choose between booting Win or Mint.
6. In Mint you can create extra ext4 or ntfs partitions with GParted and install further distros as you wish.
7. Each installation will create a new boot menu with windows and all detected distros.
8. If there are many distros you can use Grub-customizer to create a proper boot menu.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: Gtk+3 Setup for Linux Mint

Post by lizard »

lizard wrote:Thats when Grub-customizer comes handy
Now i have recommended Grub-Customizer i feel a little responsible if users run in troubles with it. Needless to say, it should be used with outer care. You know Linux, one mistake in bootmenu and nothing works anymore.

Best to change as less as possible in the menu it creates automatically from the grub files. Especially in the third tab only load the background picture, nothing else. Do not change the font. No other font gives the frame like wanted. But there is a easy way to restore the default font by clicking the red cross right of it.

With the "Themes" in this tab on upper right corner one has to learn for hours if not days and reboot each time, so better not to change anything in third tab of Grub-Customizer, except background picture.

First and second tab are working as expected. You can create, move and delete entries as you wish. If there is a mistake in creating a new entry there is only a error message, no serious problem.

Once one has designed his menu he must save his settings and then in menu "Install in MBR".
Post Reply