Entries Tagged 'gnome' ↓

Diff tools, WinMerge & Meld

WinMerge is wonderful for those souls that are still trap developing in windows.

Their “main” site is currently down but you can check it out later at winmerge.org.

Meld is another great app which I found ones I moved 100% to linux.

I really like them both but there is one feature that WinMerge has that I haven’t been able to reproduce in Meld. WinMerge has keyboard shortcuts for everything, so you do something like alt-down, alt left (can’t recall the exact commands) and that will go to the next diff and replace the right file with the left file. In Meld you have (or at least as far as I know) to do the same but with the mouse which makes it slower.

A smaller thing is that WinMerge is faster and I believe it’s both because it’s more mature and because it’s C++ while meld is python+GTK .

And of course Meld gets extra points for the cool effect to reflect changes.

Abiword dictionary

I need to write a document and I said I’ll give abiword a try, when I reach for the spell checker it just didn’t work… I fire up google and found nothing so I reach for IRC and ended up in #abiword on gnome servers.

While there “sum1″ help me (thanks man) and it turns out I didn’t had the spell check libraries also for some reason abiword is not showing a popup (on my machine) complaining it’s not there.

so for getting the dict in ubuntu you need

$apt-get install aspell-es

and the way we found out is with

$ enchant-lsmod -list-dicts
en: ‘aspell’ (Aspell Provider)
en_CA: ‘aspell’ (Aspell Provider)
en_GB: ‘aspell’ (Aspell Provider)
en_US: ‘aspell’ (Aspell Provider)
es: ‘aspell’ (Aspell Provider)

and this one shows the current language.

enchant-lsmod -lang
en_AU: aspell = Aspell Provider (/usr/lib/enchant/libenchant_aspell.so)

for some reason my ubuntu thinks it’s australian….

Hope this helps someone when google indexes it. Since there is very little information around.

SVN goodies, and a call for a nice repo browser

So I was looking around in the collab.net site and found some things that SVN users may find usefull.

in no particular order

  • bash completion
  • Delete all files that are not versioned, although I recentryl found out that “svn revert” will doI think does the same
  • grep without the cruft I find this one very nice, it is a grep that will filter all .svn files so your can actually find stuff on svn checkouts
  • and of course emacs integration that seems like a svn-mode whatever that is supposed to do.
  • and since for each use of emacs in a sentence I must say vi here is a vi’s syntax file there 2 to 1.

now about the repobrowser…

First don’t take me wrong I love svn CLI interface but sometimes you just want to browse the code see the changesets or just read the commit comments, in those cases I totally miss tortoiseSVN it’s windows explorer interface seem to me the best feature of the windows explorer.

So on linux I have found a couple of tools but none have given me the love of tortoise, currently I’m living with rapidSVN, while writting this post I found about some set of svn scripts for the gnome thru something call G-Script.

wallpaper thingy 0.1

for the impacient ones download it from here

Why?
Ok so after almost killing myself over bonobo I got this stable. if you read my previous post on this I didn’t found anything I really liked. While developing this I came across 2 very nice programs, although I have too say they both suffer from the “way too many features problem”, to be fair wp-tray and desktop drapes

Features
wallpaper thingy (please please someone give me a good name for it) will very very simple following the UNIX tradition (do something and be great at it), what is this something

  • impress you with new wallpapers, therefore the default is random from a dir.
  • and it will let you configure many aspects of this (change interval,wp dir, icon to show, and maybe go back to the one before)
  • and that’s it. unless you have a very good addition.
  • Provides a CLI and a gnome-applet interface with the same code thanks MVC :)

Instalation
download, untar, sudo make install, then add key to gconf as the README file says.

Usage
Please check the README file, but it’s very simple set your wallpaper dir.

  1. As an applet, right click the a panel then “add to Panel” look for wallpaper thingy, then add, after that everytime you click the icon (or 60 secs pass*) you will get a new wallpaper
  2. As a cli script, run wp_thingy.py script (no params)

* this will be configurable, if you can’t wait go to wp_thingy.py:34 and change it or delete line 36 so it will never autorefresh

Wanna help?

  • Here is what you can do, check the trunk and send me some patches for all the TODO
  • give me some feedback (please do not post at trac.)
  • run time wp_thingy.py and send me that together with the size/structure of your wallpaper dir to see if the algoritm can be optimized.
  • tell everyone about it :)

show_stock buttons in pygtk

So I’m learning pygtk to write a small program inspired by my last post.

and I wrote this to see if I really undestand how the tookit worked.

I’m reading http://www.pygtk.org/pygtk2tutorial/index.html which seems to be the official tutorial and it’s written very well and/or gtk is a very handy tool.

I personally like a lot the way they do the table layout it’s much more simplier then it’s java cousing. Since you can actually make a mind map on how big each component is based on it’s numbers instead of having to add them up and see if they collide.

The funniest part of all is that I wrote this in about 30min this morning before going to work and I have spend 15 more minutes making it “presentable”, after that I spend almost 2-3 hours figuring out how to post the damn thing to wordpress, but that is the topic of my next post. for now enjoy the code.

Bonus points if you tell me why lines 48-49 screw up the layout.

[python]

