can python do this?

Anssi Saari as at sci.fi
Wed Dec 2 12:55:16 EST 2009


Rounak <irounakjain at gmail.com> writes:

> I am a complete newbie. I want to know if the following can be done 
> using python or should I learn some other language:
> (Basically, these are applescripts that I wrote while I used Mac OS)
> 1.Web Page Image to Wallpaper:
> A script that takes the current image in a browser and sets it as a
> wallpaper. 
> http://forums.obdev.at/viewtopic.php?f=24&t=3462

I don't know if any Linux web browsers are particularly scriptable. 
Firefox at least is pretty much limited to opening URLs and some other
windows. OTOH, you can do that specific thing by just right clicking
on the image in question and selecting set as desktop background...

> 2.Screenshot with name, format, Dropbox upload and public URL
> I used to run this script,type the name for screenshot and press return.
> The screenshot would be uploaded to Dropbox and public url would be
> copied to clipboard.
> http://forums.obdev.at/viewtopic.php?f=24&t=3448

I think this should be easily doable with Python, at least the
screenshot and clipboard parts. You can write your own Python code or
use it as glue for utils like xwd, convert, xsel, xclip, xmessage...

No idea if there's any way to talk to Dropbox from Python again since
I know nothing about it.

> 3.Play, pause, set rating to track in iTunes (a music player) with
> keyboard shortcuts without activating iTunes. I know there is no iTunes
> for Linux but is there a scriptable player. See hundreds of scripts
> for iTunes here: http://dougscripts.com/

Don't really know again, I've found iTunes handy for managing
podcasts, but that use doesn't need scripting. In Linux, at least
Amarok is scriptable via Javascript. mplayer is generally scriptable
in its slave mode, but it's more a video player than music. mpd is a
music server which even has a Python client to control it (Sonata). 

But really, global hot key mapping is more of a windowing system thing
than a scripting thing. I'm sure you can map your keys to do anything
you want, in whatever environment you use in Linux.



More information about the Python-list mailing list