-
Install XQuartz (http://xquartz.macosforge.org) which is the development version of the X11.app that ships with OS X, which means it is way more up to date. I have had some weird issues with X11.app v. 2.3-something. XQuartz 2.5.0 fixed that.
-
Install
dwm
from Homebrew,brew install dwm
. This makes a bunch of necessary tweaks to the DWM configuration. -
Add the following script to $PATH, name it
dwm-launch
andchmod 755
:cd ~ while true do xsetroot -name "`date +"%Y-%m-%d %H:%M"`" sleep 5 done & exec /usr/local/bin/dwm
-
Add the following to
~/.xinitrc
:PATH=$PATH:/usr/local/bin xsetroot -solid '#4a525a' exec >>~/.xsession-errors 2>&1 ~/bin/dwm-launch
-
Add the following to
~/.Xmodmap
:remove Mod2 = Meta_L add Mod1 = Meta_L
-
X11
uxterm
is launched as a non-login shell, which is undesirable. To launchuxterm
as a login shell, add the following to~/.Xdefaults
:XTerm*foreground: white XTerm*background: black
-
Start X11.app.
dwm
should start. You need to change a few settings to make copy/paste between X11 and Aqua work. Go toX11 -> Preferences...
and enableEmulate three button mouse
underInput
. Next, enable everything underPasteboard
.In X11 you copy text by selecting it with the mouse, and you paste by pressing
Alt
and clicking the mouse.
- After some time you might not be able to open new terminals. This has
something to do with permissions, and can be fixed with
xhost +
. Do you know a permanent solution? (Possibly fixed with one of the settings underX11 -> Preferences… -> Security
)
I was a bit frustrated not being able to use the mouse buttons 2 and 3 properly with the dwm modifier key mapped to the
command
key on my system in order to move and resize floating windows, since the Xquartz Emulate three button mouse preference also using thecommand
key interfered with that.Reading through Xquartz (1) I found that I can remap the modifier keys for the mouse button emulation using:
% defaults write org.macosforge.xquartz.X11 fake_button3 fn
With this the
fn
key is used to emulate mouse button 3 and thecommand
key is free for proper use with dwm 👍