Reorder network devices set by udev

In order to reorder network devices (e.g. swap eth1 with eth2), the persistent-net rules from udev can be edited. Usually there is a file at the following location:
/etc/udev/rules.d/70-persistent-net.rules
The file contains several rules, for example:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="3c:ab:cd:00:ab:cd", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="3c:ab:cd:00:ab:ce", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
By editing this file it is possible to change the NAME of each rule. After that, to reload the rules, simply issue this command:
udevadm control --reload-rules

Making use of custom actions with Xfce Appfinder

One addition in the latest versions of Appfinder was the custom actions. I never used it until after I started typing several times twitter which didn't work (a habit from the web browser url bar).

The custom actions can be useful for anything, and it's really quick to run it.

Examples of custom actions:
  • twitter: xdg-open https://twitter.com/
  • us: setxkbmap us
It can be very handy, check the online documention for a quick setup. There are also online examples, don't mind to leave a comment or to fill the bugtracker if you have clever ideas, I can add them, I just did with the setxkbmap us example ;-)

Stable releases!

Last week-end, our awesome Nick released new stable versions for almost all Xfce major components: libxfce4util, tumbler, xfce4-appfinder, xfce4-session, xfce4-panel, xfwm4, xfce4-settings, garcon, thunar, xfce4-terminal and tumbler (this is not amnesia, we got two releases in a single day for this component!).

I still need to release libxfce4ui 4.10.1 which would fix some keyboard shortcut issues: numpad shortcuts, shortcuts with Shift, shortcuts with Alt+Print... I need some testers for this stable branch before releasing. So grab the code on git or from this tarball and please confirm if it works fine after restarting your session. Thanks in advance for your help.

The list of changes which can be found in those stable releases in available on the Xfce Announcement mailing list. I wish you all an improved Xfce experience!

Xfce4-notifyd 0.2.4

