Tuesday, September 27, 2011

Quicktip: Setting keyboard layout in GNOME via CLI

Since I tend to break my installation quite often while testing new stuff, I'm always looking for more agile way of re-setting my system quicky. Of course backups could do the job, but I find a clean install much cleaner and safer for my purposes.
So, here is a tip how to set keyboard layouts from the command line using GNOME - very useful if  you speak more than one language:


gconftool-2  -R /desktop/gnome/peripherals/keyboard/kbd
gconftool-2 --recursive-unset /desktop/gnome/peripherals/keyboard/kbd
gconftool-2 -s /desktop/gnome/peripherals/keyboard/kbd/layouts -t list \
--list-type=string [us,de]
gconftool-2 -s /desktop/gnome/peripherals/keyboard/kbd/options -t list \
 --list-type=string ["grp	grp:alt_shift_toggle,terminate	terminate:ctrl_alt_bksp"]
Do notice: there are TABS in the empty spaces up there. GNOME's xml was intolerant for my attempts to replace them with spaces, and really only worked with the braces.

Monday, September 26, 2011

Linux users: stop whining about UEFI Secure booting!

Sorry for the provocative title, but I think Linux and other FOSS Operating System should really stop whining about the UEFI secure booting.
I see no difference between someone who buys a laptop made by Apple and a someone who buys a Laptop with Windows OS. As the saying goes: "If you sleep with dogs, you wake up with flees". For a very long time the Linux Community ignored the WINTEL monopoly and did very little to support free hardware manufacturers. Many people would invest tons of time in hacking and patching Linux and drivers where they where manufacturers ignored deliberately or unintentionally Linux.
I don't buy hardware very often. And so most people who use Linux don't need to. But when I do buy hardware or asked to recommend hardware, I never do buy anything with Windows, or NVIDIA, or ATI.
I won't even answer friends or family question in the style "can you recommend this WinLaptop or that WinLaptop?". Sounds extreme, I know. But in fact, my strategy works. I have successfully bought my own Laptop from a small company that sells Clevo laptops with out windows. And more than 5 friends of mine who saw "Linux Just Works" out of the box, decided to buy these laptops too. I think it shows that there is a Market for people who are not interested in Windows. Even if it is small, it is growing.
But besides looking for a Laptop which does not come with Windows. You can specifically buy Hardware from manufacturers that do support Linux. Nowadays the ARM architecture is  rising, and provides computational power which is enough for most home users. In fact, the beagleboard provided more computational power than my 6 years old Laptop which still works. Not only that, the architecture is completely open, so I know, no UEFI Secure boot will shit on my head from the manufacturer.
There are a few more hardware manufacturers which make nice and OPEN hardware. To mention a few:
gumstix, opencircuits, hawkboard, pandaboard, igep and even more.
And there is even a whole Laptop/Tablet based on beagle board. 
You might mock the  "lousy" or humble hardware offering in this free field. But in fact it is enough for text processing and multimedia. It is enough for me, and I know, my next laptop, will be based on ARM, because I give a #!$% about UEFI, and I don't care what Microsoft does. Instead of fighting it directly, I will give my money to companies which promote my computational freedom.
I hope this post will encourage at least one extra person to re-consider his next WINTEL/AMD/NVIDIA buying.


Saturday, September 10, 2011

How to: Bluetooth Speakers without Pulseaudio

About 3 months ago I have purchased a Bluetooth Speakers set. I chose the Creative Labs D200, which provide me with nice tunes compared to the prices. The speakers worked out of the box with my Bluetooth adapter. Pulseaudio also makes life easier to switch between the laptop's own speaker to the Bluetooth speakers. However, I get irritated sometimes with pulseaudio, and I was looking for an alternative solution.

After researching a few different sources I have come up with my own flavor of solution, which I document here for future benefit of myself and others.

Thursday, August 25, 2011

20 Years of linux - a humoristic view

From an Israeli Linux forum:

