| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
|
By Kenny_Strawn at 2011-02-23 23:46
|
|
Despite what Google says about Google Cloud Print not being available for Linux, it actually is -- in the form of a Python script that you can execute on your Linux system and be able to print from your Cr-48 on it.
Now for the dependencies: Apparently, you need Python (2.7 or older; 3.x will *NOT* work) and pycups to be able to use this script. You also need git to check out the source and a printer configured on your Linux system (even networked will do).
Arch users: You will have to build Python 2.7 from source, but thankfully on my ArchBang system all the build dependencies were installed. You will also need to download pycups from here and build it from source after building Python 2.7.
After Python (2.7 or older) and pycups are installed, let's get started:
Code:
su - #or sudo su -
git clone git://github.com/armooo/cloudprint
Then, after you check this git branch out, run the following commands:
Code:
cd cloudprint
./cloudprint.py
This script will add your printer to Cloud Print, and then you can print from anywhere provided that this script is running.
You can also run the script on startup. To do this, you need to create another script -- /etc/init.d/cloudprint (/etc/rc.d/cloudprint on Arch) -- so that init can run it as a daemon:
Code:
nano /etc/init.d/cloudprint #again, *or* /etc/rc.d/cloudprint
The code to add to the file:
Code:
#!/bin/bash
# /etc/rc.d/cloudprint
# Description: Starts the Google Cloud Print script on startup
# ----------------
#
### BEGIN INIT INFO
# Provides: Cloud-Print
# Required-Start: $cups $network $local_fs $syslog
# Required-Stop: $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Start Google Cloud Print
### END INIT INFO
case $1 in
start)
# echo -n "Starting Google Cloud Print: "
/root/cloudprint/cloudprint.py
;;
stop)
# echo -n "Stopping Google Cloud Print: "
killall cloudprint.py
;;
restart)
# echo -n "Restarting Google Cloud Print: "
killall cloudprint.py
/root/cloudprint/cloudprint.py
;;
# echo "Usage: cloudprint {start|stop|restart}"
esac
I have tested the start method, but I'm not so sure about killall as it can sometimes not work as intended. Enjoy!
|
|
|
|
All times are GMT -5. The time now is 11:28 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|
And if you have a linux box switched on anyway (with printer) can't you just share it via that box?
Derry
I have problem with cloudprint.py, when I start it, I get the following error message:
Traceback (most recent call last):
File "/usr/bin/cloudprint", line 8, in <module>
load_entry_point('cloudprint==0.2', 'console_scripts', 'cloudprint')()
File "/usr/lib/python2.6/site-packages/cloudprint/cloudprint.py", line 304, in main
sync_printers(cups_connection, cpp)
File "/usr/lib/python2.6/site-packages/cloudprint/cloudprint.py", line 227, in sync_printers
cpp.add_printer(printer_name, description, ppd)
File "/usr/lib/python2.6/site-packages/cloudprint/cloudprint.py", line 131, in add_printer
'capabilities' : ppd.encode('utf-8'),
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 52637: ordinal not in range(128)
Could you help me how to resolve this error?
Thanks.
This is printing from android device with cloudprint app.
I followed your tuto and I have one major problem.
The service does not start automaticaly at startup...
I only created the /etc/init.d/cloudprint file and add a chmod +x cloudprint.
Do you have an idear ?
/etc/rc.local
and add this line before exit 0:
su user -c /usr/bin/cloudprint &
bye
Paolo Rampino aka Akirad