Volutions - ID | News | Gadget | Tutorial | Freeware | Template | Etc.: scripts
Showing posts with label scripts. Show all posts
Showing posts with label scripts. Show all posts

Show Desktop Icon For The Ubuntu Unity Launcher

Show Desktop Unity

Currently there's no "Show desktop" applet / icon for the Unity panel in Ubuntu 11.04 and while you can use Super + D to toggle Show Desktop, many are used to using an icon for this. So here's how to get such an icon on your Unity panel.


Instead of an actual applet you can use a small script we've posted a long time ago (back then, Docky was still a part of Gnome DO and it didn't have a "Show desktop" icon). To get it running, simply follow the steps below.


1. Firstly install wmctrl:
sudo apt-get install wmctrl

2. Download the script and .desktop file, extract it and place the "showdesktop" script in the /usr/local/bin folder using the commands below:
cd
wget http://webupd8.googlecode.com/files/showdesktop.tar.gz
tar -xvf showdesktop.tar.gz && rm showdesktop.tar.gz
sudo mv showdesktop /usr/local/bin/

If you want to manually download the file, get it from HERE.

3. Now you should see a file called "showdesktop.desktop" in your home folder - you can move it wherever you want (or leave it there) and then simply drag it to the Unity launcher and you'll have a "Show desktop" icon.

Known issue: when clicking the "Show Desktop" icon in the Unity launcher, you'll have to wait until the icon stops pulsating before clicking it again (that's about 10 seconds) or else the it doesn't do anything. If you know a way to fix this, please let us know in the comments! Update: you can middle click when the icon is pulsating if you don't want to wait (thanks to Mahdi for the tip!).


Post idea thanks to soee!

Top 10 Box Office Movies Wallpaper Generator

