Powered By

Powered by Blogger

Tampilkan postingan dengan label zenity. Tampilkan semua postingan
Tampilkan postingan dengan label zenity. Tampilkan semua postingan

Jumat, 03 Desember 2010

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.

Selasa, 09 November 2010

2ClickUpdate 6.0 Adds Ubuntu 10.10 Support

2CLickUpdate

2ClickUpdate is a front-end for system updates that checks for and installs updates, removes unnecessary files and cleans up after installing the updates. It works on any Debian/Ubuntu based Linux distribution.

2ClickUpdate is a shell script with a GUI provided by Zenity that uses axel (similar to apt-fast) for handling the downloads (so the downloads are a lot faster then regular updates) and NotifyOSD notifications.


2ClickUpdate automatically performs the following actions:
  • Refreshes your package list.
  • Installs the latest updates for your applications and system libraries.
  • Removes packages that were automatically installed to satisfy dependencies for some packages that are no more needed.
  • Removes packages and configuration files which are not required by any other software upon your system.
  • Removes all stored archives in your cache for packages that are no longer in the repositories or that have a newer version in the repositories.
  • Deletes from cache the downloaded packages to free up some space.

All with just 2 clicks (thus the name).


2ClickUpdate is available in 20 languages and the latest version (6.0) finally works with Ubuntu 10.10 Maverick Meerkat. Other new features in 2ClickUpdate 6.0 include:

  • RamCleanApt, which optimizes RAM memory freeing up some MB's.
  • Redesigned User interface in 2Click Update
  • 2cuCORE (a command line version of 2ClickUpdate) edition is also available in .deb packages for easy installs/uninstalls
  • SmartApt module for installing/upgrading is now based on Update Manager


Here is a video demoing the latest 2ClickUpdate recorded by its developer, Salih EMIN:





Download 2ClickUpdate 6.0 (GUI ) - available as a .deb | Once installed, launch it via the Applications > System Tools > 2ClickUpdate menu item.


Thanks to Salih EMIN for the news and video!

Sabtu, 30 Oktober 2010

Java (JDK) Updater - Script To Update The Java (JDK) Paths After Manual Installation

Ubuntu is kind of slow at updating JDK in the official repositories. And not only that but if you've used Ubuntu 10.10 Maverick Meerkat before the final release, you probably know that Java has only been uploaded to the Ubuntu Partner repository a few days before the final release so you could either use the Ubuntu 10.04 repository or manually install Java.

