https://wiki.archlinux.org/api.php?action=feedcontributions&user=Louiswins&feedformat=atomArchWiki - User contributions [en]2024-03-29T12:04:20ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=System_time&diff=174373System time2011-12-15T16:42:29Z<p>Louiswins: /* It's About 'Time' */ Fixed grammar</p>
<hr />
<div>[[Category:Mainboards and BIOS (English)]] <!-- with regard to the hardware clock --><br />
[[Category:Daemons and system services (English)]] <!-- as the basis/rationale for NTP --><br />
{{i18n|Time}}<br />
{{Article summary start}}<br />
{{Article summary text|This article provides an introduction to the concept of keeping time on computers in general, and describes how clocks are configured and managed in Arch Linux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Network Time Protocol}}<br />
{{Article summary wiki|rc.conf}}<br />
{{Article summary end}}<br />
<br />
This article explains how the time is read and set. The hardware clock (a.k.a. the Real Time Clock (RTC) or CMOS clock) and the system clock need to be set up correctly to maintain proper time. For ''maintaining'' accurate system time see [[Network Time Protocol]].<br />
<br />
== About ==<br />
<br />
The hardware clock stores the values of: Year, Month, Day, Hour, Minute, and the Seconds. The hardware clock time value will be of either of two standards: either the '''localtime''' standard, or the '''C'''oordinated '''U'''niversal '''T'''ime ('''UTC''') standard (also known as GMT, though conceptually different). The localtime standard is dependent on the current ''time zone'', while UTC is the ''global'' time standard and is independent of time zone values. The hardware clock can only store time values and does not have the ability to store the time standard (localtime or UTC), nor whether '''D'''aylight '''S'''aving '''T'''ime ('''DST''') is used.<br />
<br />
The hardware clock time standard (localtime or UTC) can be defined to most operating system's system clocks. By default, Windows uses localtime, Mac OS uses UTC, and UNIX-like operating systems vary. The system clock (a.k.a. the software clock) runs independent of the hardware clock and keeps track of: Time, Time Zone, and DST if applicable. Standard behavior of most operating systems is to set the system clock from the hardware clock on boot, keep accurate time of the system clock with an [[NTP]] program, and set the hardware clock from the system clock on shutdown. In Arch Linux, the daemon {{ic|/etc/rc.d/hwclock}} uses {{ic|hwclock}} to set the system and hardware clocks on boot and shutdown if 'hwclock' is in the DAEMONS list in {{ic|/etc/rc.conf}}).<br />
<br />
When using Linux it is beneficial to have the hardware clock set to the UTC standard and made known to all operating systems. Defining the hardware clock in Linux as UTC means that Daylight Savings Time will automatically be accounted for. If using the localtime standard the system clock will not be changed for DST occurances assuming that another operating system will take care of the DST switch (and provided no NTP agent is operating). <br />
<br />
== Time Standard ==<br />
<br />
You can set the hardware clock time standard through the command line. You can check what you have set your Arch Linux install to use by:<br />
<br />
$ grep ^HARDWARECLOCK /etc/rc.conf<br />
<br />
The hardware clock can be queried and set with the {{ic|hwclock}} command. To immediately change the hardware clock time standard to localtime use:<br />
<br />
# hwclock --localtime<br />
<br />
And to set it to UTC use:<br />
<br />
# hwclock --utc<br />
<br />
The time standard that the hardware clock uses will also need to be entered in your Arch Linux system configuration ([[rc.conf]]) so that the system clock will be correctly set on boot:<br />
<br />
HARDWARECLOCK="localtime"<br />
<br />
or<br />
<br />
HARDWARECLOCK="UTC"<br />
<br />
== Time Zone ==<br />
<br />
Be sure that your time zone is set correctly in {{ic|/etc/rc.conf}}. This is necessary not only for the localtime to be set correctly but also for other programs you may use. You can do this by:<br />
<br />
$ grep ^TIMEZONE /etc/rc.conf<br />
<br />
You can find the time zones listed in {{ic|/usr/share/zoneinfo/}} and then you will need to find a major city that exists to your time zone. If you live in a specialized time zone area these will be listed in sub-directories. An example configuration:<br />
<br />
TIMEZONE="America/Chicago"<br />
<br />
The new time zone will be taken into effect when you reboot. To change the timezone immediately you will need to link or copy it to {{ic|/etc/localtime}}:<br />
<br />
# cp /usr/share/zoneinfo/America/Chicago /etc/localtime<br />
<br />
When you [[#Time Set|set the hardware clock]] the new time zone will be take used.<br />
<br />
== Time Set ==<br />
<br />
The hardware clock can be set either directly or from the system clock. To check the current hardware clock time and system clock time respectively (the hardware clock time is presented in localtime even if the hardware clock set to UTC):<br />
<br />
# hwclock --show<br />
$ date<br />
<br />
To set the hardware clock directly (the argument must be in local time, even if you keep your hardware clock in UTC.):<br />
<br />
# hwclock --set --date="YYYY-MM-DD hh:mm:ss"<br />
<br />
To set the system clock:<br />
<br />
# date MMDDhhmmYYYY<br />
<br />
The hardware clock can be set from the system clock and vice versa:<br />
<br />
# hwclock --systohc<br />
# hwclock --hctosys<br />
<br />
== Time Skew ==<br />
<br />
Every clock has a value that differs from ''real time'' (the best representation of which being [[Wikipedia:International Atomic Time|International Atomic Time]]), no clock is perfect. A quartz based electronic clock keeps imperfect time, but maintains a consistent inaccuracy. This base 'inaccuracy' is known as 'time skew' or 'time drift'. When the hardware clock is set with {{ic|hwclock}}, a new drift value is calculated in seconds per day. The drift value is calculated by using the difference between the new value set and the hardware clock value just before the set, taking into account the value of the previous drift value and the last time time the hardware clock was set. The new drift value and the time when the clock was set is written to the file {{ic|/var/lib/hwclock/adjtime}} overwriting the previous values.<br />
<br />
{{Note|If the hwclock has been set again less than 24 hours after a previous set, the drift is not recalculated as {{ic|hwclock}} considers the elaspsed time period too short to accurately calculate the drift.}}<br />
<br />
If the hardware clock keeps losing or gaining time in large increments, it is possible that an invalid drift has been recorded. This can happen if you have set the hardware clock time incorrectly or your [[#Time Standard|time standard]] is not synchronized with a Windows or Mac OS install. The drift value can be removed by removing the file {{ic|/var/lib/hwclock/adjtime}}, then set the correct hardware clock and system clock time, and check if your [[#Time Standard|time standard]] is correct.<br />
<br />
The system clock is calculated by the Linux kernel as the number of seconds since midnight January 1st 1970 UTC. The initial value of the system clock is calculated from the hardware clock, dependent on the value of the HARDWARECLOCK defined in {{ic|/etc/rc.conf}}. Once power up has completed the system clock runs independently of the hardware clock. The Linux kernel keeps track of the system clock by counting timer interrupts. The software clock is very accurate but like most clocks is not perfectly accurate and will drift as well. Though rarely, the system clock can lose accuracy if the kernel skips interrupts. System clocks can be kept on accurate time by using [[NTP]]. NTP can also will adjust the interrupt frequency and the number of ticks per second to decrease system clock drift.<br />
<br />
== UTC in Windows ==<br />
<br />
Add the DWORD value:<br />
<br />
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal<br />
<br />
with hexadecimal value 1 to the registry (through regedit). Windows XP and Windows Vista SP1 have support for setting the time standard as {{ic|UTC}} and can be activated in the same way however there is a bug after resuming from the suspend/hibernation state that resets the clock to {{ic|localtime}}. For these operating systems it is recommended to use {{ic|localtime}}.<br />
<br />
The hardware clock and system clock time may need to be [[#Setting the time|updated]] after setting this value.<br />
<br />
== Other Details ==<br />
<br />
* 32-bit Linux systems will stop working in 2038. Since system time is recorded as a 32-bit integer (the number of seconds since 1970 01 01) it's limitation will extend only this long.<br />
* If you regularly shutdown/reboot your computer numerous times in a day the recorded drift value will never get calculated, it may be worth occasionally to stay in Linux so it gets calculated.<br />
* The AUR application {{ic|adjtimex}} can adjust kernel time variables like interupt frequency to help improve the system clock time drift.<br />
* During kernel startup, at the point when the rtc driver is loaded, the system clock may or may not be set from the hardware clock. Whether this occurs or not depends on the hardware platform, the version of the kernel and kernel build options. If this does occur, at this point in the boot sequence, the hardware clock time is assumed to be UTC and the value of {{ic|/proc/sys/class/rtcN/hctosys}} (N=0,1,2,..) will be set to 1. Later during execution of rc.sysinit, the system clock is set again from the hardware clock dependent on the value of HARDWARECLOCK. Hence, setting hwclock to localtime may cause some unexpected behaviour during the boot sequence.<br />
<br />
== It's About 'Time' == <br />
<!-- This was the introduction to the original 'Time' article by [[User:Android]]; kept for nostalgia's sake. --><br />
<br />
Our concept of time speaks much more to our limited perception than it does to the nature of what we observe. Time is clearly the most fertile ground for a fundamental shift in the human conception of the objective natural universe.<br />
<br />
Time has been measured since the beginning of time, at least as a human concept. The most obvious natural marker of the passage of time is the progression of day and night. The "day" was the first known measure of time and still forms a fundamental part of timekeeping. Other cyclic natural phenomena are also historically associated with time; the word "tide" comes from a common etymological root. Even with computer timekeeping, the day is a fundamental concept.<br />
<br />
As the measurement of time has improved, standard measures of time have had to be revised. The "leapyear" accounts for the fact that the Earth's orbit around the sun is not exactly 365 days. With the advent of atomic clocks in the 1960s, it became clear that the Earth's daily rotation was gradually slowing down (primarily due to tidal friction). The definition of the second in terms of cesium atom oscillations is the basis of the time standard known as [[Wikipedia:International Atomic Time|'''I'''nternational '''A'''tomic '''T'''ime]], or '''TAI'''.<br />
<br />
The slow and irregular increase in the amount of time comprising a day occasionally causes problems with the POSIX definition of a day as 86400 seconds. This led to the introduction of the "leapsecond" in 1972. Occasionally a second must be inserted into the normally defined UTC sequence in order to keep it synchronized with TAI.<br />
<br />
== Resources ==<br />
<br />
* [http://www.linuxsa.org.au/tips/time.html Linux Tips - Linux, Clocks, and Time]<br />
* [http://www.twinsun.com/tz/tz-link.htm Sources for Time Zone and Daylight Saving Time Data] for {{Pkg|tzdata}}<br />
* [http://www.ucolick.org/~sla/leapsecs/timescales.html Time Scales]<br />
* [[Wikipedia:Time]]</div>Louiswinshttps://wiki.archlinux.org/index.php?title=Wmii&diff=173037Wmii2011-12-10T23:09:37Z<p>Louiswins: /* For Laptop Users */ Fixed typo in awk script (printed extra '0' beforehand)</p>
<hr />
<div>[[Category:Dynamic WMs (English)]]<br />
{{i18n|Wmii}}{{DISPLAYTITLE:wmii}}<br />
<br />
[http://www.suckless.org/wmii/ wmii] (window manager improved 2) is a dynamic window manager for X11. It supports classic and dynamic window management with extended keyboard, mouse, and filesystem based remote control. It replaces the workspace paradigm with a new tagging approach. <br />
<br />
The following tips are intended to help the user get started with wmii. While wmii can be configured in almost any language, this article will focus on using the '''wmiirc''' configuration file, which is simply a shell script. Please see the [[ruby-wmii]] article to see how to configure wmii in ruby.<br />
<br />
==Installation==<br />
wmii is available from the '''extra''' repository. You can install it by issuing the following command:<br />
<br />
pacman -S wmii<br />
<br />
Alternatively, you can get the [http://aur.archlinux.org/packages.php?ID=3497 latest development version] which is available from the [[AUR]].<br />
<br />
Next you will need to edit your '''~/.xinitrc''' to enable you to start wmii with '''startx''':<br />
<br />
exec wmii<br />
<br />
To allow for starting wmii without logging off or killing the X session, add the following in the ~/.xinitrc<br />
until wmii; do<br />
true<br />
done<br />
Upon your first login, you will be greeted with the wmii welcome message, which also includes a short tutorial on wmii. Completing this tutorial will give you a good idea on how wmii works.<br />
{{Box Note|If the welcome message does not show up, make sure you have '''xmessage''' installed from the '''xorg-xmessage''' package. Then you can read the welcome by pressing $MODKEY-a and selecting 'welcome'.}}<br />
<br />
==Configuration==<br />
The easiest way to start configuring wmii, is to copy the default wmiirc file to your home directory and changing it to your needs. For version 3.9,<br />
mkdir ~/.wmii<br />
cp /etc/wmii/wmiirc ~/.wmii/<br />
<br />
Or just create ~/.wmii/wmiirc_local if you want only basic customization such as fonts, colors etc.<br />
<br />
For earlier versions,<br />
mkdir ~/.wmii/wmii-$VERSION<br />
cp /etc/wmii/wmiirc ~/.wmii/wmii-$VERSION/<br />
<br />
By editing this file, you can change things such as color, background, modkey, etc. Keep in mind that wmiirc uses tabbed indentation in case your editor of choice is configured to only produce spaces. Mixing the two indenting styles may cause unexpected behavior.<br />
====Configuration Variables====<br />
# Configuration Variables<br />
MODKEY=Mod1<br />
UP=k<br />
DOWN=j<br />
LEFT=h<br />
RIGHT=l<br />
Change Mod1 to Mod4 if you want to use Windows key instead of Alt. You can also change h, j, k, l, if you like.<br />
<br />
====Window Colors====<br />
# Colors tuples: "<text> <background> <border>"<br />
WMII_NORMCOLORS='#ffffff #000000 #ffffff'<br />
WMII_FOCUSCOLORS='#ffffff #5c0000 #ffffff'<br />
<br />
WMII_BACKGROUND='#333333'<br />
WMII_FONT='fixed'<br />
Colors of unselected window are in NORMCOLORS variable. Colors of selected window are in FOCUSCOLOR variable. You can change the background color (if you use transparent terminal) with the WMII_BACKGROUND variable.<br />
<br />
==== For Laptop Users====<br />
<br />
If you are using wmii on a laptop, it may be convenient to display items such as wireless quality, remaining battery time, and load averages in the status bar; the script below requires you to install acpi and gawk:<br />
pacman -S acpi gawk''<br />
<pre style='overflow:auto'><br />
# Status Bar Info<br />
status() {<br />
echo -n ' Wlan0:' $(iwconfig wlan0 | awk '/Quality/{print $2}' | sed 's/.*=//' | awk -F"/" '{printf("%.0f%%", $1/$2*100)}') '| Bat:' $(acpi -b | sed -n 's/.*\([0-9][0-9]:[0-9][0-9]\):[0-9][0-9].*/\1/p') '|' $(uptime | sed 's/.*: //; s/,//g') '|' $(date '+%c')<br />
}<br />
</pre><br />
By default the status bar only shows date and an uptime pager (displays system load average for the last 1, 5, 15 minutes).<br />
<br />
==Usage==<br />
<br />
If you are not familiar with tiling WMs, it's not really easy to begin with it. You must learn a few basic hotkeys to launch programs and place or resize windows. It is a good idea to write the basic hotkeys on paper and stick these on your monitor until you memorize them. By default, the "Mod" key is Alt. Some default hotkeys are :<br />
* Mod+Enter -> Terminal<br />
* Mod+p -> wimenu : a menu appears, just type the beginning of the name of the application <br />
to open it.<br />
* Mod+d -> default layout : windows are divided on screen<br />
* Mod+s -> stacked layout : the selected window take all the screen, we just see the title <br />
bar of the others.<br />
* Mod+j -> select the window below<br />
* Mod+k -> select the window above<br />
* Shift+Mod+j -> move the window down<br />
* Shift+Mod+k -> move the window up<br />
* Mod+a -> Actions menu : choose "quit" to quit<br />
<br />
N.B. For commonly used programs you can make use of ''history.progs'', Mod+p and up/down arrow keys to select previous entries.<br />
<br />
<br />
By default, only one column is used by the desktop (i.e. the entire screen). It's possible to use several columns with h and l :<br />
<br />
* Mod+Shift+h : move the selected window left<br />
* Mod+Shift+l : move the selected window right<br />
* Mod+h : select the column on the left<br />
* Mod+l : select the column on the right <br />
<br />
Columns are created automatically, with your placements of the windows. You can make them bigger or smaller, clicking beetween two columns.<br />
<br />
===Layouts===<br />
<br />
You begin in "default" layout : all windows take the same space. You can make them bigger or smaller by clicking in the little square in the title bar of a window.<br />
<br />
* "stacked" layout (Mod+s) : the selected window takes the entire column, but you can see <br />
the title bar of other windows.<br />
* "maximum" layout (Mod+m) : the selected window takes the entire column, you do not see <br />
other windows.<br />
* "fullscreen" layout (Mod+f) : the selected window takes runs in full screen.<br />
<br />
If you tend to use multiple clients in stacked view then binding the following allows you to remove all the title bars apart from the one you are viewing, regaining screen estate.<br />
Each client will be numbered in the top right with 1/3, 2/3 etc. <br />
Mod + s or Mod + d will return the view to standard layouts.<br />
* fn Key-$MODKEY-x {wmiir xwrite /tag/sel/ctl colmode sel +max} # rc.wmii.local version<br />
* Key $MODKEY-x<br />
wmiir xwrite /tag/sel/ctl colmode sel +max # wmiirc version<br />
<br />
====Floating layout====<br />
<br />
You can place your windows like a classic window manager. It's called floating layout. It's useful for some applications, like the Gimp, mplayer, vlc etc.<br />
<br />
* Mod+Shift+Space : Move selected window in floating layout.<br />
* Mod+Space : switch between floating layout and normal layout. <br />
<br />
In the floating layout, we can select a window with Mod+j and Mod+k. We can change dimensions of the window, by dragging, like in any other window manager. But we can use hotkeys for that as well :<br />
<br />
* Mod+Left click : move window<br />
* Mod+Right click : change dimensions of the window (you can use it in other layouts too)<br />
<br />
===Views and Tagging===<br />
Tagging in wmii is very similar to the concept of virtual desktops in other window managers. However, tagging is slightly more powerful because it makes it very easy to group windows in multiple ways concurrently. This is made possible by the fact that WMII easily allows each window to have multiple tags. This allows you to group applications for specific use cases and easily switch between them without having to tear down your previous environment by sending applications to another "Desktop".<br />
<br />
By default, when you first start up wmii you will see the word 'nil' in the lower left corner. You are at the 'nil' view. The first application you start (such as a terminal: Mod+Enter) will automatically be tagged with a "1" and you will be automatically switched to view "1". Views can be navigated or changed with built in keybindings:<br />
<br />
* Mod+Shift+2 : tag selected window to view "2"<br />
* Mod+2 : this switches you to view "2" where you can see all windows tagged with "2"<br />
<br />
It's the same thing for all numbers, from 0 to 9. But you can also use names :<br />
<br />
* Mod+t : views menu : you can select a tag with right and left keys, or type the name <br />
of the tag (or just a part of the name, if it was created).<br />
<br />
* Mod+Shift+t : this retags the currently selected window with whatever you type into <br />
the menu.<br />
<br />
* N.B If using plan9port a ''history.tags'' file is generated in .wmii-*/. You can use <br />
up/down arrow keys to recall previous entries for simple re-tagging/window viewing.<br />
<br />
You can tag windows with multiple views by using a '+' between the tag names :<br />
<br />
* Mod+Shift+t foo+bar+2 : this tags the currently selected window to the views "foo",<br />
"bar" and "2".<br />
You can remove a single tag from multi-tagged windows by selecting the one you wish to remove<br />
and using Mod+Shift+t, -tag ''name/number'' ie<br />
Urxvt is multi-tagged on views 1 2 3 and 4, if you jumped to 3 and typed exit, all instances of<br />
urxvt will be terminated, using Mod+Shift+t, -3 will only remove that single view.<br />
<br />
Tags can be set for specific applications in the wmiirc configuration file.<br />
<br />
# Tagging Rules<br />
wmiir write /tagrules <<!<br />
/Firefox.*/ -> ~+2<br />
/Gimp.*/ -> ~+3<br />
/.*/ -> sel<br />
/.*/ -> 1<br />
!<br />
<br />
With the above tag rules, firefox starts in floating mode (~) on view "2". Gimp starts in floating mode on view "3".<br />
<br />
{{Box Note | Applications need to spawn an X-window in order to be automatically assigned tags. Therefore, in order to launch your terminal based programs you will need to prepend something like ''urxvt -e <program>'' if want to make use of this feature.}}<br />
<br />
==WMII filesystem==<br />
<br />
WMII's filesystem is based on the [http://9p.cat-v.org 9P protocol]. Every element (windows, statusbar, ...) is represented as a file. This makes several cool things possible. For example you can display the song you're currently listening to in the statusbar (for example with MPD and MPC).<br />
<br />
{{Box Note|This filesystem is not permanent and you have to set up everything again after reboot. To make your changes "permanent" simply write the right commands into your wmiirc.}}<br />
<br />
You can access the filesystem with the ''wmiir'' command. For instance, you can list the root directory with ''wmiir ls /''<br />
<br />
client/<br />
colrules<br />
ctl<br />
event<br />
keys<br />
lbar/<br />
rbar/<br />
tag/<br />
tagrules<br />
<br />
You can use ''wmiir read'' to look into files: ''wmiir read /tag/sel/index''<br />
<br />
# ~ 1280 785<br />
~ 0x160000d 731 394 486 332 xterm:XTerm:~<br />
# 1 0 1280<br />
1 0x800003 0 785 opera:Opera:Editing Wmii - Preview - ArchWiki - Opera<br />
<br />
So this is the info for the '''sel'''ected (current) tag. As you can see, I've got one floating xterm and Opera running on this tag. The first number in this output indicates the column of the window. ~ is the floating column and 1 ist (obviously) the first column. The second column is the XServer-ID for the client. The next columns are the coordinates and the size of the window. The last column ist the titlebar of the window.<br />
<br />
You can create new files with ''wmiir create'':<br />
<br />
echo Arch is best | wmiir create /rbar/arch<br />
<br />
Now you should see "Arch is best" in your statusbar<br />
<br />
"wmiir create" reads from STDIN. So you can pipe any information you like into your statusbar. "wmiir write" works in a similar fashion but doesn't create new files.<br />
<br />
{{Box Note|Note for /rbar and /lbar:The elements in those status bars are in alphabetical order.}}<br />
<br />
You can remove files with rm or remove<br />
<br />
If you like to have a program on several tags you can use:<br />
echo "3+5+8" | wmiir write /client/0x800003/tags<br />
<br />
Now my Opera window appears on Tags 3,5 and 8.<br />
<br />
But there are easier ways to accomplish this ;)<br />
Just type MOD+shift+t and enter "3+5+8" and you get the same result for the currently selected client.<br />
<br />
{{Box Note| There's also the possibility to mount WMII's filesystem. Have a look at the [http://wmii.suckless.org/9p official documentation]. }}<br />
<br />
==Other nice stuff==<br />
<br />
===Terminal Title===<br />
If you would like to display the current directory in your terminal emulator's titlebar, add this to your .bashrc<br />
WMII_IS_RUNNING=`ps a | grep wmii | awk '/[^"grep"] wmii$/'`<br />
if [ -n "$WMII_IS_RUNNING" ]; then<br />
PROMPT_COMMAND='dirs | wmiir write /client/sel/label'<br />
fi<br />
With this you can shorten you shell prompt and have more horizontal space to type. This test prevents you from getting a "WMII_ADRESS not set" error when you spawn a console.<br />
<br />
===Weechat Highlight Notification===<br />
If you use weechat and want to know when you have been messaged without always having to look at the weechat window, you can use the ''launcher.pl'' plugin to send a notice to the bar. To get this working, you will need to create a script that sends your desired notice. Here is very simple example:<br />
<br />
#!/bin/bash<br />
echo :: NEW MESSAGE :: | wmiir create /lbar/alert<br />
sleep 8<br />
wmiir remove /lbar/alert<br />
<br />
Then start weechat and load the plugin.<br />
<br />
/perl load launcher.pl<br />
<br />
Then type the following command into weechat:<br />
<br />
/set plugins.var.perl.launcher.signal.weechat_pv = "/path/to/yourscript"<br />
<br />
<br />
Now, :: NEW MESSAGE :: will appear in the left corner of your bar whenever you have a message highlight. Make sure to place ''launcher.pl'' the perl/autoload directory so that it starts when weechat starts.<br />
<br />
===Mod4 on an old Thinkpad===<br />
<br />
Although Wmii defaults to Mod1, using Mod4 reduces conflicts in keybindings with many terminal applications. There is a snag for old Thinkpad users, however. They do not have a Mod4 key. To get one, another key has to be assigned to it using xmodmap. To do it, make an ''.Xmodmap'' file in your home directory and add this to it:<br />
keycode 64 = Super_L<br />
add Mod4 = Super_L<br />
remove Mod1 = Super_L<br />
<br />
You will need to replace 64 with whatever ''xev'' tells you is the keycode of the key you want to replace. In the above example, I replace left Alt (and use right alt for applications).<br />
<br />
===Nice fonts===<br />
Wmii now supports Xft, just prefix font name with 'xft'. For instance:<br />
export WMII_FONT='xft:Sans-9'<br />
<br />
===Keyboard layouts===<br />
You'd probably like to have its own keyboard layout for each window. However, most of such applications requires system tray while witray is only available in the [http://aur.archlinux.org/packages.php?ID=3497 development version of wmii]. [http://www.archlinux.org/packages/?q=xxkb xxkb] package helps to solve the problem. It has no UI by default. You only need to configure layouts in xorg.conf. Create /etc/X11/xorg.conf.d/20-keyboard.conf and put something like this into it:<br />
Section "InputClass"<br />
Identifier "Keyboard Defaults"<br />
MatchIsKeyboard "yes"<br />
Option "XkbModel" "pc101"<br />
Option "XkbLayout" "us,ru"<br />
Option "XkbOptions" "grp:ctrl_shift_toggle,compose:prsc"<br />
EndSection<br />
Replace layout, options and model to fit your needs. Add<br />
xxkb &<br />
into your wmiirc and it just works.<br />
[http://aur.archlinux.org/packages.php?ID=33298 xkblayout-state] can be used to put layout indicator into the status line:<br />
status() {<br />
echo -n label $(xkblayout-state print "%s") '|' $(date +"%a %b %d %H:%M")<br />
}<br />
<br />
===Note: Version 3.9.2-1===<br />
<br />
If you upgrade from wmii v3.6-4 to v3.9.2-1 you will have to insert any changes you made to your old ~/.wmii-3.5/wmiirc configuration file into the newer config file located at ~/.wmii/wmiirc_local. Note also that there are some slight format and variable name changes between the newer and older versions of /etc/wmii/wmiirc.<br />
<br />
This latest version has some significant enhancements such as easier window dimension changes with the mouse and better handling of small floating windows launched from tiled applications (especially OpenOffice).<br />
<br />
==Other Resources==<br />
* [http://wmii.suckless.org/ wmii] -- the official website of wmii<br />
* [[dmenu]] -- a simple application launcher which binds well with dwm and wmii<br />
* [http://wmii.googlecode.com/hg/doc/wmii.pdf user guide] -- latest wmii guide (pdf)<br />
* [http://eigenclass.org/hiki.rb?wmii+ruby ruby-wmii] -- Ruby configuration and scripting for wmii 3.1<br />
* [https://github.com/sunaku/wmiirc sunaku's wmiirc] -- Ruby configuration and scripting for wmii 3.9+ and wmii-hg<br />
* [http://pastebin.com/Xyn0mEjr Ben's wmiirc] -- Simple wmiirc with extra widgets (vol, mpd, mail, clock) and other modifications</div>Louiswins