Results 1 to 5 of 5
|
Enjoy an ad free experience by logging in. Not a member yet? Register.
|
|
-
01-23-2013 #1
- Join Date
- Jan 2013
- Location
- Upstate New York
- Posts
- 12
Is there a "terminal monitor" I can install?
Are there any widgets or anything that can let you watch what commands are being sent?
For instance, if I use the graphical file manager to move example.txt to its parent directory, the terminal monitor would show "mv example.txt .."
Then, if I did not know what "mv" did, I would be able to figure it out and learn more terminal commands just by watching what came up as I did stuff in the GUI.
Does such a thing exist, or is it even possible?
-
01-23-2013 #2
No, that isn't quite how it's done. A graphical program uses events to trigger handler functions. The events are first picked up by the X-server, and the earliest graphical apps that came with XFree86 used these directly. Modern widget libraries like gtk and qt wrap them up for use in a more programmer-friendly way. Mouse clicks are among these events.
Every widget library has a function for binding an event to a handler. The handler is a function that you write to do something whenever the event occurs. It could be something completely internal, or it could launch another process - for example a shell script. If you wanted the handler to move something to another directory, I think a shell process running mv, as in your example, would probably be the simplest way. But in general mouse clicks are not translated into text; they're translated into C code."I'm just a little old lady; don't try to dazzle me with jargon!"
www.hrussman.entadsl.com
-
02-01-2013 #3
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
- Posts
- 14,038
What hazel said. Your information is totally incorrect. When running the the X-Server GUI, you are not necessarily running in a "terminal" - all I/O is going directly to the GUI application. That said, if you are running a mouse-enabled text application that is using curses/ncurses (text-based UI), then that may be the case, but there are not a lot of those applications around these days, although there are still a few (can't think of what they are)...
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
-
02-01-2013 #4
midnight commander is one (much loved) example of an ncurses program that is still very much about.
I suppose you could write a GUI to translate clicks to terminal commands but I can't see it being terribly efficient.Should you be sitting wondering,
Which Batman is the best,
There's only one true answer my friend,
It's Adam Bloody West!
The Fifth Continent
-
02-01-2013 #5
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
- Posts
- 14,038
I have written text-based (ncurses) programs in the past, much like Midnight Commander, that could use the mouse, and the code that handled the mouse input vector and click data would translate that into ncurses cursor movement or keyboard (Enter, Esc, etc) commands, or even terminal-accessible escape sequences, as necessary. So, it was in effect turning the mouse data into text (keyboard) input. However, that is a special case. I remember some console drivers that would do much the same so you could use the mouse in a purely text-based interface, but they are not commonly used any longer.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!