Useful Things You Can Do with FVWM
FVWM is a window manager used with the X Window System, which is the standard GUI for UNIX. This article explains a few useful things you can do with FVWM, including how to take screenshots conveniently, how to easily change a window's title and how to reconfigure easily a running FVWM instance.
This article is aimed at fairly knowledgeable UNIX users. A little programming experience would be helpful, but you probably can manage without it. No knowledge of X or FVWM is assumed.
The ideas presented in this document were tested with FVWM 2.4.16. They should work with any FVWM 2 version, however. Scripts presented in this document are written in Bash; I used the 2.05a.0(1)-release, but they should work in any version. Finally, I run Debian Linux 3.0. This means the utilities invoked from the shell scripts are assumed to be the standard Linux ones or to behave like them.
The method I present here allows you to save a screenshot of the current window by selecting an option from one of FVWM's window menus. If you use FVWM, it's almost certainly configured to put one or more buttons on the titlebar of each window. When clicked, one of these buttons--probably the one in the top left corner--brings up a menu that lists window operations such as move, resize and so on. We're going to modify this menu to have two new options, Take screenshot and Take named screenshot. Selecting the former will cause a screenshot with a unique name to be put in a standard directory. Selecting the latter will do the same thing, except it will prompt you for a name for the new image.
You may ask, why is this useful? You may go on to ask, can I not simply use a standard window-dumping utility, such as xwd, to take my screenshot? These are good questions, but the method I'm outlining offers several advantages. First, my method is more convenient than switching to another window and giving a command to take a screenshot. Second, my method chooses a filename for you, relieving you of the burden. The filename chosen is unique, ensuring that screenshots can be ordered according to the time at which they were taken.
The savings in time and trouble may seem minor, but when you need to take a series of screenshots from a particular window, they add up. Imagine that you want to explain to a client how to perform a particular operation. A good way of doing so is to send him a series of screenshots showing him every step in the sequence. Saving such a series is much less trouble with the method I'm about to outline.
As mentioned above, we're going to add two new options to an FVWM menu. To begin, let's look at how FVWM menus are defined. The following code, taken from a sample configuration file shipped with FVWM 2.4.16, defines an FVWM menu called Window-Ops2. More precisely, it adds elements to the end of the menu.
AddToMenu Window-Ops2 "&Move" Move + "&Resize" Resize + "&Raise" Raise + "&Lower" Lower + "(De)&Iconify" Iconify + "(Un)&Stick" Stick + "(Un)&Maximize" Maximize + "" Nop + "&Delete" Delete + "&Close" Close + "&Destroy" Destroy + "&ScrollBar" Module FvwmScroll 2 2 + "&Print" PrintFunction + "&Print Reverse" PrintReverseFunction
A full description of how to define menus in FVWM is unnecessary for our purposes, so I'm not going to give one. An outline is necessary, however. I begin by recapitulating the above command in the following table, labeling each component:
|Command for Adding to Menu Definition||Name of Menu||Menu Label||FVWM Code for Menu Action|
|Plus Sign||Menu Label||FVWM Code for Menu Action|
|+||&PrintReverse||Reverse Print Function|
This table shows the structure of the command. The first element is AddToMenu, an FVWM command. Next comes Window-Ops2, the name of the menu. After that comes &Move, which defines a menu label; I explain the function of the ampersand in a minute. Then comes Move, which is an FVWM command that is executed if the user chooses Move from the menu. Following this are a number of lines. Each line begins with a plus sign, which is followed by a label and then an FVWM command, possibly with arguments. In summary, the essence of the AddToMenu command is to bind menu labels to actions.
Now, about those ampersands: they're used in labels to define hotkeys. FVWM looks at the character after the ampersand to find out what the hotkey is. For example, a label of &Move defines M as a hotkey. If the user presses the M key after bringing up the menu, this is equivalent to clicking on the Move option.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Profiles and RC Files
- Understanding Ceph and Its Place in the Market
- Astronomy for KDE
- Git 2.9 Released
- Maru OS Brings Debian to Your Phone
- OpenSwitch Finds a New Home
- What's Our Next Fight?
- The Giant Zero, Part 0.x
- Snappy Moves to New Platforms
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide