Posts Tagged: software

Patches for Nautilus “move to trash” bug

Warning, this post contains a geek rant.

If you use the nautilus or nautilus-elementary filemanager (the default file manager in any gnome-based linux distro, including Ubuntu), you are probably aware of the annoying bug with file deletion.

Like any other file manager, nautilus allows you to delete your files using keyboard shortcuts: permanently (hit <Shift-Delete>) or temporarily by moving them to the trashbin (hit <Delete> on your keyboard). Removing files is always a critical action so any other file manager will make sure that you don’t do it accidentally: the file manager in MacOS, finder, will require you to hit the key combination <AppleKey+Delete>, difficult to perform by mistake. Microsoft Explorer, Konqueror, Thunar and many others will ask you to confirm that you really want to trash files with a dialog box.

Unfortunately nautilus lacks this ability: if you, your toddler or your cat accidentally hit the Delete key on the keyboard while a file or folder is selected, they go into the trashbin without warning. If you are not looking at the screen while this happens, the item is well gone. Obviously, this flaw was pointed out already long time ago. Users started asking for a fix already in 2004 (that is seven years ago!) and lots of people wanted to get that fixed: see for instance here, here, here, here, here, here

Surprisingly, reactions of the gnome developers to this problem were of two kinds: “I don’t think this is a real problem”[¹] or “I don’t think you are proposing the perfect solution”[²].  Back in 2009, I accidentaly lost some file and wrote a patch to fix this bug. The patch simply gave the user the option to activate a warning dialog if they wanted to. I figured “people who want the dialog will enable it and be happy, people who don’t will leave it alone and keep discussing about what is really truly the best solution for the next 7 years“. Believe it or not, the problem still exists,  so I thought of raising the issue once again (this time, I also proposed a patch to change Delete in Control-Delete).

Guess what: even after 7 years and hundred of people begging for a fix, we are sitting on the same attitude:

This is a real problem, but I don’t think the solution is a windows-like alert dialog. […] An animation with the file becoming red and/or flying to the trash would be a nice addition.

Or maybe a small cluebar with an embedded undo button would already be enough. I like how Google does it in its webapps.

What if deleted files were visible as some ghost-like-icon in the directory they used to be? And it could be possible to turn on/off the visibility of deleted files? And you can have your animation then as well; of an icon that dies.

I think your use case is a real concern, and something we should fix indeed, but as others said in this thread, I don’t think a confirmation dialog is how we want this to be implemented, especially when it carries a new preference with it.

Personality i like my delete and it would felt awkward if the delete didn’t delete anything.

We will rather keep the hole than having a solution we don’t like. Little does it matter if any other browser is actually using that solution or if lots of people want to see the thing fixed.

This attitude is amazingly complicated to understand for my simple brain. For me, getting things done means finding the meeting point between the optimal solution and the best outcome. If my car gets a flat tire on the way, I will accept any new tire a rescuer would give me and I won’t be sitting 7 years waiting for one that really matches the other three. And I like to think this is not Linux true philosophy either.

Anyway, here you can download the patches to fix this issue.

I am using the second one on nautilus-elementary (which also sports a very convenient Undo feature).

Edit 1 April 2011. To much of my pleasure, the patch has now been accepted and from next version on, Control<Delete> will be the shortcut to send stuff to trash. No more accidental  deletions! Open Source wins again.

Edit June 2011. If you arrive to this page because you freaked out finding the new nautilus behaviour, this is how to get back to the old key combo

Notes:

1. You are all familiar with the “how many people it takes to change a light-bulb?” jokes.
The one about software developers goes like this:

Q: How many developers does it take to change a lightbulb?
A: The lightbulb works fine on the system in my office. NOT REPRO.

2. The one about C++ programmers goes like this:

Q: How many C++ programmers does it take to change a lightbulb?

A: You’re still thinking procedurally. A properly-designed lightbulb object would inherit a change method from a generic lightbulb class, so all you’d have to do is send it a bulb.change message.

 

Nike4All – Upload your Nike+ data to the official Nike+ website.

After a couple of days of hacking, I managed to get a way to upload the data from Nike+Ipod device to your Nikerunning account. No iTunes needed! That is quite cool considering that the Nike+ Ipod Sport kit has been out for a while (2006 according to wikipedia) and linux users had no way to sync their runs without iTunes. Until now.

