Twm: Difference between revisions

From Alpine Linux
m (Lowercase title. Move things around a bit. Simplify directions a bit. Use cat and pkg templates. Trivial grammar improvements.)
m (Add customization ideas.)
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:


== Prerequisites ==
== Prerequisites ==
* [[Installation|Install]] Alpine Linux
* [[Installation|Install]] Alpine Linux
* [[Setting_up_a_new_user#Creating_a_new_user|Create a user account]] (optional but recommended)
* [[Setting_up_a_new_user#Creating_a_new_user|Create a user account]] (optional but recommended)
* [[Repositories#Enabling_the_community_repository|Enable the Community repository]]
* [[Repositories#Enabling_the_community_repository|Enable the Community repository]]
* [[Alpine_setup_scripts#setup-xorg-base|Install Xorg]]
* [[Alpine_setup_scripts#setup-xorg-base|Install Xorg]]
 
{{clear}}
= Installation =
= Installation =
In home directory create a file named ".xinitrc":
In home directory create a file named ".xinitrc":
Line 38: Line 37:
Then switch to another layout (example for colemak):
Then switch to another layout (example for colemak):
{{Cmd|setxkbmap us -variant colemak}}
{{Cmd|setxkbmap us -variant colemak}}
= Customizing twm =
twm can be extensively modified. The default system-wide default configuration file for twm is {{path|/usr/share/X11/twm/system.twmrc}} and the per-user configuration is {{path|~/.twmrc}}. The user file completely overrides the system, so it's recommended to start modifications by copying the system-wide file to the per-user file.<br>
Some very basic customizations which many users do are below:
==Add basic alt+tab support==
The following can be added to the config enable basic alt+tab support for rapidly switching windows to the front:
<pre>"Tab" = m : root|window|frame|title : f.circleup</pre>
==Add maximize, and close buttons==
First install some bitmaps for the buttons:
{{cmd|# apk add {{pkg|xbitmaps|arch=}}}}
Then edit the config file and add the following:
<pre>
Function "maximize" { f.fullzoom f.focus f.nop }
RightTitleButton "icon"=f.function "maximize"
RightTitleButton "xlogo11"=f.delete
</pre>
[[Category:Desktop]]
[[Category:Window Managers]]

Latest revision as of 04:47, 15 January 2024

A depiction of Alpine Linux interface with twm window manager
A depiction of Alpine Linux interface with twm window manager

twm (Tab Window Manager) is the standard window manager for the X Window System since version X11R4.

Prerequisites


Installation

In home directory create a file named ".xinitrc":

vi ~/.xinitrc

Or, if you prefer nano text editor

nano ~/.xinitrc

Write to file:

Contents of ~/.xinitrc

exec twm

Save the file.

Install twm

# apk add twm

If doing no further configuration, you will also need xterm to open apps:

# apk add xterm

Start the X window manager

startx

You will be greeted with a black screen. Hold left mouse button and select "XTerm". Type in a program name to launch it.

Keyboard layout

The keyboard layout defaults to US qwerty. If you use an alternative layout (e.g. Colemak) you can install setxkbmap:

# apk add setxkbmap

Then switch to another layout (example for colemak):

setxkbmap us -variant colemak

Customizing twm

twm can be extensively modified. The default system-wide default configuration file for twm is /usr/share/X11/twm/system.twmrc and the per-user configuration is ~/.twmrc. The user file completely overrides the system, so it's recommended to start modifications by copying the system-wide file to the per-user file.
Some very basic customizations which many users do are below:

Add basic alt+tab support

The following can be added to the config enable basic alt+tab support for rapidly switching windows to the front:

"Tab" = m : root|window|frame|title : f.circleup

Add maximize, and close buttons

First install some bitmaps for the buttons:

# apk add xbitmaps

Then edit the config file and add the following:

Function "maximize" { f.fullzoom f.focus f.nop }
RightTitleButton "icon"=f.function "maximize"
RightTitleButton "xlogo11"=f.delete