My thoughts on Slackware, life and everything

Tag: gtk

Netsurf, a lightweight browser, works on the framebuffer too

Someone asked me to build a package for Netsurf. I had never heard of Netsurf before. It turns out that Netsurf is a cross-platform web browser which also runs on Linux. Its rendering engine is written from scratch, therefore the browser does not share code with any of the big browsers. Netsurf is actively developed and has a healthy community. A new version was released last week – 3.7.
Functionally speaking, this browser is not as versatile or capable as other modern browsers, but its advantage is that it is small, fast, suited for low-end hardware, and more importantly: it works on the Linux framebuffer. This means that you can have a basic graphical web browser on your server console. It looks better than “links -g”.
Note: even though Netsurf comes with both a GTK version (netsurf-gtk) and a framebuffer version (netsurf-fb), even the framebuffer binary make heavy use of X.Org and freetype libraries. So if you want to use the framebuffer browser on a server console, you need to install the X series anyway.

How to make Netsurf work on the Linux framebuffer, i.e. on the console?

  • Add your user to the “input” group so you can use the mouse (i.e. the /dev/input/mice device node) using the command (as root):
    # gpasswd -a your_username input
    If you are currently logged on, you need to logout and login again to make this change effective.
  • Determine the width and height of your framebuffer console to make maximal use of your screen dimensions (netsurf on a framebuffer defaults to a window of 800×600 pixels) by querying the /sys virtual filesystem and look for the characteristics of the fb0 framebuffer device:
    # cat /sys/class/graphics/fb0/virtual_size
    This will return width and height in pixels, comma-separated. In my case I get “1920,1080”.
  • Read the available documentation to learn about the limitations.

With the above taken care of, start the Netsurf framebuffer browser with:
$ netsurf-fb -w <width> -h <height>
… where <width> and <height> are the values obtained from the command further up.