Installation.
Simply download the python script from here. It’s a single file and all it requires is Python (was tested with 2.5 and 2.6 – should work also with 3.0). You can place the script wherever you want. It is suggested to save the script in /usr/bin so that you can run it without typing the path everytime.

GUI.
A graphical interface is also available, as Screenlet. Get it here.


First time run – pairing your data with your account.

1. If you don’t have one yet, create an account on the Nike+ website. You will be asked for an email address, password, personal details and, at the end, for a screenname. Just go throughout the entire registration. If you already have an account on the site, skip this step.

2. Make sure you are not logged in into your Nike+ account (hit logout).

3. Start nike4all issuing the following command:

gg@fly-home:$ nike4all.py -createAccount
Go to this URL and login whit username and password of the account you just created
Url to visit: http://www.nike.com/nikeplus/?token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&v=2
Press enter to continue only AFTER you login

4. After a few seconds you will be asked to visit a website: simply open that URL in your favourite browser and login using your credentials. Edit [28.02.11]: it seems Chrome may cause some troubles at this step. If it doesn’t work please use another browser; Firefox should do it.

5. After having done so, go back to the command line and hit Enter. The program will then say:
Congratulation, your status is now confirmed
The user <screenName> is now associated to the pin xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx
Your pin was successfully saved in the configuration file
To update new files connect the iPod and use the following command:
nike4all -sync

The configuration file is in your home folder and it is called
.nike+rc
the running files you will be syncing will also be backup in the same folder
~/nike+
you can change the backup folder by editing the configuration file with your favorite text editor.

Usage.
You should already know by now.
Other than regular syncing, you can also upload specific files. Start the program without parameters to get a help message.

Caveats and technicalia.
If you already have a Nike+ account, you can still use that one. You existing data will not be lost but you may experiencing problems syncing with iTunes again in the future because your PIN was changed. Your iTunes PIN is stored on your iPod, encrypted (probably with AES CBC 128 bit) in a plist file. Maintaining the same PIN for iTunes and nike4all would require finding that password.

Please, do not use the nikerunning website with any other device that is not an iPod or a sportband. The nikerunning website is a service for Nike customer only and nike4all shall be seen as a tool that allow linux users to use this wonderful service.

License and Credits.
As usual, thanks to python and thank to Ubuntu. Nike4all was developed using only free software and it is released under GPL. If you like the software, please consider donating using the button on the right side – money will go into a research fund (the Institute of garage science).

Bugs and history.
If you find a bug, please drop me an email.
08/15/2009 – first release v0.1

Update (July/2010)

Masatoshi Kanzaki has published a similar tool to upload Nike+ Sport band data from linux! Get it on his blog.

Update (October/2010)
I uploaded the sourcecode on googlecode. Feel free to contribute or fork.

GPG Key

I decided time had come to get a [[Pretty_Good_Privacy|PGP key]].
Here is my public ID:
1024D/DE8D92BF
This is my fingerprint:
6BA6 61B1 A198 8DDF 50BF 7F2A DE7F 773B DE8D 92BF
And from here you can download my public key.

Additional notes:
Quick notes for GPG syntax (here)
Creating SSH keys (here)

WinGooglizer

If you are a Linux user you probably already know and appreciate that (amazingly) simple piece of software that is googlizer. If you don’t know what I am talking about: googlizer is a tiny gnome applet that sits in your taskbar; everytime you click on it, it will start a google search using the text in your clipboard as query. Just select the text using your mouse to copy it in the clipboard, then click on the G icon of googlizer and voila, your google search is already waiting for you in your favorite browser.

Being myself a ubuntu user I love the googlizer but sometimes I need to work on computers running windows OSs. I decided to invest 20 minutes of my time (while waiting the confocal to do its work) to make a windows clone of Googlizer.

You can dowload it from here (it’s free, as in free beer of course). To completely emulate X copy&paste functions you may want to consider using True X-Mouse Gizmo as well.
Is written in Python then compiled to exe using py2exe and the installer is build using Inno Setup. In case you are interested in the source, here you’ll find the python code for wingooglizer, the py2exe setup file and the iss inno script.

WinGooglizer works fine on windows xp, sp3. I guess it will work on any Windows OS. Enjoy and let me know how it works for you.