Saturday, May 28, 2011

Control HTPC with keyboard/mouse from laptop

use x2x.
ssh to the HTPC with X forwarding
ssh -X HTPC
Then install x2x on the htpc:
sudo apt-get install x2x
Allow xhost connections to the htpc:
DISPLAY=:0 xhost +
finally issue the command
x2x -east -to :0


Note that xhost allow all is unsecure, unless you are on a trusted network. It is advisable to ssh tunnel x2x when running over an unsecure network.

Monday, April 25, 2011

Canon MP640 on Ubuntu

I used the excellent guide of Eduard Dopler to get it working.

Reposting here for archival purposes:

Install Canon MP640 on Ubuntu
Before all else: The multifunction printer MP640 by Canon works fine under Ubuntu, even via WLAN!



1. Updates via PPA
In order to make sure that CUPS and SANE are up to date, I recommend fresh updates via the PPA sources.

sudo add-apt-repository ppa:robbie.w/cups-bjnp
sudo add-apt-repository ppa:robert-ancell/sane-backends
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install cups-bjnp
sudo /etc /init.d/cups restart
2. Download Printer Drivers…
Afterwards we have to download the printer driver and—if required—the scanner software from the Canon (AsiaEurope*) site. Visit
Canon’s software center, select Linux and download the Debian printer driver and/or ScanGear.

3.a …and install them
Both files are compressed Debian packages which can be installed as usual, at least on 32-bit systems. People using this architecture can continue with step 4.

3.b Special attention for 64-bit
64-bit systems have to force the installation:

sudo dpkg -i --force-architecture ./cnijfilter-*
sudo dpkg -i --force-architecture ./scangearmp-*
Having installed it that way, we have to check whether the needed libraries are also available in a 32-bit version. Therefor there is the tool getlibs. In fact we have to go through all binaries installed by the Canon software, run them in getlibs and control if the corresponding libraries are installed. By doing that on my Lucid system, I found out that only /usr/bin/scangearmp has to be checked.

sudo getlibs /usr/bin/scangearmp
All missing libs should be listed that way and it prompts to download them. In my situation that was only the case for libgimp2.0.

4. Searching the printer
If the printer is not listed in the printer dialog by now, you can add it with the common printer tools of your desktop environment. Gnome, for instance, has the printer GUI in its System/Administration menu.

5. Editing the printer profile
This step is optional. Your printer should be able to print now. Expecting more features from your printer, you can add special functionality like black-white-printing or the like in your printer profile.
I recommend to edit the following files lest an update overwrites your changes (names may vary, backups of original files self-evident).

/usr/share/ppd/canonmp640.ppd
/etc­/cups/ppd/Canon-MP640.ppd
By editing these files with root access, you can

select more quality levels:
*OpenUI *CNQuality/Quality: PickOne
*DefaultCNQuality: 3
*CNQuality 1/Super High: "1"
*CNQuality 2/High: "2"
*CNQuality 3/Normal: "3"
*CNQuality 4/Standard: "4"
*CNQuality 5/Economy: "5"
*CloseUI: *CNQuality
print in black and white:
*OpenUI *CNGrayscale/Grayscale: PickOne
*DefaultCNGrayscale: false
*CNGrayscale false/Off: "false"
*CNGrayscale true/On: "true"
*CloseUI: *CNGrayscale
set a higher dpi rate:
*OpenUI *Resolution/Output Resolution: PickOne
*DefaultResolution: 600
*Resolution 600/600 dpi: "< >setpagedevice"
*Resolution 1200/1200 dpi: "< >setpagedevice"
*Resolution 2400/2400 dpi: "< >setpagedevice"
*CloseUI: *Resolution
You can also download my edited PPD file. The original one is released under the GNU GPL:
↶ canonmp640.ppd (30.6KB text/plain) or
↶ canonmp640.ppd.gz (4.5KB application/x-gzip)

Again you have to restart CUPS.

6. Final test
The printer driver comes with a handy status tool which is also the place to go if you want to find out what your printer currently does or if you want to check the availability. So cngpijmonmp640 shows you the printer status and ink level (screenshot at the top).

By the way…
Not only does the printer work, but of course also the scanner. I tested it successfully with xsane, ScanGearMP (single and over GIMP) and SimpleScan. Keep in mind that the sane-backends included in Lucid are too old for the MP640—but with the PPA mentioned above it’s very easy to have full compatibility by simply updating the package.

Moreover there is a RPM package for other distributions and the source.