Tag Archives: Gnome

Give me convenience, or give me death

GNOME Foundation partners with Purism to support its efforts to build the Librem 5 smartphone

The GNOME Foundation has provided their endorsement and support of Purism’s efforts to build the Librem 5, which if successful will be the world’s first free and open smartphone with end-to-end encryption and enhanced user protections.

Emphasis mine.

My GNOME desktop is great and provides a UI that could easily be ported to a mobile device. I would certainly like to see a truly open smartphone succeed. However, I am skeptical of the chances of this one, not for any technical or functional but because of the sheer size of the Android and Apple ecosystems.

Anyone trying to get into the smartphone market faces the same Catch-22: the user base isn’t big enough to appeal to app developers and the paucity of apps deters people from migrating to the platform.

The current duopoly is not fixed forever, but it will take a company the size of Samsung to break it.

Flattr this!

Learning Genie with Project Euler

I searched for Gnome Genie and was attacked by a Gnome Ninja.

I’ve recently started playing around with the Genie programming language. This is a variation of Vala but with a more Pythonesque syntax. And I do like Python.

Genie is a compiled language that uses the Vala compiler to produce C code which then compiles to an executable binary. This means that it has less overhead than programs written in Python and should run faster. This is not always a consideration but it can certainly be useful.

The inevitable Hello World program looks pretty simple:

[indent=4]
init
    print "Hello World"

The only problem I’ve found so far is that there appears to be a dearth of “Teach Yourself Genie” resources, either online or off. This is not helped by some of the results that come up when you search for “Genie” or even “Genie Gnome”.

So I’ve decided to have another crack at Project Euler. I have already solved a fair few of these problems in Python, if I can re-implement the same solutions in Genie I will count myself as having made some progress.

One down, 592 to go.

Flattr this!

Gnome 3.16: A First Impression

I ran a system update today and Gnome 3.16 turned up. Which was nice.

One thing that I always found mildly annoying in Gnome 3.14 (and I think that this was also true of Gnome 3.12) was that when I clicked the shutdown button it would give me a choice between shutting down or logging out. If I wanted to reboot, I had to log out first and then reboot from the login screen.

So, wondering if anything had been done about the shutdown options, I clicked on the shutdown button.

And my laptop shut itself down.

10/10 for simple behaviour. Minus about 30 for being totally unexpected.

Flattr this!

MTB: Quick Update

I mentioned, earlier this week, that I have finally gotten around to rewriting my simple background switcher so that it actually works under Gnome 3. At the time I was intending to tidy up the code a bit first and then push it all to the master branch.

Well, I haven’t gotten around to making the changes I intended (yet), but have pushed it to the Master anyway. The current development branch for MTB is 0.3 and, as soon as I have some time, I will see about making it all work a bit more generically.

Flattr this!

MTB: A simple background switcher for the Gnome Desktop environment

Two years ago this month, I knocked together a simple background XML powered background switcher for Gnome 2.

Time marches on, Gnome 2 was replaced by Gnome 3, and I kept on intending to update the background switcher so that I could keep on using it. But instead, I’ve rewritten it.

I actually posted the basic script on here last month, but have since extended the functionality somewhat. You can find the latest version of MTB on GitHub (on branch 0.3, for now) and, once I have tidied it up a bit I will push this to the master branch. Because I’m a natural hoarder, I have hung on to the code for the Gnome 2 version of this – which can be found on branch 0.2, obviously enough.

I have also updated the MTB Project Page on this site. Since the instructions here were simply copied and pasted from the README file, I have removed the online duplicates to avoid confusion.

Flattr this!

Managing startup applications in Gnome 3

I’m sure this used to be on a menu but now, if you want a GUI to get at your start-up applications, you need to enter the following command in a terminal.

gnome-session-properties

The interface is (inevitably) minimal so there really isn’t much for me to add other than to file this under Note To Self.

Flattr this!

