Difference between revisions of "PekWM"

From ArchWiki
Jump to: navigation, search
(Variables)
(Startup Programs)
Line 98: Line 98:
  
 
=== Startup Programs ===
 
=== Startup Programs ===
 +
 +
The startup programs file is ~/.pekwm/start. If you'd like to display a wallpaper or launch a panel whenever Pekwm is started, you can add entries for these things in that file. Note, though, that these applications are run every time Pekwm is started -- including when you run 'Restart' in the root menu. The commands are executed only after Pekwm is started.
 +
 +
To add an application, use the following structure:
 +
nameofapplication &
 +
 +
The & at the end is crucial, or anything after it won't be run. To give you an example of what this file could look like, here is mine:
 +
xfce4-panel&
 +
conky&
 +
hset
 +
hsetroot -fill ~/images/darkwood.jpg
 +
 +
Before you can use this file, you will have to make it executable with the following command:
 +
chmod +x ~/.pekwm/start
  
 
=== Variables ===
 
=== Variables ===

Revision as of 19:31, 22 July 2008

Template:I18n links start Template:I18n entry Template:I18n links end

Introduction to PekWM

The Pek Window Manager is written by Claes Nästen. The code is based on the aewm++ window manager, but it has evolved enough that it no longer resembles aewm++ at all. It also has an expanded feature-set, including window grouping (similar to ion, pwm, or fluxbox), auto properties, xinerama and keygrabber that supports keychains, and much more.

Installing PekWM

Install Pekwm from the repositories.

pacman -Sy pekwm

Starting PekWM

Method 1: kdm/gdm

This will most likely automatically be added to the session types. Select pekwm from the menu.

Note: you will have to have login manager enabled at first. For instructions how to do that, look here.

If it isn't automatically added you will need to create a .desktop file in /usr/share/xsessions called Pekwm.desktop. This can be done by simply typing

nano /usr/share/xsessions/Pekwm.desktop

You can of course substitute nano for any text editor you wish to use.

In the file you write:

[Desktop Entry] 
Encoding=UTF-8 
Name=PekWM
Comment=Start PekWM
Exec=/usr/local/bin/pekwm
Icon= 
Type=Application

Method 2: xinitrc

In your home folder add the code below to your .xinitrc file (~/.xinitrc)

exec pekwm

Configuring PekWM

Menus

PekWM will by default when installed from the arch repositiories come with some pre-created menus. These do not reflect what exists on your system and as such are highly likely to be very inaccurate to what you actually have installed. These are to be seen as an example and not something that you should use without editing.

Your menus are stored in .pekwm/menu in your home directory (~/.pekwm/menu)

MenuMaker

One way to automatically set up menus for your installed applications is Menumaker. To set up menus of all your installed applications run it with the following command:

mmaker --no-desktop pekwm

(Note that this will not overwrite your existing menu file. If you want it to overwrite, add the -f flag to the above command.

To see a full list of options, run mmaker --help

This will give you a pretty thorough menu. Now you can modify the menu file by hand, or simply regenerate the list whenever you install new software.

Manually

As I've already mentioned the menu file is ~/.pekwm/menu. The syntax for the menu file is fairly straightforward. A simple entry has the following structure:

Entry = "NAME" { Actions = "Exec COMMAND &" }

A submenu has the following syntax:

Submenu = "NAME" {
Entry = "NAME" { Actions = "Exec COMMAND &" }
Entry = "NAME" { Actions = "Exec COMMAND &" }
}

(Make sure these brackets are always closed, or you will have errors and your menu will not display)

To add a separator line to the menu, use the following:

Separator {}

Pekwm also supports dynamic menus. These are basically menu entries or submenus that display the output of a script that is run every time the entry or submenu is accessed.

You can find some dynamic menus online. Check the exact syntax the menu requires, as they can vary. There are not that many dynamic menu scripts around, unfortunately. You can find dynamic menus for Gmail and network connections here, and one to display the time and date here.

Hotkeys

The hotkey settings are stored in ~/.pekwm/keys. This file controls all the keyboard bindings and keychains used in Pekwm. You can add keyboard bindings to launch programs or to perform actions in Pekwm, such as show a menu, move a window, switch desktops, etc. For a full list of Pekwm's actions, see the documentation.

You can have more than one action assigned to one key combination. To do so, just separate the actions by a semicolon. Here is an example:

KeyPress = "Ctrl Mod1 R" { Actions = "Exec osdctl -s 'Reconfiguring'; Reload" }

When you press Ctrl+Alt+R Pekwm will display on the screen the text 'Reconfiguring' (osdctl -s 'Reconfiguring') and reconfigure (Reload). (Note that this requires osdsh to be installed)

You can also do "chains" of keys, so for example the code

Chain = "Ctrl Mod1 C" {
     KeyPress = "Q" { Actions = "MoveToEdge TopLeft" }
     KeyPress = "W" { Actions = "MoveToEdge TopCenterEdge" }
}

Would make it so that if you first press Ctrl+Alt+C and then Q you move the active window to the top left corner of the screen, and if you press Ctrl+Alt+C and then W you move the window to the top center edge.

Mouse

The Mouse settings are stored in ~/.pekwm/mouse. This file is also rather self-explanatory in it's layout. For example:

FrameTitle {
     ButtonRelease = "1" { Actions = "Raise; Focus" }
}

means that if you release button 1 (usually left mouse button) over the frame title of a window the window will be "Raised" above the other windows and it will become the focused window.

One of the things Pekwm is set up to do by default is to focus windows when the mouse moves over them (as opposed to the "click to focus" style). This is one thing that quite a few users would like to change to the more "traditional" way. To change this, look for the following lines in the file and do what they say (there are quite a few of the first, but only one occurrence of the second):

# Remove the following line if you want to use click to focus.
# Uncomment the following line if windows should raise when clicked.

Startup Programs

The startup programs file is ~/.pekwm/start. If you'd like to display a wallpaper or launch a panel whenever Pekwm is started, you can add entries for these things in that file. Note, though, that these applications are run every time Pekwm is started -- including when you run 'Restart' in the root menu. The commands are executed only after Pekwm is started.

To add an application, use the following structure:

nameofapplication &

The & at the end is crucial, or anything after it won't be run. To give you an example of what this file could look like, here is mine:

xfce4-panel&
conky&
hset
hsetroot -fill ~/images/darkwood.jpg

Before you can use this file, you will have to make it executable with the following command:

chmod +x ~/.pekwm/start

Variables

The Variables file contains the general variables used in PekWM, the default entry should explain it quite clearly:

$TERM="xterm -fn fixed +sb -bg white -fg black"

Whenever the variable $TERM is used in any of Pekwm's configuration files, the command xterm -fn fixed +sb -bg white -fg black will be run. For example changing it to:

$TERM="urxvt"

would mean that urxvt would be loaded for terminal commands.

External Links