Pages

Showing posts with label nautilus scripts. Show all posts
Showing posts with label nautilus scripts. Show all posts

How to Convert Word Documents to PDF & HTML in Ubuntu?

When it comes to OpenSource office productivity suits the current dominator is the LibreOffice (which was "used to be": OpenOffice = so long friend :/). And as with other major office suits, you can also use both LibreOffice and OpenOffice to save (convert) your documents to other formats as well.

But say that you have a simple text or any other document file in Ubuntu, then if you want to create a PDF file out of that, then you have to first open LibreOffice which is gonna take few seconds and then you open it and click on the menu and choose "Save As", seriously, it ain't fun and time consuming if you do that sort of things, a lot I meant :D.

But luckily, a sensible little programmer has come up with an excellent little script called Batch Convert Documents that uses either LibreOffice or OpenOffice built in tools which lets us convert any word document (that's supported by those office suits) to PDF or HTML format as easy as right clicking on the sucker!.


Main features...

*. Supports both PDF and HTML conversations.

*. Not just the GTK+/Gnome version but also has a separate script for Qt/KDE geeks too.

*. A simple progress bar.


*. Automatic notify via the system notify protocol (both successful conversations and errors).

"I'm done!, I'm done!, I'm done!" ... errr you "notifications!" ;-)...
Well, that's about it for features. The installation is quite simple.

Although I only tested it in Ubuntu 11.04 Natty Narwhal, but as long as you're able to install its dependencies (don't panic!, more below :P) I think it should work in 10.10, 10.04 and even in 11.10 as well.


Installation...

As said, it has three dependencies which Ubuntu does not ship by default.

1. So before installing the Nautilus Script, let's install the dependencies. For that use the below command in your Terminal window.
sudo apt-get install unoconv xclip libnotify-bin
2. Now download the script from here and extract its contents (say, to your "Home" folder for instance).

Now open your terminal and change your directory to that extracted folder ("batch-convert-documents-0.2-2" for the current version) and enter the below command.
sudo install -m 755 batch-convert-documents /usr/bin/

3. Now to finish up, use the below commands.
cd nautilus-scripts

cp -r Convert\ documents ~/.gnome2/nautilus-scripts

OR if you use the graphical version, just make sure Nautilus shows hidden files and then copy the content of the "Convert documents" (inside of the sub-folder of the extract directory) to "~/.gnome2/nautilus-scripts" , manually.

I tested this script to convert ".doc" (older version of Microsoft word document format), ".odt" and a simple Text file to both PDF and HTML and they all worked without any errors!. Good luck.

How to Add Images as Wallpapers Directly in Nautilus (file manager) in Ubuntu?

Yes I know, Gnome desktop or its applications in general are painfully simpler for most of us :) (I'm serious!) . But at least, I don't know about other applications, but the default file management utility in Gnome, the Nautilus does let you expand its features via plugins (scripts actually) with ease.

Anyhow, if you're a bit new to Ubuntu, then I'm pretty sure by now that you've figure out that unlike with many other desktops, once inside Nautilus file manager, you just can't right click on an image and "set it as a wallpaper". What!, yep :).

First we gotta open it and then via the default image handler and then by clicking on its window we'll be able to do it. But it's a bit of a work and not the most easiest nor the enjoyable thing to do either. 

Luckily, there's a Nautilus extension/script that once installed, lets you easily set any image extension as a wallpaper, it's called "nautilus-wallpaper" (obviously :D).

Just right-click on any image and from the menu, you'll see a new one called "Set as Wallpaper"...
You can install this "nautilus-wallpaper" script in Ubuntu 11.04, 10.10 and 10.04 (perhaps it'll also work in latter versions...) by using the below command in your Terminal window.
sudo apt-get install nautilus-wallpaper
But for the changes to apply properly, you either have to re-login into the desktop or simply restart Nautilus by using the below command.
nautilus -q

That's it.

SystemClean: A Simple Script to Clean Your Ubuntu Linux and Apps Temporary Files!

Just like with any other operating system with GNU/Linux, we also gotta do some application and other temporary files cleaning from time to time. And sometimes even after removing an app in say Ubuntu (in this case) some of the installed dependencies might not be removed automatically by the package manager for various reasons.

Although if you know your way around "apt-get" ;-) then you can do some house cleaning manually ... but what about cleaning the Firefox, Google Chrome or Chromium web browser cache or removing temporary "left-overs" of many other applications in Ubuntu?.

