Archive for August, 2011|Monthly archive page

Notepad++ alternative for Linux

In Linux on August 18, 2011 at 6:34 pm

Nov 3 2011 note: let me save you time, I wrote this post in August 2011, IMHO Geany is the closest, feature-wise, to Notepad++ on Linux. If you want other alternatives you can read the original post…

As I write software for a living, I do a lot of text editing as well and for that I’ve been using Notepad++. It’s an excellent piece of software which, if I were to choose only 3 software apps to have as a developer, Notepad++ would be one of them (the 2 others would be Netbeans and SecureCRT). Having moved to using Fedora 15 recently, naturally I was hoping Notepad++ would have a linux version, but such is not the case. Notepad++ under Wine turned out to be practically unusable.

I’ve tried two alternatives: gedit and Bluefish. Both can do the job reasonably well though I’d rate Bluefish as the better of the two, however, both are neither Notepad++. When I checked the Notepad++ site again (who knows? they might have released a linux version in the week since I last checked!), I read that Notepad++ is based on the editing engine called Scintilla. The good thing is, the developers have also written an editor based on the engine and best of all it also runs under Linux. The editor is called SciTE.

The default installation of SciTE is pretty much like BlueFish.. however you have to tweak it a bit to bring out the powerful features of the application.

Default installation is very minimalistic

These are the features I miss the most from Notepad++ and which I want to have on SciTE:

  1. Singleton instance (I dont want multiple editors everytime I open a file)
  2. Show a files’ complete path (very important since I regularly compare files with the same name)
  3. Load previously opened files upon startup (if I was working on several files and had to do a forced restart I want the files in my previous session to be where I left them off).

To get the functionality I want, I checked out SciTE’s configuration page, fired up SciTE and opened SciTE’s user’s options file (that’d be under Options->Open User Options File) — alternatively you can edit the Global Options but you’d have to use root to edit — after some testing settled on just placing these few lines in the User Options File:

#option if you want to use the icons of the current GTK theme, personally I like the default icons

#auto maximize the window

#default tool bars, reminds me of NP++

#so you can see the full path of the file on top

#singleton instance — ie I dont want to see many editors, opening files will simply create a new tab

#make teh status bar at the bottom visible

#this will save the last session, so when scite is fired up the files from the previous session are loaded.

#save list of recent files

I saved the file, closed SciTE and when I fired it up I got the features I’ve been looking for.

Got my favorite Notepad++ feaures on SciTE!

With the small updates, my SciTE now shows the the full path’s of my opened files, runs as a singleton and ‘remembers’ my previous sessions. I’ll update this post if I missed anything.

Update: 2011-08-23

I’ve added this to make selections and searched words stand out (the default is greyed background):

#background select/find color

Update: 2011-11-03

Or you can just install Geany. Same features above “out-of-the-box”. Thanks to “tiny” for the suggestion =)


Fix for Fedora issues when printing to HP printers

In Linux on August 15, 2011 at 10:05 am

Today  I really had to fix my printing (or inability to print) problems using Fedora 15.   So far I’ve been trying to print on a network printer and hadnt had much luck there (I can see the printer, the print job seems to have been sent, but nothing gets printed).  I reckon I’ll give printing locally a try.  I attached the printer (its an HP 1020 laser printer) to my laptop and F15 detected the printer but still would not print.  Well according to some posts on the web, while F15 ‘detects’ the printer the appropriate HP plugin still needs to be installed.. hmm.. I thought I did that already, anyway here’s the quickest fix:

  1. sudo yum install hplip-gui
  2. sudo hp-plugin  <– running the plugin installer using  sudo — ie using your non-root account — will prevent “QGtkStyle was unable to detect the current GTK+ theme.” errors.

step 2 will launch the GUI installer and install the necessary components to (at least) print locally.  I’ll know later if this also fixes my network printing problem.

Install additional multimedia plugins on Fedora 15

In Fedora, Linux on August 6, 2011 at 8:38 pm

I’ve installed PiTiVi, a linux based video editor, but the editor doesnt come with the codecs (for viewing/playing multimedia VLC is great and comes with its own internal codecs).  To load all the codecs do the following:

1)  First add  RPM Fusion  in the list of repositories that YUM will use to search for installers:

sudo yum localinstall –nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

2) Next install the codecs.

sudo yum install gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-bad-free gstreamer-plugins-bad-nonfree gstreamer-plugins-ugly gstreamer-ffmpeg xvidcore xine-lib-extras-freeworld

3) Restart the multi-media app and it should work.

Forcing Gnome 3 to use Fallback mode

In Linux on August 5, 2011 at 10:20 pm

I use extended monitors for work  and at home and Gnome 3 just crashes when it uses its default 3D accelerated mode.   Fortunately, the “fallback” mode usually kicks-in which makes both monitors usable.

To set the non-accelerated mode as default go to “Applications->System Tools->System Settings->System Info->Graphics” and set “Forced Fallback Mode” to ON.

Enabling desktop icons in Gnome 3

In Linux on August 5, 2011 at 10:06 pm

By  default, Gnome 3 employs a non-traditional empty desktop with no intuitive way to drag applications for easy launching.  Here’s how to enable Gnome 3 to bring back those desktop icons again:

1) Install “dconf-editor
2) Once installed press “alt-f2” and type “dconf-editor”,  when that opens go to “org->gnome->desktop->background“.
3) tick  “show-desktop-icons“.    You should already see a few icons on the desktop.

To add new applications on your desktop, right click on the desktop choose “create launcher” and add the application’s name and command  (may require complete path) on the fields.  You can also change the icons by clicking on the icon.. you can use the  “Applications->Others->Main Menu” app to determine the complete path and icon path for your app.

Setting Thunderbird to use LibreOffice or Openoffice when viewing attachments.

In Linux on August 4, 2011 at 8:37 am

Here’s how to set Thunderbird to automatically launch the correct viewer for any office document attachment:

1) First find out where your open office binaries are, you can do a find “oocalc”, but they should all be in /usr/bin.

/usr/bin/oocalc   (for spreadsheets i.e. xls)
/usr/bin/ooimpress  (for presentations i.e ppt)
/usr/bin/oowriter  (for docs i.g. docs, docx)

2)  Open an email with an attachment (say one with a spreadsheet) and click on the “Open With..” option and “Browse..” then type in the location of the specific open office app (if its a spreadsheet type in ‘/usr/bin/oocalc’)  and click on “Open”.

3)  Finally click on the ‘Do this  automatically for files..” tick box so you dont have to this again. The “OK”.

That’s it.