Home > Articles > Operating Systems, Server > Linux/UNIX/Open Source

Features of SCWM

SCWM has several features that few other window managers support. In this section, I will describe some of the things SCWM can do for you, if you decide make it your window manager.

Graphical Configuration

Although SCWM is fully programmable, novice users will prefer a simple graphical interface to customization. SCWM provides developers with a simple, declarative language to specify what options are configurable, and then it automatically generates a Preferences GUI. (This feature is similar to the Customization capabilities of recent versions of Emacs and XEmacs).

Thus, we can specify a new *highlight-foreground* option simply using the following Scheme declaration:

(define-scwm-option *highlight-foreground* "white"
  "The foreground (text) color for the titlebar of the window with the keyboard focus."
  #:type 'color
  #:group 'face
  #:setter (lambda (v) (set-highlight-foreground! v))
  #:getter (lambda () (highlight-foreground)))

SCWM's preferences module combines that specification with all of the others to create the dialog box shown in Figure 1.

Figure 1. Options dialog box

Flashing Windows Upon Errors

Have you ever started to build a program using make in one XTerm and then gone to read email while that process was running? Have you ever been disappointed after 15 minutes of reading email because you discovered that a silly typo caused that build to fail immediately? With SCWM and Zsh, I've configured my environment to ring a bell and make the XTerm blink when an error is encountered, thus alerting me that the XTerm might need attention. Here's how to do it.

First, I make Zsh's error function print a special escape sequence, which recent versions of XTerm (and several other X/11 terminal emulators) recognize as a request to set an X property on its top-level window:

function TRAPZERR () {
  print -u2n "\033]3;alert=true\a"
}

After receiving that control sequence, XTerm associates the X property alert with the value true on its main window. At this point, SCWM becomes involved because its X-property-notify-hook procedures are invoked. A callback procedure that is attached to that hook is passed the X property object and the window that has that property. It can then use the X-property-get primitive to determine that alert now has the value true and can call flash-window on the passed-in window object (see property-respond.scm and flash-window.scm).

Replacing Fully Obscured Windows

Have you ever been confused because you couldn’t find a window that was completely hidden by another window, that appearing above that lost window? SCWM helps you to avoid this situation by using its window-fully-obscured-hook. We can define a handler procedure like so:

(define (fully-obscured-handler win from-vport-move?)
  (if (not from-vport-move?)
      (clever-place-window win)))

Then we can tell SCWM to use that handler procedure whenever a window becomes fully obscured:

(add-hook! window-fully-obscured-hook fully-obscured-handler)

To try this out, first start a bunch of XLogo windows. Then, bring a large XTerm or Emacs window to the front of the stacking order, and move it around over top of the XLogo windows. Each of the XLogo windows will get replaced when they would otherwise have become hidden. You could also choose to iconify those windows or pick a different placement procedure (instead of the ordinary clever-place-window procedure, which is the one that is often used to initially place a window on screen).

Finding a Lost Window

If you're like many users, you might just start a new XTerm when you cannot find a specific XTerm window. Alternatively, you might search a menu that contains all of the windows that are currently available. Unfortunately, that list can grow very long and can therefore complicate finding the window you want. SCWM provides a couple of alternatives to these undesirable methods.

Because SCWM menus are fully programmable, you can arrange the menus however you wish. In particular, the standard system configuration binds a click of the middle mouse button on the root (background) window to execute show-window-list-by-resource-with-geometry. This procedure pops up a window list with windows that are grouped according to their window resource. All XTerm windows are a single submenu, all Netscape windows are their own submenu, and so on. In addition, as you move your pointer over the menu, the corresponding window is highlighted both onscreen and in the FVWM2 pager (if you have it running), so you can tell to which window each item refers.

Searching for windows that match a string is another capability that SCWM provides:

(bind-key 'all "C-A-S-m" show-window-list-matching-interactively)

The Control+Alt+Shift+m keystroke (in any context) is bound to a procedure that prompts you for a string, which it then uses to find windows that contain that substring in their title. For example, if you enter Xdvi, a menu will pop up listing windows named Xdvi as well as all other windows that contain those four characters anywhere in their titles. This feature makes it much easier to find a specific window, and it is especially useful if you want your Emacs and XTerm windows' titles to change based on the file they are editing or the command they are executing.

Integration with Netscape

One of my most frequent daily activities is visiting a URL that exists in an email message, a text file, or a command output. Although many mail readers support talking to your Netscape process, there are always occasions when users are stuck copying and pasting (or even retyping) a URL from one place onscreen into a Netscape: Open Page dialog box. Again, SCWM provides a better alternative. By default, the keystroke Control+Shift+Meta+t is bound to the procedure netscape-goto-selection-url (from netscape.scm):

(define*-public (netscape-goto-selection-url 
             #&optional (new *netscape-new-window*) (selection "PRIMARY"))
  "Goto the url that is held in the X11 selection, SELECTION.
Uses the cut buffer instead if no selection exists.
See `X-handle-selection-string' and `netscape-goto-url'.  
NEW can be #f to not open a new netscape frame. 
SELECTION defaults to \"PRIMARY\" if not given."
  (interactive)
  (X-handle-selection-string selection
     (lambda (str)
            (netscape-goto-url 
            (if str str (X-cut-buffer-string)) display-message-briefly new))))

This procedure uses the Netscape remote-control protocol to make a Netscape browser window display the currently selected text string. Thus, you can simply highlight a URL using your mouse, and then press Control+Shift+Meta+t to instruct Netscape to instantly visit that site.

Similarly, I often do a Google search for a text string that is in an Emacs buffer or an email message. With SCWM, I highlight the keywords and then press Alt+s, which is bound to netscape-google-search-selection-url. That procedure queries the Google search engine for the current X/11 text selection.

Using Registers to Control Focus

I often alternate my work between two or more windows. Although SCWM supports Alt+Tab window focus switching (much like MS-Windows), it also provides registers that can help make the task even easier. Hyper+f (Hyper is another, less frequently used modifier key which not all keyboards have; a different key-binding can obviously be substituted) is bound to focus-to-register, and Hyper+g is bound to jump-to-register. These two commands enable you to save the currently focused window to an arbitrary key, and then later switch focus back to that window.

For example, if I'm actively working in both an XEmacs window and an XTerm window, I can name the XEmacs window "A" by focusing it (by moving my mouse pointer into that window, assuming mouse-focus mode) and then pressing Hyper+f, releasing those keys, and pressing the (unshifted) "a" key. I can then focus on the XTerm window and press Hyper+f, followed by the "B" key. Now the "A" register remembers that the focus should be on the XEmacs window, while the "B" register contains the notion that the focus should be on the XTerm window. More importantly, you can use Hyper+g to go to (that is, jump to) a register. If you press Hyper+g and then the "A" key, the XEmacs window will get the focus; if you press Hyper+g and then the "B" key, the Xterm will get the focus.

Window configurations, global window arrangements, and sets of selected windows can also be saved into registers using Hyper+c, Hyper+x, and Hyper+t, respectively. In each case, Hyper+g is used to return to the saved information stored in the chosen register.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020