Slashdot Mirror


Interoperability Between the GUI and the CLI?

shylock0 asks: "I use AutoCAD pretty extensively, and one of the things I've always loved about it is the fact that, in addition to having a GUI, it has a really great command line -- which you access simply by starting to type, and which will actually work alongside your mouse. CAD lends itself to this duality, mainly because its nice to be able to deal with the overall work visually, but be able to specify dimensions exactly. Having to use the mouse to click on a separate dimensioning tool-box for every element you create wastes a substantial amount of time. You can even use mouse and keyboard side-by-side, without clicking yourself into a different environment -- for instance, if you have selected an element, and are using the mouse to rotate it, starting to type commands to resize the object doesn't stop the mouse from being in rotation mode. Such functionality would allow complex tasks -- beyond just opening, saving, and so forth -- using direct keyboard input, but would work in the context of the GUI. For instance, it would be great if I could copy files from an open window just by starting to type 'copy'. What other apps, both commercial and free, still have an easy-to-enter command-line style element?"

"This seems to me to be a feature that would be great to have, particularly in operating systems and productivity apps. Once you get the hang of the commands, and assuming you can type quickly, keyboard input is actually faster than using the mouse. In AutoCAD, I can design an entire house using just the keyboard. How much productivity has been lost by the decline of keyboard use beyond simple shortcuts?"

5 of 50 comments (clear)

  1. CLIM by __past__ · · Score: 3, Informative
    A lot of Lisp applications used to use CLIM, the Common Lisp Interface Manager. It integrates command line and GUI style interaction naturally - it is based around "presentations" of the objects in your program, i.e. whenever you "present" something as either text or an icon or whatnot, it remebers what it is, and the output can be used as input for other functions, be they called by name at the command line or, for example, as a menu entry.

    The symbolics Lisp Machine user interface was based around this. For an impression of it looked like and worked, look at this movie. CLIM is available for the two major commercial Lisp implementations from Franz, Inc. and Xanalys; there is also a free implementation in the works. Here are some relevant links.

  2. Konqueror by TephX · · Score: 2, Informative

    Also, somewhat more directly in response to the question posed by the article, Konqueror can embed Konsole (the KDE terminal emulator) in a frame. When you switch directories in KDE's file browser, the terminal automatically does a "cd" to the new location. I've found this useful from time to time, although generally dragging and dropping directories or files from Konqueror to a separate Konsole instance has worked well for me.

    And the syntax for command-line control of KDE apps looks roughly like this (shooting from the hip, since I'm not near a KDE-running system at the moment):

    dcop KScreensaverIface lock

    (This would lock your screen, probably one of the more useful actions to be able to script.)

    --
    I metamoderate all Redundant and Offtopic moderations as Unfair.
    1. Re:Konqueror by TephX · · Score: 3, Informative

      Well, I suppose it would have been, but I didn't know about it, and KDE has its own screensaver system (I'm not sure if it's embedding something else or what, but it has its own password dialog - it matches color schemes and fonts with your current KDE setup, which is a slight improvement, I suppose). If you're a programmer, though, and you use KDE, I'd encourage you to check out dcop. Granted, not everything (or even close to it) is scriptable at this point, but there are a fair number of functions you can get to - you're basically directly accessing the exported API of a program by this method. Type

      dcop

      for a list of programs you have running which provide a DCOP interface, then

      dcop program

      for a list of interfaces, and so on until you get down to the actual functions you can call.

      --
      I metamoderate all Redundant and Offtopic moderations as Unfair.
    2. Re:Konqueror by TephX · · Score: 2, Informative

      Well, dcop is KDE's IPC mechanism, so I kind of doubt any non-KDE programs support it or will do so, although it should be theoretically possible... although for the particular case of Mozilla, if you just like its rendering (rather than the browser itself) then you can easily set Konqueror to embed Mozilla rather than khtml for its rendering component.

      To the best of my knowledge (and someone please correct me if I'm wrong here), Gnome doesn't have anything like dcop - kind of surprising, to me at least, given that Gnome is generally positioned as more developer-oriented. (By dcop in the previous sentence I specifically mean the command-line client; I'm pretty sure that Gnome does have some sort of IPC architecture.) I don't know if GTK+/Gnome are architected in such a way as to cleanly support something like this - the reason it's so easy to do in KDE is that QT keeps around a lot of information about the source at runtime, and dispatches things even more dynamically than normal C++ with RTTI (that is, it looks up functions by name and argument type, rather than just indexing into a vtable).

      I'm glad you were able to get some use out of it (as evidenced by your post below).

      --
      I metamoderate all Redundant and Offtopic moderations as Unfair.
  3. Re: KDE by Morth · · Score: 2, Informative

    I can't wait until someone *finally* has a GUI, drag and point interface to setting up interapp messag sending. I mean a rapid development environment where I can choose a menu item, drag a little line to a button in another window, and have that button trigger said menu item.


    AppleScript has a nice functionality.

    You start Script Editor, hit Record, then do your tasks, and whoops, a complete script... It won't be a button but well a menu item. The button can probably be gotten from some shareware.

    Granted the target application must support it, and it's sadly very uncommon.

    There used to be a shareware utility (probably spawned by the AppleScript functionality) that didn't have the support limitation, it tracked the mouse and keyboard events, which is somewhat weaker though as the setup must be exactly the same for it to work. Not sure if it has been ported to OS X or anywhere else, can't remember the name sorry.