<KingYes> Today, 20 years ago, Linus announced he is working on a new operating system
<KingYes> http://groups.google.com/group/comp.os.minix/browse_thread/thread/76536d1fb451ac60/b813d52cbc5a044b?pli=1
<KingYes> This is Great, how time passes by.
<Haimn> WOW I didn't know his post still exists.
<Guest> In windows it would not happen...
<KingYes> What would not happen?
<Guest> Your lack of sense of humor.


Credit: Original Link in Hebrew


I found it amusing, so I think it was worth a translation. I tried submitting to bash.org, but it does not work ...

Wednesday, August 03, 2011

A Usefull PyGTK Example

I have been looking for a good pygtk tutorial for a very long time. I have found a few tutorials which where an overkill, so I don't link to them. By over kill I mean that they where full with details which prevented me from actually having an application working.
I found this nice pygtk tutorial, which is actually more a capabilities demonstration. After reading for a few hours, I got intrigued. But I was very frustrated since the tutorial does not produce any real life example. For example, I would have expand the calculator example to working one. I did a Google search and bumped into this pygtk calculator working example. After a couple of more hours, I have managed to produce the following "Hello World!" pygtk application which demonstrates some basic pygtk principles:

#!/usr/bin/python

# A Usefull and Active PyGTK Example
#
# This example demonstrates a few Widgets which actually do 
# some stuff, and interact with each other.
#
# oz nahum
# linuxpixies.blogspot.com 
# August 2011

import gtk

class PyApp(gtk.Window):

    def __init__(self):
        super(PyApp, self).__init__()
        
        self.set_title("Entry")
        self.set_size_request(250, 200)
        self.set_position(gtk.WIN_POS_CENTER)

        self.fixed = gtk.Fixed()

        self.label = gtk.Label("Please Enter Your Name below")
        self.fixed.put(self.label, 60, 40)
        
        self.entry = gtk.Entry()
        self.entry.add_events(gtk.gdk.KEY_RELEASE_MASK)
        self.fixed.put(self.entry, 60, 100)
        
        self.entry.set_text("bla")
        self.UserName=self.entry.get_text()  

        self.outlabel=gtk.Label('name')
        self.fixed.put(self.outlabel, 60,180)
        
        self.button = gtk.Button("Greeting:")
        self.fixed.put(self.button, 60,140)
        self.button.connect("clicked",self.greeting)
        
        self.clearbutton = gtk.Button("Clear")
        self.fixed.put(self.clearbutton, 140,140)
        self.clearbutton.connect("clicked",self.cleartxt)
       
        self.button = gtk.Button("Close")
        self.button.connect("clicked",gtk.main_quit)
        self.fixed.put(self.button, 200,140)

        self.connect("destroy", gtk.main_quit)
        self.add(self.fixed)
        self.show_all()
        
    def greeting(self, event):
        self.outlabel.set_text("Hello "+self.UserName)
        self.entry.set_text('Hello '+self.UserName)
        
    def cleartxt(self, event):
        self.entry.set_text("")

PyApp()
gtk.main()

Tuesday, July 05, 2011

GNOME Fork revisited

Since I posted in my blog about GNOME 2 fork, I have seen numerous hits. In 4 months since than,
this single post had more than 3 times hit compared to my second most popular post about TMUX copy mode.
Yesterday, I bumped into a young fork of GNOME 2, called matte. Named after the Argentinian herb infusion. Let's hope this project will not have a bitter end like the drink, and rather long sweet life. The odd choices of developers are sometimes annoying. While it might seems narrow minded of me, I do expect a project that aims to be the size of GNOME2, to write a document or two in English. He, but what do I know there are actually more Spanish speaking people. I should learn Spanish instead of blogging...
I will try Mate sometimes probably.But in the mean while, thanks to GNOME developers I have been looking into alternatives and found my own peace within DWM, and now I am building my Desktop from Scratch.


Friday, June 24, 2011

dwm Baby, Hell Yeah I am becoming a SUPER GEEK!

F#!k yeah! I am using a tiling window manager called DWM, and it is the best thing I have seen lately. Easy to compile, easy to use, and there is no mouse involved, my hands are not painful anymore after a work day (well, they do, if I go climbing...).

That said, I am also using Pentadactyl which negated the mouse usage also in side Firefox.
My hands will thank me for that in 40 years. No more painful joints....