Curious? Get the package from my regular repository (http://www.slackware.com/~alien/slackbuilds/) or any of its mirrors.

If you want to compile netsurf yourself, you’ll also need two dependencies, “perl-html-tagset” and “perl-html-parser“.

Handbrake – lost for Slackware

handbrake_logo Yesterday, I read about the newest release of Handbrake, the powerful video transcoder. I have handbrake in my Slackware repository, so I decided to dissect the source tarball for the 0.10.0 release and see what was needed to compile it into a package.

Boo hoo.

Handbrake 0.10.0 switched from a GTK+2 to a GTK+3 graphical user interface. Not only that, but it requires a version of GTK+3 that is not even contained in Slackware-current. We have 3.8.2 while handbrake uses functionality which was introduced with 3.10. We’re out in the cold, folks!

You might debate whether Slackware’s GTK+3 is not too old anyway, but then again, GTK releases are notorious for breaking all kinds of stuff thanks to ABI incompabilities. Slackware does not contain GNOME, so there is little reason to stay uptodate on the GTK+3 front when running the risk to break dependent packages.

Anyway, it means that you will not be getting a new handbrake package from me anymore. Perhaps when Slackware-current adopts a newer GTK+3 stack, I can reconsider. But even in that case, Slackware 14.1 and older will have to stick with handbrake 0.9.9 as the last release which will compile.

If time permits I will investigate the possibility of statically compiling GTK+3 plus several of other GTK+3 dependendants into the handbrake package. But that needs time which I do not have. You might already have guessed that – this blog has been pretty silent during the past month. Work related frustrations augmented by family issues, resulting in shifting priorities. To me, Slackware essentially is a hobby, it does not have to make me any money (even though some of you donated, for which my eternal gratefulness) and real life sometimes takes over.

If all you wanted to know was about handbrake then you can leave now.

So I’ll rant on if you cared to stay. Handbrake – big disappointment yesterday I must confess. I really liked that program. There’s also this general feeling of depression I have over the state of GNU/Linux, the Open Source community. my work on Slackware, and whether I can still make a difference. The effort I have put into Slackware, promoting the distro and Open Source in general, I’ve always enjoyed doing that. But the fun is eroding away, and there is this sense of stagnation. Things are moving perpendicular to the direction I want to go in. I am going to need some time for reflection around the end of 2014 and find a way to get invigorated again. Suggestions on a direction to take are welcome. There is not so much action around the distro currently. KDE 4 is about frozen, and KDE 5 is not mature. No joy there. LXQt seems to have jumped from Qt4 to Qt5, another step i do not like. Chromium dropped support for compiling NaCL support into 32-bit package – precisely the reason why I hate it that I need to depend on binary toolchains that are impossible to compile on Slackware. And what to do with my ARM port – I am looking at the mountain of work required to revive it. The list of recent frustrations is much longer than that, but you get the point… it all feels so pointless.

Depressed, you say? You bet! It must be an autumn feeling. Where’s the exit? Going to grab me a beer.

Eric

Running VLC in XFCE

As you may know I am using KDE for my daily work. However, I use XFCE from time to time – for example when I have to run a remote X session over XDMCP and want to keep a fluid feel to the desktop.

When I was working in XFCE yesterday I wanted to use VLC to check a video file on my computer, and I was in for a surprise when clicking “Media > Open file” made my VLC hang indefinitely!

I remembered a discussion about this phenomenon on LinuxQuestions.org and indeed the solution as pointed out in that thread works for me.

What happens here?

The core of the issue, is that Qt4 makes an incorrect assumption about which GTK+ theme engine to use. A GTK+ theme engine makes a Qt4 application blend in nicely with a GTK+ based desktop environment such as XFCE, by using GTK+ instead of Qt4 to render all graphical components.

There are a few GTK+ theme engines available – one of them is QGtkStyle which is part of Qt4 in Slackware. However, Qt4 libraries look at the environment variable “GTK2_RC_FILES” in order to find out how to configure the GTK theme engine.

If this environment variable is not (or incorrectly) set, then Qt4 assumes that GTK+ is using GTK-QT-Engine which is not part of Slackware (GTK-QT-Engine is used to give GTK appplications a Qt feel when they are running in KDE) and it will not correctly apply the QGtkStyle engine. It sets QGtkStyle to use the GTK style Clearlooks, and outputs an error message which you will sometimes be able to see if you started a Qt-based application from a terminal:

QGtkStyle cannot be used together with the GTK_Qt engine.

This can be solved by explicitly telling Qt4 where Slackware keeps its GTK+ configuration files, and then making sure a GTK+ theme is configured there.

  • Define the environment variable “GTK2_RC_FILES” in one of these files: ${HOME}/.xinitrc (applies to just you) or in /etc/profile.d/qt4.sh (applies system-wide) by adding the follwing two lines to that file (assuming you are using bash as your default shell):
    GTK2_RC_FILES="$HOME/.gtkrc-2.0:/etc/gtk-2.0/gtkrc"
    export GTK2_RC_FILES
  • Create a new file (or edit the existing) ${HOME}/.gtkrc-2.0 (so that the GTK theme applies to just you) or /etc/gtk-2.0/gtkrc (so that it applies system-wide) and add the following line to it:
    gtk-theme-name="GTK+"

That should fix VLC’s “Media > File Open” dialog which will now appear instantly.

Note: You can choose a GTK+ theme for all your QT4 based applications if you want by running “qtconfig” and in the tab “Appearance” set the “Select GUI Style” to “GTK+” instead of “Desktop Settings (default)“.

Eric

GTK2_RC_FILES

GTK icons suddenly missing

Several GTK-based applications are suddenly showing white icons with a red cross inside. Now what!

The update of the “shared-mime-info” package to version 0.70  in slackware-current seems to have changed the mime database format.

Slackware will automatically update the system-wide mime info database on every boot. It runs the command

update-mime-database /usr/share/mime

However, there is also a per-user mime database which is not being updated automatically. The result being that several of your GTK-based applications (such as pidgin and wicd) can not display their icons correctly and worse, starting XFCE will be disastrous because your (now) incompatible mime info database will destroy the XFCE menu and task bar.

Luckily, the solution is easy! You need to run this command once, for every user that logs on to your Slackware-current box:

update-mime-database ~/.local/share/mime

You can add this command to your “/etc/profile” script (which automatically fixes this issue system-wide for all your user accounts) or to your own ~/.profile script (you may have to create this file if it does not yet exist).

In theory, you do not need to run the command more than once but adding it to your profile will guard you against future incompatibilities like this one.

Eric

© 2024 Alien Pastures

Theme by Anders NorenUp ↑