When you manually install JDK, you have to update the paths to get it to work. For this, you can use a script created by WebUpd8 reader Bruce Ingalls (this is actually a new version as we've already wrote a while back about this script) which uses Zenity and can easily update the Java (JDK) paths - all you have to do is select the folder where you've installed Java and the script will do the rest.


The script only works for Ubuntu (10.04 and 10.10) and I've packages the script in a .deb file which is available in the WebUpd8 PPA so you can install it using the following commands (for Ubuntu 10.04 and 10.10):
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install update-java

Or you can manually download the .deb (works with both Lucid and Maverick)

Once installed, you can launch it via the Applications > Other > Update Java menu item.

If you want to use the script without adding the PPA, you can download it from HERE.

In case something doesn't work, you can create a bug report using the following command:
bash -x /usr/bin/update-java > ~/bugreport.txt 2>&1


How to use install the latest Java (JDK) manually (this is just an example for the latest Java JDK):


Firstly, you'll have to download Java (JDK) from HERE. Then you'll have to move the .bin file to /usr/local/ and run it:

sudo mv jdk-6u22-linux-i586.bin /usr/lib/jvm/
sudo chmod +x jdk-6u22-linux-i586.bin
sudo ./jdk-6u22-linux-i586.bin

Then simply run the Update Java script - either from the menu (if you've installed the .deb) or manually run the script and select the folder where Java JDK has been installed and select the folder where you've installed JDK manually (in my example it should be /usr/local/jdk1.6.0_22).


Thanks to Bruce Ingalls for the script!

Selasa, 25 Mei 2010

Nautilus Script To Compress PDF Files

Ricardo Ferreira (who sent us quite a few tips before) wrote a nice Nautilus script which comes with a GUI (Zenity) to compress and optimize PDF files called Compress PDF.

The script currently comes in multiple languages: English, Spanish*, French*, Czech* and Portuguese (but you can translate it into your language if you want - there are only 10 short lines to translate) and you can choose between 5 different compression levels: Screen-view only, Low Quality, Hight Quality, High Quality (Color Preserving) and Default:

compress pdf script

As an example: compressing a PDF using the "Default" preset, the file size was reducced from 4,6mb to 3,3mb with no visible quality lost.


To "install" this Nautilus script, simply paste this in a terminal:
sudo apt-get install zenity ghostscript #dependencies
cd ~/.gnome2/nautilus-scripts
wget http://launchpad.net/compress-pdf/1.x/1.1/+download/Compress-PDF-1.1.tar.gz
tar zxvf Compress-PDF-1.1.tar.gz



Then to use it, simply right click on a PDF file and select "Compress-PDF" from the "Scripts" menu:

nautilus right click compress pdf



Credits for this script (and many thanks!): Ricardo Ferreira



*Spanish translation by Eduardo Battaglia
*French translation by astromb
*Czech translation by clever fox


Many thanks to all who translate the script!

Selasa, 20 April 2010

Java Update Script For Ubuntu - Version 0.2b

Bruce Ingalls sent us a new and much improved version of his Java Update script for Ubuntu. The script uses Zenity for a GUI so it's very easy to use.

Initially the script only updated JDK (which included JRE), but now can also update Java Runtime Environment separately.


To use it, download JDK or JRE from HERE (by the way, there's a new version available!), extract and install it, then run this script to set the correct paths across your system.

Download and run Update Java script:
sudo apt-get install zenity
wget http://webupd8.googlecode.com/files/update-java
chmod +x update-java
sudo ./update-java

Or manually download it from HERE.


Credits for the script and many thanks: Bruce Ingalls.

Minggu, 11 April 2010

JDK Linux Update Script

WebUpd8 reader Bruce Ingalls sent us script which should make it easy for users to upgrade JDK. The script doesn't download JAVA or install it, but after you do that it updates the the path to the new JDK location.

Why use it?

Well, for instance JDK 1.6.0_19 was recently released and instead of creating symbolic links after installing it (which is not the recommended way to do it), you can use this script.


How to use JDK Linux Update Script



After downloading JDK from HERE, extract it and place the extracted folder to /usr/local/

Then simply run the script. It will detect your installed version and update to the new one.

To download and run the script, simply paste this in a terminal:
sudo apt-get install zenity
wget http://webupd8.googlecode.com/files/jdk-update.sh
chmod +x jdk-update.sh
sudo ./jdk-update.sh

Jumat, 09 April 2010

Ubuntu 10.04 First Time Use Script 0.2 Released: It Now Comes With A GUI

Update 18 Apr. 2010: A new version of the script has been released. Please see: What To Do After A Fresh Ubuntu Install Script - New Version Released [Ubuntu 10.04 Lucid Lynx]


If you liked the script in our "What To Do After Installing Ubuntu 10.04 Lucid Lynx? Run This Script!" post, you'll be glad to know that version 0.2 is out.


What's new in "Ubuntu 10.04 First time use script" (if you come up with an actual name, please do let us know =) ):
  • it now comes with a GUI - well, almost, it uses Zenity so all you have to do is check some boxes and the script will do the rest
  • the script now auto accepts the JAVA license when installing it, so you don't have to do this yourself anymore
  • added Dropbox installation (including the Dropbox repository which is for Karmic for now but it works on Lucid too - it will be updated to the Lucid repository when Dropbox will release it)
  • Install development tools (from build-essential to Subversion and GIT)
  • added gnome-do
  • Remove drive icons from desktop gconf tweak
  • Fix Google Chrome repository slowness for "apt-get update"
  • added a new Gconf tweak: disable the GDM login screen user list - I find it a security leak for Ubuntu to display your username when logging in.
  • the script no longer removes Empathy and the central-european settings for MPlayer and Totem have been removed.
  • it now requires you run it with "sudo"



Besides the new additions above, here are the rest of the features:
  • add extra repositories (Medibuntu, Getdeb, etc.)
  • install Ubuntu Tweak
  • install codecs, web browser plugins (Java, Flash), additional support for archives (RAR, 7-Zip) and additional fonts; installs the latest Flash Player for Ubuntu 10.04 Lucid Lynx 64bit from Adobe's website
  • Gconf tweaks: move the Metacity window buttons back to the right, disable the GDM login sound, fix the update manager behavior to always show updates and enable the icons in menus and buttons
  • install GIMP (which has been removed from Ubuntu 10.04 Lucid)
  • install VLC
  • install Thunderbird email client
  • install Chromium web browser
  • install Google Chrome - the latest dev version (it will download the 32 or 64 bit version automatically from Google - depending on your system architecture)
  • install WINE
  • install MPlayer
  • install Pidgin instant messaging client


ubuntu 10.04 script

ubuntu 10.04 script


Please note: We're doing my best to make sure everything works but there might be errors. If you encounter any errors, please let us know in the comments!


Download and run the script:
sudo apt-get install zenity
wget http://launchpad.net/ubuntustart/0.4.x/0.4.9/+download/ubuntu-10.04-start-0.4.9.13.tar.gz
tar -xvf ubuntu-10.04-start-0.4.9.13.tar.gz
cd ubuntu-10.04-start/
sudo ./ubuntu-10.04-script



Update: now the script in this post is version 0.4 which fixes a few things as well as some minor new features:

#added Skype 32bit and 64bit download & install
#sudo check: the script exists if it is not run as sudo
#install compizconfig-settings-manager
#show dialog when going from step 1 to step 2 and show "Done" dialog when all the packages in step 2 have been installed
#fixed 'disable GDM login sound'
#some other fixes
#since the post was first published (initially version 0.2), there were some other things added to the script on the fly, as the user suggested in the comments


I've changed the download link but the old link still works and it points to the 0.4 version even if it's name is v0.2.

Update 18 Apr. 2010: A new version of the script has been released. Please see: What To Do After A Fresh Ubuntu Install Script - New Version Released [Ubuntu 10.04 Lucid Lynx]

Minggu, 28 Maret 2010

Zenity + Bash Audio Converter Script Updated

zenity bash audio converter script

The script created by WebUpd8 reader Remy which we were telling you about a few days ago just got updated.

The new version can convert to / from two more formats: flv and aac (it used to work for lac, mp3, wav and ogg), and an quality selector for ffmpeg has also been added. This version also checks if a file exists and asks if you want to open Nautilus.


To use it, firstly install zenity and ffmpeg:
sudo apt-get install zenity ffmpeg 


And then download and run the script using these commands:
wget http://raymii.org/cms/content/downloads/easyconverter.sh
chmod +x easyconverter.sh
./easyconverter.sh


For more info, check out Remy's post @ raymii.org (thanks once again!).

Rabu, 24 Maret 2010

Zenity + FFmpeg Bash Script To Convert flac, mp3, wav and ogg Audio Files

WebUpd8 reader Remy sent us a tip with a bash script which uses Zenity and ffmpeg for easily converting various audio files. It can convert from / to flac, mp3, wav and ogg.


Using the script is very easy so it should be very useful for lots of people. The first thing you need to to to get it working is to install Zenity and ffmpeg. To do this in Ubuntu, simply paste the following command in a terminal:

sudo apt-get install zenity ffmpeg

Then, to download and run the script, use the following commands:
wget http://raymii.org/cms/content/downloads/easyconverter.sh
chmod +x easyconverter.sh
./easyconverter.sh

You can check out the script code HERE.


Once you run the script, it will ask you to select a folder which should contain the audio files you wnat to convert. Then you will have to select the audio files original format:

convert mp3


and then the output format:

convert ogg


And then you can start the conversion:

convert ffmpeg zenity


The files resulted after the conversion will be placed in a folder called "converted" in the same directory as the files you converted.



Credits and many thanks for the script: Remy (Raymii.org)