Showing posts with label ui. Show all posts
Showing posts with label ui. Show all posts

28 December 2009

dvtm - a console based tiled window manager


In my last post, I outlined how to do some form of rudimentary multitasking in Bash, but I was still not satisfied. Further research showed that there would be no way around a terminal multiplexer, however screen sucks for me due to its steep and unintuitive learning curve. On K.Mandla's great blog I found the solution: dvtm, a very lightweight tiled window manager for the console. Its beauty lies in that it occupies just around 100k of disk space, does not hog the memory and does not try to accomplish more than it is supposed to.

Becoming familiar with dvtm is a matter of minutes. Install the package from your distribution repositories, go to a console or open an xterm, then input dvtm. You will see Bash within a blue frame. The blue frame indicates that this is the active window. Now press CTRL-G C (press CTRL-G, release the keys, then type a C). A new Bash window pops open next to the existing one and becomes the active window. You can close that window by either logging out of that instance (input exit or press CTRL-D), or by pressing CTRL-G X.

With multiple windows open, you can input CTRL-G <number> to activate window <number> (as designated by its "title bar" text), or CTRL-G J / CTRL-G K to activate the next/previous window. CTRL-G . minimizes or unminimizes the active window. CTRL-G M maximizes the active window. Use CTRL-G SPACE to toggle between grid layouts; this is also the only way to unmaximize a window. CTRL-G ENTER moves the active window in and out of the "master area", which is usually the tile of the biggest size. Finally, dvtm can be left by means of CTRL-G Q, or logging off all hosted shells.

If you need a lightweight multi-window shell environment, dvtm should be surely worth checking out.

26 November 2009

GUI vs. CLI: Apples vs. oranges


I have never managed to wrap my mind around the tired old GUI (graphical user interface) vs. CLI (command line interface) debate and which is "better", and why you should try to avoid or strictly stick to the one or the other.

It is like comparing a brush and a hammer. Both are tools, but for different purposes, and if you want to be prepared for a wide variety of home improvement tasks, you better have both in your tool chest and a basic understanding of how to use them.

If you are good at building furniture but suck at painting, you call a friend who glazes your table for you, or you practice on a piece of leftover wood. Your friend may be a good painter with a steady hand and a great sense for color but completely clueless on how to fix a broken door hinge. But with only a little bit of learning and practice, he could become proficient enough to do small repairs himself.

Along the same lines, life can be easier if you have a basic understanding of both the GUI and CLI environments available on your computing platform, because each is included for the purpose of helping you with specific tasks.

GUIs shine when it comes to interactive workflow, especially editing on-screen data, like an image or a spreadsheet. Essentially, complex spreadsheets and desktop publishing were the applications that made graphical interfaces necessary in the first place. Navigation within the environment is highly interactive too; you activate menus or buttons, working your way to the target. A lot of information can be presented on the screen at once, which is great for working with multiple applications or pieces of data at the same time.

CLIs allow calling commands or starting applications with a few keystrokes and also have built-in scripting mechanisms which allow for building heavily customized command pipes and conditional/repeated execution. The vast majority of processing is done non-interactively (you only have the "upfront cost" of constructing a suitable textual expression). Navigating the environment is a minor matter; you change directly into a directory if you really need to be there, but commands are callable regardless of your location within the directory tree. Sophisticated means of auto completion and history search are available via simple key combinations, so you don't have to type any more than absolutely necessary.

It can be said that CLIs are designed to spare you time with generic tasks that do not need to be interactive, while GUIs are designed as an efficient way to do interactive document centric tasks. You should use a CLI for: Capitalizing text that has to fit some specific pattern, in some files scattered randomly over several partitions, and the filenames and file modification times have to fit a specific pattern too. That's a sed one-liner in a Unix shell and will waste hours when done in a GUI. You should use a GUI for: Adding some nice gradient borders to an object group in a SVG graphic, and make a text element run along it. Requires high-level wizardry in a CLI, better done in five minutes in Inkscape.

You should be able to see now that both user interfaces are highly efficient and mature solutions for getting different sets of tasks done. What you will end up using depends on what you want to accomplish, and use of an unsuitable interface will likely cause frustration and an "it can't be done" feeling. Call a knowledgeable friend then, or better, spend some time getting accustomed to the more suitable tool.