Archive

Posts Tagged ‘plugin’

“Next Image” and “Previous Image” bookmarklets for vimperator

April 2, 2011 1 comment

This is the vimperator version of the “next image” and “previous image” bookmarklets. It can be used for numbered pages or images to increment/decrement the last number in the URL by 1.

The original bookmarklets are from here: sggk://ddd.hjfzivuivv.xln/klimarooz/.

Download:

https://github.com/jabbalaci/Next-and-Previous-Image-for-Vimperator

Key bindings:

ALT+u -> up, i.e. next image
ALT+d -> down, i.e. previous image

Example:

http://www.example.com/gallery/03.jpg
up: http://www.example.com/gallery/04.jpg
down: http://www.example.com/gallery/02.jpg

Installation:
(1) Add the contents of my .vimperatorrc file to the end of yours.
(2) Copy next_prev_bookmarklets.vimp to $HOME/.vimperator/plugin/.

[ @reddit ]

Open Konsole from Nautilus

March 3, 2011 Leave a comment

The following entry is based on the post “Nautilus Script to Launch a Terminal” by Linerd.

Problem

For navigating in the file system, I usually use Midnight Commander. However, sometimes it’s useful to switch to a graphical file manager, which is Nautilus under Gnome. For instance, browsing images with Nautilus is easier since it shows thumbnails. After using Nautilus for a while, I want to continue my work in a terminal (my favorite is konsole) in the current directory. How to do that?

Related work

There is a plugin in the repositories called “nautilus-open-terminal”. By default, the plugin calls gnome-terminal and it seems konsole is not supported :(

Solution

In this post, I found a simple and working solution. Here is the script:

#!/bin/bash
#
#  Nautilus script - terminal-here
#  This script will open a GNOME Terminal in the current directory.
#  Written by Linerd in August, 2009 - http://tuxtweaks.com/
#
#  Modification:
#  * konsole-here
#  * Open the Konsole terminal emulator in the current directory.
#
#  Save this script under $HOME/.gnome2/nautilus-scripts/terminal-here. Make sure that
#  you give this file executable permission. { chmod +x terminal-here }
#
#  This program is free software.  It 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.
######################################################################

if [ "$NAUTILUS_SCRIPT_CURRENT_URI" == "x-nautilus-desktop:///" ]; then
        DIR=$HOME"/Desktop"
else
        DIR=`echo $NAUTILUS_SCRIPT_CURRENT_URI | sed 's/^file:\/\///' | sed 's/%20/ /g'`
fi

# gnome-terminal --working-directory="$DIR"
konsole --workdir "$DIR"

exit 0

The konsole modification was suggested by James in a comment in the previously referred post.

Installation: Save it in the directory $HOME/.gnome2/nautilus-scripts under the name konsole-here.

Usage: Right click in Nautilus, then choose Scripts -> konsole-here.

Launch Nautilus from terminal

When I want to launch Nautilus from the terminal, I use the alias “nh”, which stands for “nautilus here”, i.e. open Nautilus in the current directory:

alias nh='nautilus . 2>/dev/null'

Simply put this line in your ~/.bashrc file.

With this alias and with the script above, you can easily switch back and forth between Konsole and Nautilus.

Credits

  • Linerd, original script with gnome-terminal support
  • James, konsole patch

Trouble

There is one thing that troubles me. If I open a konsole from Nautilus, the newly opened konsole gets no focus :( That is, you cannot type immediately, first you need to click on its window. However, if you call the script from the Desktop, konsole gets the focus… If someone has a solution for this, please let me know.

Update (20110304): I think I have a solution for the problem. After switching off the visual effects, konsole gets the focus. Damn… Here is how to get rid of the eyecandy: right click on Desktop -> Change Desktop Background -> Visual Effects tab, select None.

Installing the Java plugin for Firefox

October 28, 2010 Leave a comment

Problem

You have a Linux box (e.g. Ubuntu) and you want to run an applet in Firefox. It starts, but then it hangs, and you have no idea what the hack is going on.

My Case

I had Firefox 3.6.3 and I wanted to use OpenCms 7.5.1’s upload feature. The uploading is done via an applet that started but when I chose the file to upload and clicked OK, nothing happened. The CPU was on 100% and using the top command I noticed that a Java process is stuck. A bit later I figured out that it must be the Java plugin…

Solution

In Firefox, verify what Java plugin you have. Go to ToolsAdd-onsPlugins. Here I had the icedtea Java plugin. This is a crap, use the official Sun plugin instead.

Open Synaptic and remove this plugin. I also removed all openjdk packages.

Then install these:

sudo apt-get install sun-java6-jdk sun-java6-jre sun-java6-plugin sun-java6-fonts

Now let’s see the list of alternatives:

sudo update-java-alternatives -l

Here I got this output:

java-6-sun 63 /usr/lib/jvm/java-6-sun

Set the official one:

sudo update-java-alternatives -s java-6-sun

Now restart Firefox and check the Java plugin again. You should see Java(TM) Plug-in 1.6.0_22 (or something more up-to-date).

Troubleshooting

If you cannot install sun-java6-jre because it’s not in the repository, add Canonical Partners to your software sources.

Credits

Find more info here.

Categories: firefox Tags: , , , ,
Follow

Get every new post delivered to your Inbox.

Join 73 other followers