Evening, all.
Honestly, the things I get up to when I'm at a loose end...
TrayControl was inspired by the fact that radky has included a Menu item at the foot of the 'Multimedia' menu in DPup 'Stretch'.....called, quite simply, 'CD-Eject'. It does exactly what it says; it ejects the loading tray for your CD/DVD drive.
So; I got to thinking. Whoa..... Bad for my grey cell, too much of that kinda thing..!
I knew pBurn lets you both eject and load the drive tray while you're using it. So, I did a wee bit of research, and found that the commands involved are included in every Linux distro ever built:-
Quite simply, 'eject' to, well, eject.....and
'eject -t' to close it again.
(from this webpage.)
So, daft bugger that I am, I adapted something I built for the Chrome browser builds I produce.....and put together a 'standalone', point-and-click GUI for opening & closing the optical drive tray. Just because, well.....because I could. It runs from an icon in the notification area:-
....and looks like this:-
It's totally pointless & nonsensical; a truly daft thing to waste my time on. But.....what the hell, we all need a good laugh now and then. (*shrug*)
Some wag on the page I linked to above even suggested you could create your own, personal 'cuckoo clock'.....by writing a script to build those 2 commands into an hourly cron job. (Oh, for Chrissakes..... )
Still; I guess you could (if you were so inclined..!!)
It's all good fun.
For anyone who fancies a laugh, you can find 'em here:-
https://drive.google.com/drive/folders/ ... sp=sharing
There's one of each, due to the included YAD binary.
Enjoy!!
Mike.
TrayControl_v1.0
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
Whoa, steady on, lad. Haven't thought that far ahead yet....Pro wrote:if i have 2 CD/DVD drive?
I only threw this together for a laugh last night. You're right, some folks do have multiple optical drives (I've got a second empty bay in my own desktop, should I want one).....but it's not that common.
I'll have to do some research, and figure that one out. I'm not really a 'script kiddie', and have a lot on my plate besides messing around with Puppy, so.....it may be a while yet. (Don't take this too seriously; remember, Puppy's all about having fun!)
In the meantime, for those of us with a single drive, this'll work fine.
Mike.
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
@ Art:-artsown wrote:Mike, I'm glad you posted your "one liner" since it provides a good
working example of how to use yad.
Art
In actual fact, that one-liner was figured out mostly by Fred and musher0. I've used it quite a few times since, in various things; small utilities I prefer to keep readily available in the notification area.
Yeah, I know; many of the older crew can't understand why I don't do these sort of things in GTKdialog. The trouble is, I started playing around with YAD about 3 years ago, using Smokey's online guide.....and I've got quite good at putting little GUIs together with it. It's a piece of cake to compile, and it doesn't really take up that much space.....especially considering that even 'old' computers generally now have at least a dual-core CPU, in addition to fair-sized amounts of RAM. The really 'low-powered' hardware that was around when Puppy first came onto the scene isn't so common any more, so I don't really see that Puppy's becoming quite as 'bloated' as the old guard say it is.
Besides, I've got to learn another whole new 'language' for GTKdialog....
Code: Select all
#!/bin/sh
#
#YAD 'one-liner' from musher0 / fredx181, to place executable tray icon in notification area
#
yad --notification --text="Eject CD/DVD Tray" --command='/usr/local/bin/TrayControl.sh' --image='/usr/local/lib/X11/pixmaps/eject.png' 2>/dev/null
(Yes, I'm getting reasonably proficient with the command-line after all this time, but I'm still a 'point & click' guy at heart (a hang-over from I don't know how many different versions and years of Windoze). I like making things as easy to use as possible.....and if that kind of approach sits well with newbie 'refugees' from Windoze, well, that all helps to convince them that the kennels aren't such a bad place to be after all... )
'New blood' never hurts.
Mike.