This blog has moved to www.nongeekperspective.com. There you will find new posts
Thursday, August 31, 2006
Configuring a Printer in Xubuntu
If you use Xubuntu you may be noticed that there's no utility for printer setting. That's why I decided to write a simple utility to add and remove printers. Although it has been tested only in Xubuntu 6.06 it should work in any linux system with cups and gtk2 installed. The utility is
Downloading xprinterconf
Update: this tool has been updated and is recommended to download the new version instead. Read this post for further information.
You can download the program in binary form (recommended) here:
http://rapidshare.de/files/31500013/xprinterconf-bin.zip.html (77 kB)
or the pascal source code from here:
http://rapidshare.de/files/31500014/xprinterconf-src.zip.html (3 kB)
Installation
Just extract the contents of the zip file to any directory and run xprinterconf from the command line:
Then should appear a window with a list of installed printers:
Adding Printers
It's better to have the printer connected to computer and powered on.
Click on the "Add..." button in the main window and wait for the Add printer dialog to appear. There you have to provide the following information:
After giving a name and selecting the proper URI and driver click on the "Add" button. You should see the new printer in the main window's list.
All printers are shared by default, as lpadmin do. This may change in a future version.
Removing Printers
Just select the printer you want to delete from the list in the main window and click on "Delete" button. Confirm the action if you are sure.
Compiling the Source (optional)
You can download and compile the source code if you want. xprinterconf is made in plain pascal and compiles fine in Free Pascal (don't know about other compiler). It uses qgtk2 and cups4lazarus units.
You can find qgtk2 in the following sites:
http://www.geocities.com/hebrak/gnu/qgtk_en.htm
http://home.tiscali.cz:8080/bubenic/nase.gnu/qgtk_en.htm
and cups4lazarus in:
http://sourceforge.net/projects/cups4lazarus/
The file has .lpr extension instead of traditional .pas because I coded it using lazarus, a Free Pascal RAD. Despite of that, the file is a standard pascal file and you don't need to have lazarus installed in your system.
The Future
As said before, xprinterconf is just a front end for cups command line, but this may change in the future. The following items are planned:
The License
I used GPLed code making this little utility. So, I think xprinterconf have to be GPL too. However, please let me know if you modify the code in any way.
Donations
If you find this little utility useful and you'd like to support future development and new features as well as new free software, please consider making a donation via PayPal by clicking in the next button. This method of donating is secure, PayPal guarantees your privacy and security.
Finally, I must say that there's no warranty. This utility works for me and it MAY (or not) work for you too.
I hope you find this program useful. I wait for your comments and suggestions
Technorati tags: xubuntu, xfce, linux, printer, printing, configuration, tool, gui, cups
Add to: del.cio.us | digg | furl | blinklist | netvouz
xprinterconf
.Downloading xprinterconf
Update: this tool has been updated and is recommended to download the new version instead. Read this post for further information.
http://rapidshare.de/files/31500013/xprinterconf-bin.zip.html (77 kB)
or the pascal source code from here:
http://rapidshare.de/files/31500014/xprinterconf-src.zip.html (3 kB)
Installation
Just extract the contents of the zip file to any directory and run xprinterconf from the command line:
./xprinterconf
Then should appear a window with a list of installed printers:
Adding Printers
It's better to have the printer connected to computer and powered on.
Click on the "Add..." button in the main window and wait for the Add printer dialog to appear. There you have to provide the following information:
- Printer name: Just a name for the printer. Use only printable characters, don't use spaces or special characters, use only characters valid in an email address, for example.
- URI: select from the list the "port" where the printer is connected to. If you have the printer powered on you should be able to see the name of the printer there. For example, if you have an HP Deskjet connected to parallel port you might see something like:
direct hp:/par/DESKJET_690C?device=/dev/parport0
- The "driver": Really a ppd file. Look for your printer model in the list at the right and select it. Notice that some drivers say "recomended" so, they could be better. Those drivers are provided by cups, not by xprinterconf.
After giving a name and selecting the proper URI and driver click on the "Add" button. You should see the new printer in the main window's list.
All printers are shared by default, as lpadmin do. This may change in a future version.
Removing Printers
Just select the printer you want to delete from the list in the main window and click on "Delete" button. Confirm the action if you are sure.
Compiling the Source (optional)
You can download and compile the source code if you want. xprinterconf is made in plain pascal and compiles fine in Free Pascal (don't know about other compiler). It uses qgtk2 and cups4lazarus units.
You can find qgtk2 in the following sites:
http://www.geocities.com/hebrak/gnu/qgtk_en.htm
http://home.tiscali.cz:8080/bubenic/nase.gnu/qgtk_en.htm
and cups4lazarus in:
http://sourceforge.net/projects/cups4lazarus/
The file has .lpr extension instead of traditional .pas because I coded it using lazarus, a Free Pascal RAD. Despite of that, the file is a standard pascal file and you don't need to have lazarus installed in your system.
The Future
As said before, xprinterconf is just a front end for cups command line, but this may change in the future. The following items are planned:
- Clean the code to improve readability (using Object Pascal sintaxis?).
- Rewrite some procedures to improve performance.
- Kill some bugs :)
- Add configure default printer's properties (i.e. paper size, printing quality, etc.).
- Allow to control sharing properties.
- A nicer interface.
- Some features you suggest.
The License
I used GPLed code making this little utility. So, I think xprinterconf have to be GPL too. However, please let me know if you modify the code in any way.
Donations
If you find this little utility useful and you'd like to support future development and new features as well as new free software, please consider making a donation via PayPal by clicking in the next button. This method of donating is secure, PayPal guarantees your privacy and security.
Finally, I must say that there's no warranty. This utility works for me and it MAY (or not) work for you too.
I hope you find this program useful. I wait for your comments and suggestions
Technorati tags: xubuntu, xfce, linux, printer, printing, configuration, tool, gui, cups
Add to: del.cio.us | digg | furl | blinklist | netvouz
Back to Writing
I'm here again after a short vacation (vacation never are long enough). I hope I can write more often now.
Add to: del.cio.us | digg | furl | blinklist | netvouz
Add to: del.cio.us | digg | furl | blinklist | netvouz
Friday, August 11, 2006
About Installing Software in Linux
I recently read the 10 reasons to dump Windows [part I] article and I found it is an interesting reading. It's just the first of three articles where the author presents the top 10 reasons why he decided to use Linux instead of Windows and I agree the three reasons mentioned in the first post. However I won't to discuss the entire article but to talk about my experience with the third reason: Installing software.
I don't want to create controversy. Further more, I like and use Linux. I'm just expressing my thoughts about the package management in Linux based on my short experience (about 7 years) using that OS.
In the mentioned article the author points the convenience of having package managers and repositories in Linux: to install a new software package we just need to run a package manager (i.e. Synaptic Package Manager) and "choose the app from the list (which is nicely divided into categories, making it easy to find stuff) and confirm the choice". Then the program is automatically downloaded from a repo and installed in our system.
All those things are true. But it is not always so simple for everybody. All works fine provided you have an internet connection (and is preferable to have a broadband connection, as many packages are big in size). You may think this is not a big problem because most people have broadband access to internet nowadays. Well, if you think so you're wrong.
Many, really many people, specially in developing countries access to internet through dial up modems or have no connection at all. So, these people relies on a few other individuals or institutions that have the appropriate access to download the needed packages. Many people download packages at work or university to install them at home. For those people all the mentioned convenience is very limited.
Installing software in the Windows-like way
OK, those people can download individual packages (i.e. an application or library) and install it at home. The same apply if you want to install something not found in the official repositories. As the author says:
To explain this I will use my own experience: About three years ago I wanted to install XSane so I downloaded the package and when I tried to install it I found that It was needed to update just one library (from version 1.14 to version 1.15 or so, I just remember that the difference was a minor version) which at the same time required almost all other installed libraries updated too. It was easier for me to install a new version of the OS.
I must say that my system was pretty outdated but I think it's just absurd that I minor version update in a library requires all the system updated. Later I found that this problem is due to APIs and ABIs that are quite volatile in linux. It was an rpm based distro and this problem tend to be less noticeable in Debian based distros though (like the Ubuntu family).
But that's not all. Some GPLed programs are not updated in the repositories or even not included at all. For example, Free Pascal compiler is not up to date in the Debian repo. I install it in Xubuntu from an rpm package using alien, but I'm still trying to configure Lazarus to work fine.
In despite of all the previous things the author of the article says:
Central repositories, apart from the convenience, provide another
important benefit. For software infected with malware it’s much harder
(in practice almost impossible) to get into the official repositories.
I agree, definitively. I only hope that this approach can be improved soon.
I'm waiting your comments, whether you agree or not.
Technorati tags: linux, install, installation, thought, thoughts
Add to: del.cio.us | digg | furl | blinklist | netvouz
I don't want to create controversy. Further more, I like and use Linux. I'm just expressing my thoughts about the package management in Linux based on my short experience (about 7 years) using that OS.
In the mentioned article the author points the convenience of having package managers and repositories in Linux: to install a new software package we just need to run a package manager (i.e. Synaptic Package Manager) and "choose the app from the list (which is nicely divided into categories, making it easy to find stuff) and confirm the choice". Then the program is automatically downloaded from a repo and installed in our system.
All those things are true. But it is not always so simple for everybody. All works fine provided you have an internet connection (and is preferable to have a broadband connection, as many packages are big in size). You may think this is not a big problem because most people have broadband access to internet nowadays. Well, if you think so you're wrong.
Many, really many people, specially in developing countries access to internet through dial up modems or have no connection at all. So, these people relies on a few other individuals or institutions that have the appropriate access to download the needed packages. Many people download packages at work or university to install them at home. For those people all the mentioned convenience is very limited.
Installing software in the Windows-like way
OK, those people can download individual packages (i.e. an application or library) and install it at home. The same apply if you want to install something not found in the official repositories. As the author says:
How many programs are there in those repositories? What about the apps we cannot find in them? Well, in Debian (and Ubuntu) the official repositories hold over 10 thousands of packages (programs, tools, libraries), all available for instant installation with a few mouse clicks. It’s really hard to find an open source program which is not available in the repositories (either official or additional unofficial ones). The exception are non-free apps like Acrobat Reader, Java or Real Player. Most of them can be installed from unofficial repos (which need to be added to the repo list) as well, but the alternative way is it to use the binary installers provided with them (this is the Windows-like way).Again, this is true but not always works. You can download a program at work, save it in some removable media and try to install it at home. Then you realize that the program requires to install several libraries but... those libraries are already installed on your system! It's weird.
To explain this I will use my own experience: About three years ago I wanted to install XSane so I downloaded the package and when I tried to install it I found that It was needed to update just one library (from version 1.14 to version 1.15 or so, I just remember that the difference was a minor version) which at the same time required almost all other installed libraries updated too. It was easier for me to install a new version of the OS.
I must say that my system was pretty outdated but I think it's just absurd that I minor version update in a library requires all the system updated. Later I found that this problem is due to APIs and ABIs that are quite volatile in linux. It was an rpm based distro and this problem tend to be less noticeable in Debian based distros though (like the Ubuntu family).
But that's not all. Some GPLed programs are not updated in the repositories or even not included at all. For example, Free Pascal compiler is not up to date in the Debian repo. I install it in Xubuntu from an rpm package using alien, but I'm still trying to configure Lazarus to work fine.
In despite of all the previous things the author of the article says:
Central repositories, apart from the convenience, provide another
important benefit. For software infected with malware it’s much harder
(in practice almost impossible) to get into the official repositories.
I agree, definitively. I only hope that this approach can be improved soon.
I'm waiting your comments, whether you agree or not.
Technorati tags: linux, install, installation, thought, thoughts
Add to: del.cio.us | digg | furl | blinklist | netvouz