This quick follow-up release contains a single fix contributed by "Coacher": proper border drawing when compositing is disabled (bug #10021). It also contains a few updated translations: Bulgarian, Chinese (China), Chinese (Taiwan), Flemish and Indonesian.

For the next release, I'm considering implementing (as time allows) notification filtering so that you can turn off notifications from applications which annoy you.

Xfce4-notifyd 0.2.3

I'm glad to announce this new release of xfce4-notifyd which ships mostly bug fixes and code cleanups. Theming has also been improved with additional style properties and drawing fixes. Xfce4-notifyd themes may need to be updated to take advantage of those new style properties and to adapt to the theming changes. Sorry for the inconvenience.

Thanks a lot to all the persons who contributed to this release and kept me motivated! This is the result of your work!

Changelog

libnotify is now required as a dependency to build a test suite and to show improved notification previews.

Features

  • Add a category to the settings dialog for Xfce4 Settings Manager.
  • Add widget names to summary ("summary") and body ("body") widgets to allow easier theming. Remove the redundant / buggy summary-bold style property (bug #8431). Themes will have to be updated accordingly.

Bugs fixed

  • Fix notifications not disappearing after clicking an action button.
  • Handle timeout correctly when smaller than fading time (bug #8580).
  • Avoid flickering of the notifications.
  • Accept uri of images in icon_name parameter.
  • Parse body with g_markup_escape_text which allows us to handle span attributes misused by some clients and to parse strings with "unusual" characters such as & (bug #7773, #8187).
  • Respect border-width when drawing the notification (bug #9475).
  • Do not kill notification daemon to apply new theme. Instead, handle style updates of existing notifications.
  • Show a button in the notification preview (bug #9982).
  • Add an icon to the notification preview.

Updated translations

Arabic, Basque, Brazilian, Bulgarian, Castilian, Chinese (China), Chinese (Taiwan), Croatian, Danish, English, Finnish, Flemish, French, Greek, Hebrew, Hungarian, Italian, Japanese, Kazakh, Korean, Lithuanian, Polish, Portuguese, Romanian, Russian, Serbian, Swedish, Turkish, Ukrainian, Uyghur and Valencian.

fonts

i think i’ve sorted out some of my desktop font issues, and created a few more in the process.

for a long time, i’ve had to deal with occasionally jagged, hard-to-read fonts when viewing webpages, because i ran my xfce desktop without any font antialiasing.

i’ve always hated the way modern desktop environments try to “fool” my eyes with antialiasing and subpixel hinting to convince me that a group of square pixels can be smoothed into round shapes. turning off antialiasing tends to make the rounder fonts, especially serif fonts, look pretty bad at large sizes, as seen here:

display issues

my preferred font for the desktop and the web is verdana, which looks pretty good without antialiasing. but most websites use other fonts, so rather than force one size of verdana everywhere (which causes flow/layout issues), i turned on antialiasing for my entire desktop, including my preferred browser, and started disabling antialiasing where needed.

before and after font settings:

before/after settings

i tried the infinality patchset for freetype, but unfortunately none of the eselect configurations produced the crisply rounded antialiased text the patches are known for. i rebuilt freetype without the patchset, and went into /etc/fonts to do some XML hacking.

while eselect-fontconfig offers painless management of existing presets, the only way to customize one’s setup is to get into nitty-gritty text editing, and font configs are in XML format. this is what i ended up with:

$ cat ~/.fonts.conf

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
    <edit name="antialias" mode="assign">
        <bool>false</bool>
    </edit>
</match>
<match target="font" >
    <test name="size" qual="any" compare="more">
        <double>11</double>
    </test>
    <edit name="antialias" mode="assign">
        <bool>true</bool>
    </edit>
</match>
<match target="font" >
    <test name="pixelsize" qual="any" compare="more">
        <double>16</double>
    </test>
    <edit name="antialias" mode="assign">
        <bool>true</bool>
    </edit>
</match>
<match target="pattern">
    <test qual="any" name="family"><string>Helvetica</string></test>
    <edit name="antialias" mode="assign">
      <bool>true</bool>
    </edit>
</match>

let’s step through the rules:

first, all antialiasing is disabled. then, any requested font size over 11, or anything that would display more than 16 pixels high, is antialiased. finally, since the common helvetica font really needs to be antialiased at all sizes, a rule turns that on. in theory, that is — firefox and xfce both seem to be ignoring this. unless antialiasing really is enabled at the smallest sizes with no visible effect, since there are only so many pixel spaces available at that scale to “fake” rounded corners.

a test webpage shows the antialiasing effect on different fonts and sizes:

desktop and browser fonts

besides the helvetica issue, there are a few xfce font display problems. xfce is known for mostly ignoring the “modern” xorg font config files, and each app in the desktop environment follows its own aliasing and hinting rules. gvim’s monospace font is occasionally antialiased, resulting in hard-to-read code. the terminal, which uses the exact same font and size, is not antialiased, since it has its own control for text display.

the rest of the gtk+ apps in the above screenshot are size 10 verdana, so they have no antialiasing, being under the “size 11″ rule. firefox doesn’t always obey the system’s font smoothing and hinting settings, even with the proper options in about:config set. unlike user stylesheets, there’s no way to enforce desktop settings with something like !important CSS code. i haven’t found any pattern in what firefox ignores or respects.

also, i haven’t found a workable fontconfig rule that enables antialiasing only for specific fonts at certain sizes. i’m not sure it’s even possible to set such a rule, despite putting together well-formed XML to do just that.

* * *

to sum up: font management on linux can be needlessly complicated, even if you don’t have special vision needs. my environment is overall a bit better, but i’m not ready to move entirely to antialiased text, not until it’s less blurry. i need crispy, sharp text.

fonts on my android phone’s screen look pretty good despite the antialiasing used everywhere, but the thing’s pixel density is so much higher than laptop and desktop LCDs that the display server doesn’t need to resort to complicated smoothing/hinting techniques to achieve that look.

as a general resource, the arch linux wiki page has very useful information on font configuration. there are some great ideas in there, even if they don’t all work on my system. the gentoo linux wiki page on fontconfig is a more basic; i didn’t use anything from it.

Moving from Unique to GtkApplication

A new class has been introduced in GTK+3 that is GtkApplication, and GApplication with GIO 2.28. A common use case is to have a single window present every time the same application or command line is run, that is also known as process uniqueness. This is already possible with Unique that was especially developed for single instance applications. This very basic post will show an example in C with Unique, and also how to do it with GtkApplication, where you will see that GtkApplication makes things even easier.

First of all, the documentation available from the GIO source code doesn't give a concrete example for process uniqueness with GApplication. There are mainly examples about using GApplication with GSimpleAction, that is pretty cool since it lets you easily define actions to run on the primary instance outside of the process, either with the same program or a different one.

Single window with Unique

In the following example, a UniqueApp class is instantiated, then it's checked against another running instance. If not, a window is created and a handle is connected to the UniqueApp object to react on received messages. Otherwise a message is sent, and the existing instance will execute the connected handle and put the window in front.
#include <unique/unique.h>
#include <gtk/gtk.h>

static UniqueResponse
cb_unique_app (UniqueApp *app,
gint command,
UniqueMessageData *message_data,
guint time_,
gpointer user_data)
{
GtkWidget *window = user_data;
if (command != UNIQUE_ACTIVATE)
{
return UNIQUE_RESPONSE_PASSTHROUGH;
}
gtk_window_present (GTK_WINDOW (window));
return UNIQUE_RESPONSE_OK;
}

gint main (gint argc, gchar *argv[])
{
GtkWidget *window;
UniqueApp *app;

gtk_init (&argc, &argv);

app = unique_app_new ("info.mmassonnet.UniqueExample", NULL);
if (unique_app_is_running (app))
{
if (unique_app_send_message (app, UNIQUE_ACTIVATE, NULL) == UNIQUE_RESPONSE_OK)
{
g_object_unref (app);
return 0;
}
}

window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_show (window);

gtk_main ();
return 0;
}

Single window with GtkApplication

In this example, a GtkApplication class is instantiated. This one is then registered, and a check is done to know if the running process is the primary one or a remote one. Just like in the previous example, either the process is the main one and a window is created and shown, otherwise a signal is sent and the connected handle will put the window in front. The handle used here is directly a GTK function that presents the window which spares the need to write a custom handler.
#include <gtk/gtk.h>

gint main (gint argc, gchar *argv[])
{
GtkWidget *window;
GtkApplication *app;
GError *error = NULL;

gtk_init (&argc, &argv);

app = gtk_application_new ("info.mmassonnet.GtkExample", 0);

g_application_register (G_APPLICATION (app), NULL, &error);
if (error != NULL)
{
g_warning ("Unable to register GApplication: %s", error->message);
g_error_free (error);
error = NULL;
}

if (g_application_get_is_remote (G_APPLICATION (app)))
{
g_application_activate (G_APPLICATION (app));
g_object_unref (app);
return 0;
}

window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_show (window);

g_signal_connect_swapped (app, "activate", G_CALLBACK (gtk_window_present), dialog);

gtk_main ();
return 0;
}
In both examples there is just one difference, it is how the primary process is seen. With Unique there is a function to know if another instance is running, while with GtkApplication there is a function to know if the current process is not the primary one e.g. a remote instance. I prefer the second approach, since with Unique if there is only one instance running, the is_running property will tell you false but the primary instance is running, isn't it? But anyhow, as you can see, it is possible to implement painlessly what is done by Unique with GtkApplication.

Xfdesktop 4.10.1

I just released Xfdesktop 4.10.1 which contains some bug fixes and updated translations which had been there for months. Congratulations to Eric Koegel who committed most of them!

Amongst others, fixed background cycling and improved menu icons' loading are appreciated.

Changelog

  • Add a tabs width of padding for tooltip text (Bug #9162).
  • Fix theming of removable devices' icons (Bug #8977).
  • SVG images are no longer pixilated when scaled up.
  • Improve menu icon loading (Bug #8795).
  • Fix background cycling (Bug #8962).
  • Fix a crash when minimized window icons are resized (Bug #8963).
  • Fix use after free error in xfdesktop_regular_file_icon_peek_tooltip (Bug #9059).
  • Translation updates: Arabic, Bulgarian, Croatian, Dutch, Greek, Korean, Polish, Russian, Serbian, Turkish and Uyghur.

Parole 0.4.0 is out!

A new awesome release of the Parole media player for Xfce is out and ships all the hard work of Sean Davis and Simon Steinbeiss.

Sean wrote an extensive description of this new release on his blog, with tons of screenshots. As stated there, do not hesitate to give them feedback on this new release and to file any issue you may have on the Xfce Bugzilla.

Here is a screenshot of the new very nice main view while playing an audio file:

Parole 0.4.0

Congratulations to Sean and Simon for this excellent work!