Well you can use the famous (and excellent) Ubuntu Tweak utility (which is more than a "temporary file remover") for instance. But would you like something that's pretty darn small in both size and system resources + would let you do those things pretty much automatically??, heck ya you would :D.

There is such an excellent application, a (Nautilus Script actually), it's called SystemClean. It's like few kilobytes in size and once installed lets you do things like...


*. Remove application "left-overs" as mentioned above via "apt-get" package manager such as - Auto remove, clean its cache (you know downloaded package cache, don't worry it won't un-install anything), remove broken packages lists, etc.

*. Remove un-needed files (referring to the temporary folder in my case, but perhaps it may remove others .. so be careful).

*. Remove Memory Cache (the developer himself has added a warning for this, so again use it at your own risk).

*. Clean the Trash.

Or if you didn't choose any of those options (didn't click on any "check boxes) but click on the "OK" button then you'll be taken into another window that lets you clean cache of a huge list of apps such as -


Chromium, Firefox, Pidgin, Compiz, LibreOffice, Google Earth, OpenOffice (what's that! :P), Miro (excellent multimedia player), wallpaper cache, Seamonkey (a powerful Internet application "suite"/collection), Nautilus thumbnails (7 days old), Clementine (a music player)... are just a few to mention!.

*. It also gives you a report afterward concerning what it did and how many space it recovered, etc. 

How to install it in Ubuntu 11.04 Natty Narwhal? (might also work in 10.10, 10.04 or other versions)

Well, we gotta install it manually since there are no PPA s at the moment but the installation is pretty much simple and does not require any other dependencies (in my Ubuntu Laptop anyway).

1. First download it from here.

2. Now extract the content, say to your desktop.

3. Then open your Terminal and change your directory to the extracted directory.

4. Now, enter the below command (use "sudo" if you want it to be installed for everyone).
/.setup

OR

After extracting it you can open that folder in Nautilus file manager and double click on the file called "setup" and when asked simply choose "run in terminal". That should also do it if you don't like to play with the command-line that much :).

Then as shown in the below screenshot you'll be asked to choose your Language and simply click the "OK" button and you're done!.


How the heck can I launch it?

Simple. Just right click on your desktop and from the menu (below screenshot) choose: "Scripts" -> "SystemClean".


Although I'm not entirely sure why, but it says that you should have an Internet connection to run it but I did run it without any Internet connection and it worked just fine. Enjoy and a again, a big thank to the developer for this amazing little script :).

Introducing Split-lossless Script (Nautilus) - "Extract" Lossless Audio Files Into Other Formats With Ease

Cue sheet or ".cue" extension is a container format in which it holds various information such as Track numbers, Titles, etc which is commonly seen in Audio CDs. But it's certainly not confined in those but can also be seen in data CDs as well.

Anyhow, if you have a CD or a single file which contains few lossless audio tracks within itself that has to be split or Extracted into mp3 or Flac under Nautilus file manager as easy as right clicking on it... then Split-lossless is a very valuable little tool without a doubt!.

One good thing about Nautilus is that you can easily expand its functionality by using simple commands/codes called Nautilus Scripts. Although, even without learning about programming Java/C++, etc... if you're familiar with bash-commands (you know those standard commands that we put into the Terminal such as "su" or "sudo" for instance), once you get familiar with its coding style... we can easily use these already existing bash-commands together in a single "script" and create a command of your own!.

Anyhow, if you don't have time for that sort of a thing :) and simply want to know how to install the Split Lossless into your Nautilus... then start your Terminal window and enter the below command to install it in Ubuntu 11.04 Natty Narwhal (I think it should work on 10.10 and 10.04).
sudo add-apt-repository ppa:cokicd/split-lossless
sudo apt-get update
sudo apt-get install split-lossless


Once installed... simply right-click on your .cue file and from the menu that Lossless Split adds you can choose your codec (flac/mp3). And the cool thing about it is that, all the meta information such as Album name, Artist, Track name, Year, etc are automatically fetched for you!, a huge time saver.

Depending on your needs, you can choose the best possible audio bitrate, a built in progress indicator, a preview before splitting is done, automatic notification when done + you can even tell it to automatically delete the source file as well.

Seriously... it may be a script... but this is one of the impressively useful tool for those of us who deal with audio related "stuff" without a doubt :).