2013-12-22

Empty Trash Sound Workaround
for Ubuntu 12.04.3 
=============================================================
After 2 months of searching for a solution to get a trash-empty sound
in Ubuntu 12.04.3 a work-around solution, that works for me, became evident.
Maybe you will find it useful. If anyone has an improved solution then please share.

You will note in the script below that the "music123" app app was used.  
This application can be downloaded from the Ubuntu Software Centre. 
In my case it was downloaded and installed to the /usr/bin folder as described 
in an article on adding a shutdown sound to Ubuntu --> from here.  
That one worked great, and I even added the Ubuntu start-up sound.

The following script also uses the commands "trash-empty" and "trash-list".
These commands are part of the "trash-cli" command line utility.
The "trash-cli" app was downloaded from the Ubuntu Software Centre
and installed so that the script below could use the "trash-list" command to
check if there was trash to be emptied, and the "trash-empty" command
to actually empty the trash in all accessible trash bins.
=============================================================
1. Make the sound file (glass breaking sound was my choice)
    and called the file “trash-empty.ogg”. If you use the music123 app
    then any of the following audio file types can be used:
    .wav  .ogg   .oga   .mp3  (and maybe others-I have not checked).

         2. Next make a desktop launcher icon.

Give the launcher an appropriate name such as “empty-trash+sound.png”.

    3. The Following Script is launched from the desktop launcher:


 ------------------------------------------------------------------------------------------------------------------------------------

Linux Script to Empty Trash with sound of glass breaking. 

#!/bin/bash
#
# Name of script: empty-trash.sh
# script to empty trash with confirmation and empty trash sound event
# This script is located in /usr/local/bin

SOUND = "/usr/share/sounds/ubuntu/stereo/trash-empty.ogg"  # location of trash-empty sound file
trash-list > ~/.local/share/Trash/files/trash.lst  # list all trash in file "trash.lst"
file = ~/.local/share/Trash/files/trash.lst  # location of trash list file

if [ ! -s $file ]; then    # if the "trash.lst" file is empty

        rm -f $file;
        zenity --info --text "TRASH is EMPTY"

else                           # if the "trash.lst" file is not empty


        zenity --question --title "Confirm Yes/No" --text "EMPTY Trash Bin ?"

           case $? in       # Check whether user clicks on "Yes" or "No"
                0)
                trash-empty   # user asked for trash to be emptied
                /usr/bin/music123 $SOUND  # play trash-empty sound file
                ;;
           esac
fi 

------------------------------------------------------------------------------------------------------------------------------------
  4.  Make the script executable.
  5.  Create a launcher for this script. 


  6.  Add this launcher app to the top panel or wherever you like to have it.   I put it in the bottom panel.


If you have a trash bin on the desktop or elsewhere, it will continue to work properly and it will still show the full and empty trash bin icons. If you do not want to hear the trash-empty sound then you can right-click on your regular trash bin icon and empty the trash in the usual way.

To empty the trash and hear your chosen sound click on the launcher made for that purpose.  My trash-empty sound is that of breaking glass. You can choose whatever sound file you like, or make your own.


Here are the pictures of the dialogue pop-ups generated by zenity in the above script:

If the trash bin is full then the above confirmation dialogue appears.

If you click on "Yes" all the trash in all locations, including partitions and USB drives, will be emptied.

If the trash bin is empty (in all locations) then the above information dialogue appears.


~.~


joy,
walt

2013-11-23

video


King of Kensington  (Lyrics) ... See opening credits with song in video above.
- a Canadian sitcom set in Toronto, starring the late Al Waxman (2001)
- this one always
went over well when it was played in Canadian pubs
- many "fell in love" with the song and appreciated the message in the lyrics.
------------------------------------------------------------------------------------
When he walks down the street
     He smiles at everyone   
  ("Hey, look, It's the King!")
    Everyone that he meets
Calls him "King of Kensington"
     ("How ya doin', King?"
       "Put `er there, King!"
        "Hey Karen! It's King!")


He finds his fortune in the faces
           that surround him
His wife says helping other people
           brings him luck
But then his mother tells
           a slightly different story
He's the only king around without a buck

He's... a... man among men
      The people's champion
And when destiny calls him...
        (buzz... buzz..
           "I'm sorry,

              that line is STILL busy")
He's "King of Kensington".  
       ("Whatta guy!")

2013-07-14

Me and the Moon




Yet there she is – the lunar crescent:
Standing like a tilted dome in the sky.
Yes, ‘tis the middle of the day
And that heavenly globe
Reveals a sliver of her mystery.
Anyone who cares to raise their
Gaze to the heavens
Is pleasantly surprised.

Patches of green lawn starkly stand out
From the ever-present ribbons
Of paved road and driveways.
Magically, a robin alights
On the bare tree limb
A mere metre away – and flies off –
Startled to have come so close
To a seemingly silent human.
For me and the moon ‘tis a delight.

Like a guardian angel
She makes her monthly journey
Around this globe –
Bringing a bit of heaven to earth –
Especially in the dark of the night
When she glows in all her glory
Reflecting the majesty of life
Embodied in our star Sol.


Me and the moon –
An adventure in being.
It has travelled a bit –
I notice this as I take another peek
At that so-blue cloudless sky.
The music of summer is vibrating in the silent spaces
Between the noises of mechanisms and thought;
And that heavenly sphere moves on in silence.
In silent stillness it advances, spanning the space of life.
Here I sit in wonder, the moon and me.


-wladicus… 2013.07.14

2013-01-02

Simple, Portable, Electric Continuity Tester

contin00.png
If you have interest in the world of electricity and things electric, you might be interested in this little 'gizmo' I recently designed.
I placed all the details on the instructables.com site.
-----------------------------------------------------
If making this continuity tester interests you, then access the following link:
http://www.instructables.com/id/Basic-Electric-CONTINUITY-TESTER/

2013-01-01

Power Pack

00.jpg
Some of you may be interested in an emergency recharge power pack device for your PDA, iPod, cell phone, or other portable device.  If you purchase an adapter charging cable to charge your device from a car cigarette lighter socket, then this power pack can be used as a substitute 'car' charger plugin station.
--------------------------------------------------
Click on the following link if you are interested:
http://www.instructables.com/id/EMERGENCY-POWER-PACK-THE-EASY-WAY/