#!/usr/bin/env python

import pygtk
pygtk.require(’2.0′)
import gtk

#this will generate the list of all the stock options
stock_options = [option for option in dir(gtk) if option.startswith(”STOCK”)]

class Stock_Buttons:

def createButton(self,stock_option):

#ugly but this is a test.
button = gtk.Button(stock=eval(”gtk.”+stock_option))
button.connect(”clicked”, self.clicked,stock_option)
button.show()
return button

def clicked(self,widget,data=None):

print “gtk.Button(stock=gtk.%s))” % data

def __init__(self):

#setting some defaults.
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_title(”Sample stock buttons”)
self.window.set_border_width(10)#this will handle both gui events (click the X) and system events like
#the kill command.
self.window.connect(”destroy”, lambda wid: gtk.main_quit())
self.window.connect(”delete_event”,lambda a1,a2:gtk.main_quit())

#small trick to get the the size if the grid
#93 boxes fit into a 10×10 grid
#45 boxes fit into a 5×5 grid and so on.
import math
length = math.ceil(math.sqrt(len(stock_options)))

#pasing floats to gtk is deprecated so to avoid that we make sure it’s an int
length = int(length)
print len(stock_options)
#we set false so gtk will strink the buttons.
table = gtk.Table(length,length,False)
#set one widget on each 1×1 slot until we run out of widgets
for index,option in enumerate(stock_options):
i=index / length
j=index % length
#~ why this shows a weird layout?
#~ i=index % length
#~ j=index / length
table.attach(self.createButton(option),i,i+1,j,j+1)

self.window.add(table)
table.show()
self.window.show()

def main():

gtk.main()
return 0

if __name__ == “__main__”:

Stock_Buttons()
main()

[/python]

I’ll post a screenshot but the upload thing doesn’t wants to work unless I give 777 to the dir so no way, same goes with the raw code, ones I’ll figure out how to do it I’ll update this.

Linux wallpaper changer

First of all let me say I’m not a fan of wallpapers I’m more a “black background guy”.

But I have been hearing a friend complain about needing a program with this simple spec.

“take in a dir, randomly look for a wallpaper there and set it.”

I’m impress that gnome doesn’t has this so simple functionality same with fluxbox (although you can use feh, but I have yet to learn how). On the other hand KDE seems to have one that’s very nice it even has wallpapers on each desktop but it’s KDE.
Then they are lots of programs with a huge ammount of “functionality” like gradients and solid backgrounds and a bunch of stuff and yet they forgot something so simple as a random chooser.

Anyway I was about to fire up my editor and code something but i decided to google around and I found many:

all the relevant ones are in this thread, ironically they are all implementations of the same program in different languages.

The one that is a bit more complex is the C code which implements it’s own counter, the shell one, perl and python are just something that reads all files in dir and randomly gets one after that they all call gconftool-2 with the correct options to set the wallpaper; after that they all say set a cron job.

The one written in C goes hardcode loading a gconf instance and setting the property there ( /desktop/gnome/background/picture_filename if someone is interested.) after that it created a mainloop and sleeps for X seconds, oh did I forget it needs to be compile and depends on 2 external libraries? good luck ubuntu users getting that build.
Anyway I could say which one I think it’s the best but as I said I don’t have any wallpapers to try them….

If only a friend of mine will lend me his huge list of wallpapers, which I’ll love to have but he refuses until I stop caling it “your huge pile of crap”
side note, check out this “true story” about openbox wallpapers why executable code is not a good idea :)

Come on click it it’s just one paragraph.

I’m sick of programs not running on WMs I’m going to gnome

I have been around some wm mainly fluxbox, lately I have been working with a great small wm (tiny some will say) call dynamic window manager, by the way dwm is also some new crap from our best friends Desktop Window Manager.

I love them both dwm is great at not getting on your way and fluxbox is super fast but there is always this program that you love that doesn’t respects X and then you have trouble.for example try running rox inside fluxbox it will grafully take control of your desktop and then there is no way to get a menu, I know you can pass in params to stick it at north or south or nodesktop but then what’s the point of rox if it has no desktop? as another example take gaim or any other IM client and try to run it inside dwm it will threat it as a full screen app and I’m not up for tagging everyone as “float” and starting to patch the code is not a good idea.

the best part of all is that this is not dwm or fluxbox fault is the fault of whoever designed the program to just do what they want. not what X tells them too. But I’m just tired of having to choose between

  • throwing out the program
  • finding a workaround
  • just complain about how bad it is.

Why gnome?

well to start I don’t like kde, never did and never will (note to self, if you ever run kde unpublish this post :D) other then the fact that it has way too much crap, it’s slow and reminds me windows and I don’t know why kde developers want to make everything and stick a k in front of it. it’s just flustrating.

On the other hand gnome is more flexible and less intrusive, i find that a couple of kde apps that I do like (amarok, kdiff3, etc) work without problems on gnome.

And of course xgl and beryl, since this is actually usefull eye candy (aka F12).

The biggest problem I see here is that the gnome that comes with gentoo is very ummm crappy? so I’ll sit down with the gnome beautifier guide as bonus points I’m going to migrate to gnome 2.16. (ones it gets out of hardmask )