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.
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- SUSE LLC's SUSE Manager
- My +1 Sword of Productivity
- Tech Tip: Really Simple HTTP Server with Python
- Non-Linux FOSS: Caffeine!
- Managing Linux Using Puppet
- Google's SwiftShader Released
- Parsing an RSS News Feed with a Bash Script
- Doing for User Space What We Did for Kernel Space
- SuperTuxKart 0.9.2 Released
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