After doing the keyboard binding, i wanted to experiment further and try to run multiple commands from the single keyboard shortcut. Basically, the inspiration was managing the OLD style eject operation found in Gnome, wherein the notification daemon used to show : “Ejecting Media Drive” followed by the eject operation.
After alot of tricks (even trying putting semi-colon between commands in the keyboard shortcut assigning window, which grandly failed !!), i zeroed in onto creating a simple bash script :
notify-send -i /usr/share/icons/gnome-colors-common/scalable/notifications/notification-device-eject.svg “Eject” “Ejecting Media Device”
NOTE THAT you need the libnotify-cil or libnotify-cli package in your distro to make the above shown notification happen.
Thats it. Save the file (name = script.sh) in your homefolder somwehere, say : /home/laptop/Public/
Now, perform the following steps:
- in your terminal, type : chmod +x /home/laptop/Public/script.sh
- Now, open Keyboard Shortcut Window from preferences menu
- Click on ADD button
- Name the entry as Eject CD Drive
- Enter the command as : /home/laptop/Public/script.sh
- Click OK
- Click on extreme right of the new entry you just made
- Specify your keyboard binding for this entry.
And its done.. When you press the key combinations you just specified, it’ll show up the notification as shown in the image above. ENJOY !!!