Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 20 Jun 2019, 03:25
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
TrayControl_v1.0
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [6 Posts]  
Author Message
Mike Walsh


Joined: 28 Jun 2014
Posts: 5057
Location: King's Lynn, UK.

PostPosted: Wed 24 Apr 2019, 19:19    Post subject:  TrayControl_v1.0
Subject description: A GUI, 'point'n'click' way to open/close your CD/DVD drive 'tray'.....for the TRULY lazy!!
 

Evening, all.

Honestly, the things I get up to when I'm at a loose end... Laughing Shocked

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..! Laughing

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. Rolling Eyes 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*) Laughing Laughing Laughing

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/1_3dwu_2NfhwJb7gewcQOvSpRaNvLJj2N?usp=sharing

There's one of each, due to the included YAD binary.

Enjoy!!


Mike. Wink

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
Pro

Joined: 12 Feb 2010
Posts: 112

PostPosted: Wed 24 Apr 2019, 20:24    Post subject:  

if i have 2 CD/DVD drive?
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 5057
Location: King's Lynn, UK.

PostPosted: Thu 25 Apr 2019, 06:42    Post subject:  

Pro wrote:
if i have 2 CD/DVD drive?


Whoa, steady on, lad. Haven't thought that far ahead yet....

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. Wink

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
artsown

Joined: 12 Sep 2012
Posts: 336

PostPosted: Thu 25 Apr 2019, 08:18    Post subject:  

Mike, I'm glad you posted your "one liner" since it provides a good
working example of how to use yad.

Art
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 5057
Location: King's Lynn, UK.

PostPosted: Thu 25 Apr 2019, 11:07    Post subject:  

artsown wrote:
Mike, I'm glad you posted your "one liner" since it provides a good
working example of how to use yad.

Art


@ 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.... Rolling Eyes Shocked

Code:
#!/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


But I still don't understand what the '2>/dev/null' thing actually does.....

(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... Smile )

'New blood' never hurts.


Mike. Wink

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
scsijon

Joined: 23 May 2007
Posts: 1427
Location: the australian mallee

PostPosted: Thu 25 Apr 2019, 20:10    Post subject:  

funny thing, but, I unload by clicking on the relative cd drive icon and 'unmount' in the menu that appears, and it opens.

Easy peasy.
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [6 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0345s ][ Queries: 11 (0.0058s) ][ GZIP on ]