IMPloader is a script that fetches the posters for the top 10 Box Office movies of the week and automatically generates a wallpaper. You can customize how many images are used (but there's a maximum of 10), the style (black, white and polaroid), width and height of the wallpaper and border of the images.

Here are two examples of wallpapers generated using IMPloader:

IMPloader

IMPloader


Usage


To use it, you'll need Ruby and Imagemagick. Install these packages in Ubuntu using the following commands:
sudo apt-get install ruby imagemagick

Then, download the script from Gnome Look and extract it on your desktop.

Now you'll have to run the script - the first time is for generating the config file:
cd ~/Desktop/118501-Desktop
./imploader.rb

This will create a new config file under ~/.imploaderrc. Open it with gedit:
gedit ~/.imploaderrc

Here you can customize everything about your wallpaper. The config file is well documented so I'll not get into details. If you do not edit the "TEMPPATH" variable inside the config file, the new wallpaper will be created on your desktop (and it will be called collage.jpg).

Once you're done with the config file, run the script again and it should generate the wallpaper:
./imploader.rb

If you want the wallpaper updated once a day you can add a cron-job for this or simply add the imploader.rb script to your startup applications to generate a new wallpaper each time your computer starts.


Want more cool wallpapers? Check these out:

Easily Upload Files / Images To RapidShare, ImageShack Or TwitPic With PyShare

PyShare

PyShare is a collection of scripts that let you upload images, screenshots or other files to ImageShack, TwitPic or Rapidshare via right clicking the files in Nautilus.

The application then displays a list of links in the notification area so you can easily copy the direct links, HTML, forum code and so on:

PySHare


Further more, PyShare supports uploading to your account for all the 3 services (RapidShare, ImageShak and Twitpic).


Install PyShare


1. Install the dependencies:
sudo apt-get install python-pycurl scrot

2. Download PyShare from Gnome Look and extract it.

3. In the PyShare folder, double click the "install.sh" file and select "Run in terminal" - this will install the scripts. Please note that you cannot remove the PyShare folder because the install script only creates links to the files so this is required for it to work.

Once installed, right click a file in Nautilus and select Scripts: you'll then be able to select "SendFiles" to directly upload a file", or take a screenshot and upload it automatically.

Script To Synchronize All Your Last.fm Play Count With Rhythmbox

Rhythmbox lastfm playcount

A while back we wrote about a Rhythmbox plugin that synchronizes your Rhythmbox play count with Last.fm and that's pretty cool but the plugin only does this once you play a track. So what if you want to synschronize all your Rhythmbox play counts with Last.fm? Well, there's a script for that (actually 2)!


1. Install the dependencies:

sudo apt-get install python-beautifulsoup python-qt4 bzr

2. Download Lastscarpe from HERE (make sure to download the Linux and not the Windows version) and extract it in your home folder.

3. To get every song you've listened from Last.fm, go the newly extracted folder and you can either run "guy.py" to do this the graphical way or use the following command to dump all your songs to a file called "dump":
cd && cd lastscrape-0.0.4
./lastscrape.py YOUR_LASTFM_USERNAME dump

Now the script will retrieve all your song history. This might take a while (it took more then an hour for all my 54.000 Last.fm songs).

4. You need to download the "rb-mergeplays" scripts from Launchpad:
cd
bzr get lp:rb-mergeplays

Once the scripts are downloaded, copy the file created under step 3 (called "dump" - if you've followed our exact instructions you should find it under ~/lastscrape-0.0.4) into ~/rb-mergeplays

5. At this point you're ready to import the last.fm play count into Rhythmbox

Firstly make a backup of your Rhythmbox library:
cp ~/.local/share/rhythmbox/rhythmdb.xml ~/.local/share/rhythmbox/rhythmdb.xml-backup

Begin the import:
cd ~/rb-mergeplays
python ./mergeplays.py


"rb-mergeplays" contains another interesting script which lets you import your Last.fm loved tracks into Rhythmbox. The process is fairly easy so head over to the rb-mergeplays page for instructions (scroll down to RATE5LOVED.PY).

Automatically Install All The Google Web Fonts In Ubuntu Using A Script

Google Font Directory

I was reading on Femtux about a Google Web Fonts package for ArchLinux and though I'd make one for Ubuntu. I didn't create a .deb but instead I've modified the original ArchLinux script to download and install all the Google Font Directory fonts on Ubuntu. You can of course manually download the fonts from HERE if you want, but using this script you can install all of them in a few seconds. The fonts included are the new Gnome 3 font, Chrome OS font, Ubuntu font and many more.

What the script does is download all the fonts from Google Font Directory (it includes around 76 fonts, each with many variations that you can use on your desktop or various designs) and installs them under /usr/share/fonts/truetype/google-fonts/ (so if you want to remove them, simply delete that folder).


To download and install all the Google Web Fonts in Ubuntu, open a terminal and type the following commands:
cd && wget http://webupd8.googlecode.com/files/install-google-fonts
chmod +x install-google-fonts
./install-google-fonts

If you want to take a look at the script before running it, download it from HERE.

Once the script finishes downloading and installing the fonts, you can go ahead and try them out. If you want to use one of the Google Web Fonts for your desktop, right click your Desktop, select "Preferences" and set the new font on the "Fonts" tab.

The script creates a "googlefontdirectory" folder in the directory where you run it (your home folder if you've followed our exact instructions) - you can either delete this folder or keep it and the next time you run the script, it will only update the fonts instead of completely downloading them all over again.


Want more fonts? Also see:

Get Caps / Num / Scroll Lock Keys NotifyOSD Notifications Using Compiz And A Script

lock keys notifications

Using this tweak you will get NotifyOSD notification bubbles when the caps lock, num lock or scroll lock status changes (you press a lock key).


One way of getting NotifyOSD notifications when you press the Caps Lock, Num Lock and Scroll Lock keys is using Indicator Keylock - which displays the lock keys status using both NotifyOSD and an appindicator.

But if you only want NotifyOSD notifications, you can do this without installing Indicator Keylock - by using a patched NotifyOSD provided by Leolik, a script and Compiz. This is a tweak Antoni "Pinguy" is using in his latest Pinguy OS 10.10 and he shared this tip with us so you can use it even if you don't want to install Pinguy OS.


How to set up and use the Lock Keys script

1. Optional: install the patched NotifyOSD we've talked about a while back - this makes the notifications respect the timeout passed by the script. Without this package, the notifications will be displayed for 10 seconds which is annoying in some occasions.

sudo add-apt-repository ppa:leolik/leolik
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install libnotify-bin
pkill notify-osd

2. Download the script from HERE and save it somewhere on your system (like a "scripts" folder in your home directory for example). Then right click the file, select "Properties" and on the "Permissions" tab, check the "Allow executing file as program" box.

3. Make sure you have CompizConfig Settings Manager installed:
sudo apt-get install compizconfig-settings-manager


compizconfig settings manager commands tab

Go to System > Preferences > CompizConfig Settings Manager, enable the "Commands" plugin (if not already enabled) and on the commands tab, for 3 empty command boxes, enter this:

/path/to/lock_keys caps
/path/to/lock_keys num
/path/to/lock_keys scrl

In the above commands, replace "/path/to/lock_keys" with the exact path to where you've save the lock_keys script (downloaded in step 1).

4. On the same CompizConfigSettings Manager Commands plugin, go to the "Key Bindings" tab and for the "Run command X" corresponding to each command enter under step 3 press the "disabled" button, then press "Grab key combination" and press the key corresponding to the command (caps, num or scroll lock). When assigning a key such as Caps Lock, Num Lock or Scoll Lock, after pressing the key, press ENTER or else Compiz will not assign the key and will wait to press some more keys!

Compizconfig settings manager key bindings

And you're done!



Thanks to Antoni "Pinguy" for the script tip! Script credits: red_five and excedio

Split Single Lossless Audio Files To Flac Or mp3 Using A Nautilus Script

split lossless nautilus script

Some music players like gMusicBrowser (and many others) can't read .cue files so you may want to split those single lossless audio files into multiple flac or mp3 files.

There is a tool for that called gCue2Tracks but it didn't work that well in the test I ran today: to split to mp3 it firstly converts the files to .wav and only then to mp3 which takes a lot of time; I've tried to use it to split an .ape file to mp3 with a 320 kbps quality (disabled vbr) yet the converted mp3s were 110 kbps; and finally it fails to convert to wv which probably means it doesn't work the other way around either.

Because of the two reasons above, WebUpd8 reader CokiDVD has created a nautilus script which can split single lossless audio files (ape, flac, wavpack) by .cue file into flac or mp3 (320kbps or 192kbps). Further more, the script also adds tags to the new files so all the resulting flac or mp3 files will have the artist, album, title and genre tags set up automatically.

Install the packages required by the script


The script requires some packages to be installed to be able to split loseless audio files as well as Zenity for the GUI. Install the dependencies in Ubuntu by using the following commands:
sudo add-apt-repository ppa:adrian-m-benson/ppa #required for a newer shntool to fix a bug with wavpack
sudo add-apt-repository ppa:flacon/ppa #required for MAC package
sudo apt-get update
sudo apt-get install shntool cuetools flac wavpack lame mp3info zenity mac

Download and install the script

To download and "install" the script, use the following commands:
cd ~/.gnome2/nautilus-scripts
wget http://webupd8.googlecode.com/files/splitlossless.tar.gz
tar -xvf splitlossless.tar.gz && rm splitlossless.tar.gz
chmod +x "Split Lossless"

If you want to set it up manually, download the script from HERE.

Now to use it, simply right click a single losless audio file (.ape, .flac or .wv) and select Scripts > Split Lossless. At this point, a window will pop-up asking you to select the .cue file for that lossless audio file - select it and you can then chose the audio format in which to split the file (flac or mp3).


Thanks to CokiDVD for the script!


See also: Split APE and FLAC Files in Ubuntu and Add Tags by Cue File

Set Up Aero Snap In Ubuntu (w/ Compiz) Using A Script

I've recently seen a screencast by gotbletu about setting up hot corners for the Compiz Grid plugin which is a lot like Aero Snap but better in my opinion so I wanted to make this very easy to set up for everybody. After using the script in this post, you can move a window to a screen corner by right clicking the corner in which you want to move the active window to.

"Aero Snap" for Ubuntu (using Compiz) is not hard to set up but it requires a lot of copying and pasting so I though I'd make a script to do everything automatically so to achieve exactly what you see in the video, all you have to do is run the script I've created.


Bur firstly, what does the Compiz Grid plugin do?

The Compiz Grid plugin can be used to tile, position and resize your windows to fit an imaginary grid. All you have to do is press Ctrl + Alt + Keypad numbers to place the selected windows; for instance: Ctrl + Alt + 1 will move a window to the bottom left corner, Ctrl + Alt + 7 will move a window to the top left corner and so on.

By default you can't assign a Compiz hot corner to the Grid plugin which would be really helpful, but you can achieve this by using a package called "xautomation" and the Compiz Commands plugin.

Here is the screencast by gotbletu in which he is using the Compiz Grid plugin to set up Aero Snap in Ubuntu to see exactly what I'm talking about:



Set up Aero Snap in Ubuntu using Compiz and a script


Warning: by using this script, the commands from 0 to 7 from the Compiz Commands plugin will be overwritten so if you have some custom commands, save them in the last 4 command fields!

To get Aero Snap in Ubuntu, simply copy / paste the following commands in a terminal:
wget http://webupd8.googlecode.com/files/grid-corners
chmod +x grid-corners
./grid-corners

The script installs compizconfig-settings-manager, compiz-fusion-plugins-extra and xautomation, enables the Compiz Grid and Commands plugins and sets all the commands and keybindings to a screen edge and mouse button 3 (right click). If you want to use a different mouse button, you can either manually change this in the Compiz Commands plugin or edit the script (it's easier - use search and replace) and run the script again.

Once you run the script, click a window, then place your mouse pointer to a screen corner/edge and right click.

By using the Grid plugin, the windows will also get resized when moved to a corner. If you don't want this, disable the Compiz Grid plugin and use PyWO instead (all you have to do is run it on starup).


For a different way to get Aero Snap in Ubuntu (but you'll still have to use Compiz), check out THIS video on YouTube (also read the video description - it includes a file you can download that has all the commands required to set up Aero Snap in Ubuntu). P.s.: the video also includes instructions on installing 'cowsay' and 'figlet' - you can ignore those and skip to the Aero Snap part.


[video and xautomation commands via gotbletu]

YAD: Zenity On Steroids [Display Graphical Dialogs From Shell Scripts]

Those of you who like writing bash scripts and use Zenity for a GUI should give YAD a try. YAD (Yet Another Dialog) is a fork of Zenity with many improvements, such as custom buttons, additional dialogs, pop-up menu in notification icon and more. I've been using it for Y PPA Manager so if you want to see it in action, give Y PPA Manager a try.

Unfortunately even though Zenity is constantly updated, these updates only bring language updates and fixes. Here is where YAD shines: basically most of the stuff you ever wanted to do in Zenity is available in YAD: you can have as many buttons as you want, each with the text you want, a really nice icons dialog (which I've used as the main Y PPA Manager UI) and many more. Here's an example of a YAD dialog you could never get using Zenity:

YAD


If you want to convert a script from using Zenity to YAD, there are a few things you'll have to change, but it's worth it. YAD doesn't have all the useless dialogs such as --error, --info, --notification, --question or --warning - instead, it has a --form dialog to which you can add whatever message, buttons and icons you want. For help on using YAD (it's quite easy!), see the examples sections at it's Wiki or have a look at Y PPA Manager code. Here is the code (thanks to ananasik) used to generate the dialog in the above screenshot:
yad --title="Desktop entry editor" --text="Simple desktop entry editor" --form --field="Type:CB" --field="Name" --field="Generic name" --field="Comment" --field="Command:FL" --field="Icon" --field="In terminal:CHK" --field="Startup notify:CHK" "Application" "Name" "Generic name" "This is the comment" "/usr/bin/yad" "yad" FALSE TRUE --button="WebUpd8:2" --button="gtk-ok:0" --button="gtk-cancel:1"

Install YAD in Ubuntu

If you're using Ubuntu, you can install the latest YAD from the Y PPA Manager WebUpd8 PPA (available for Ubuntu Karmic, Lucid, Maverick and Natty):
sudo add-apt-repository ppa:webupd8team/y-ppa-manager
sudo apt-get update
sudo apt-get install yad

To see all the available options, type:
yad --help-all

For those of you who don't use Ubuntu, download YAD source @ Google Code.

If you find a bug or have a feature request, don't hesitate in reporting it on YAD's Google Code page - it's developer is really nice and he always tries to help.

Nautilus Dropbox Share Script, Now Available In An Ubuntu PPA

A while back I wrote a Nautilus script for easily sharing any file or folder using Dropbox, via right click. But scripts get lost, especially since most people do a clean Ubuntu install every 6 months. Also, I guess it's easier to simply install it from a PPA / .deb then having to manually install the dependencies and moving the script to the right folder and so on. For this reason, I've packaged my Dropbox Share script in a .deb and uploaded it to the main WebUpd8 PPA.

A little recap on what Dropbox Share does: using it, you can right click any file or folder (!) on your computer and share it via Dropbox. The script creates a link to the file / folder you want to share, in your Dropbox Public folder and automatically copies the link(s) to the clipboard so you can paste it in an email, IM window and so on.


Why using this script is better then copying some files in your Public Dropbox folder:
  • because the script uses symbolic links, the files aren't actually copied to your Dropbox public folder, so they won't take the double amount of space
  • all the links are automatically copied to the clipboard
  • you can even share folders, even though Dropbox doesn't allow this by default (the shared folder will have an "index.html" file and thus opening its link in a web browser, it can be easily accessed via a web browser)

But since explaining all this is wrather difficult, here's a video I've recorded back when I've released version 0.2:




Install Dropbox Share in Ubuntu

Before installing Dropbox Share, make sure you remove any previous versions of the script (both Dropbox Share and Dropbox Unshare) you may have in ~/.gnome2/nautilus-scripts:
rm ~/.gnome2/nautilus-scripts/"Dropbox Share"
rm ~/.gnome2/nautilus-scripts/"Dropbox UnShare"

Dropbox Share is available for Ubuntu Karmic, Lucid, Maverick and Natty, but has only been tested on Lucid and Maverick. To add the PPA and install Dropbox Share, use the following commands:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install dropbox-share


If you're not using Ubuntu, you can get the script from our previous post: Share Any File Or Folder With Dropbox Via Right Click (Nautilus Script) - New Version


The .deb package also comes with the Dropbox Unshare script - thanks to Nicolargo. Credits for Dropbox Index which is used by Dropbox Share: kosciak1.


And since this is a post about Dropbox, here's a tip for you: you can grab up to 768 MB free dropbox space through social media connections - click HERE (don't worry, I don't win anything if you click that link).
 
Support By Blogger