MTB3: Yet another (very simple) background switcher for Gnome 3

Way back when I started playing around with Python, one of the first applications I wrote was a transitioning background application. It worked quite nicely, but it was very tied to the Gnome 2 way of doing things and not particularly suited to a conversion to Gnome 3.

So now I have a simplified version which (after a bit of frustration) works quite nicely by simply displaying a random picture from my ~/Pictures/Backgrounds folder. The script, as it stands, looks like this:

#! /usr/bin/python
""" Yet another, veryt simple background switcher for the Gnome 3 Desktop

 mtb.py
 Copyright (C) Paul Pritchard 2013 
 
 MTB3 is free software: you can redistribute it and/or modify it under the 
 terms of the GNU General Public License as published by the Free Software 
 Foundation, either version 3 of the License, or (at your option) any 
 later version.
 
 MTB3 is distributed in the hope that it will be useful, but WITHOUT ANY 
 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
 FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License along
 with this program.  If not, see <http://www.gnu.org/licenses/>."""

import os
import random
import mimetypes

backgrounds = os.environ['HOME'] + "/Pictures/Backgrounds/"
pictures = []

for filename in os.listdir(backgrounds):
    mimetype = mimetypes.guess_type(filename)[0]
    if mimetype and mimetype.split('/')[0] == "image":
        pictures.append (filename)

picture = random.randrange (0, len(pictures))
fullpath = '"file:///' + backgrounds + pictures[picture] + '"'
os.system("DISPLAY=:0 GSETTINGS_BACKEND=dconf gsettings set org.gnome.desktop.background picture-uri '%s'" % (fullpath))

I then put a short script in /usr/local/bin so that I could execute it with the mtb command and, since everything was working swimmingly, I turned to cron to launch the app every 20 minutes.

The crontab line looks like this:

*/20 * * * * mtb

And it works, even if I have spent far too long finding my way around gsettings.

There are a couple of points worth noting, if only for my own future sanity.

Firstly, gsettings needs to know what screen to run on. This is fine when the command is executed from a terminal because it knows to run on the screen the terminal is sitting in. But when launching the same command from crontab, there is no terminal. You need, therefore, to include the DISPLAY=:0 GSETTINGS_BACKEND=dconf to tell gsettings where to run.

Secondly, the crontab environment settings are not always as complete as those found in Bash. So while I am able to enter just the command in Frugalware, other distributions may require you to use the full path to the command.

Flattr this!

How To Configure the Euro symbol in Gnome 3

File this under: Useful for me. It’s another of those things that is easy when you know how but not entirely intuitive.

From the System Settings app, select Keyboard (or just launch the Keyboard app directly from the shell) and click on Layout Settings.

And select Options…

Expand the Adding currency signs to certain keys and select Euro on 5

Now for the less than intuitive bit. Expand the Key to choose 3rd level and select Right Alt

Close and exit. And now you can type the € by pressing Alt Gr + 5.

Flattr this!

Better help text with argparse

Way back in 2011, I built a small application to build a Transitioning Background XML which could then be fed into Gnome 2 so that I could distract myself with a constantly changing background. This worked well enough and achieved what I wanted – an easy way to rebuild the XML every time I wanted to add some more photos. It didn’t provide any help text, though, which is something I kept meaning to sort out.

And then Gnome 3 came along and everything changed.

I have now gotten around to looking at Macsen’s Transitioning Background again and have finally found the time to replace getopt with argparse. What that means in English is that if you type mtb -h, you will see this:

usage: mtb.py [-h] [-p PATH] [-s STATIC] [-t TRANSITION]

Create a transitioning background XML for Gnome 2

optional arguments:
-h, --help show this help message and exit
-p PATH, --path PATH Set path for images and XML
-s STATIC, --static STATIC
Set static time in seconds
-t TRANSITION, --transition TRANSITION
Set transiton time in seconds

As ever, all of the source can be found on GitHub.

Flattr this!