Xmonad
xmonad is a dynamically tiling X11 window manager that is written and configured in Haskell. In a normal WM, you spend half your time aligning and searching for windows. xmonad makes work easier, by automating this.
Categories
- xorg
- Haskell
- Xmonad:Config
- Xmonad:Config:darcs - darcs template
xmonad.hs
- Xmonad/Config archive/Mntnoe's xmonad.hs - HaskellWiki - 좋은 예제들이 많다.
- Xmonad:Config:darcs - darcs template
Plugins
- XMonad.Actions.TreeSelect
- XMonad.Doc.Extending - 확장 모듈 목록 있음.
- XMonad.Hooks.EwmhDesktops
- XMonad.Hooks.ManageDocks
- XMonad.Util.Scratchpad
- XMonad.Layout - Full
- XMonad.Layout.Accordion
- XMonad.Layout.Combo
- XMonad.Layout.Tabbed
- XMonad.Layout.Gaps
- XMonad.Layout.LayoutCombinators
- XMonad.Layout.NoBorders
- XMonad.Layout.SimpleDecoration
- XMonad.Layout.Spacing
- XMonad.Layout.SubLayouts
- XMonad.Layout.LayoutBuilder
검토
- https://www.youtube.com/watch?v=qQ4CcMTLW-4
- GridSelect
- ToggleStruts
- ToggleBorders
Utilities
Installation
xmonad를 사용한다면 다음과 같이 설치한다.
Note |
업그레이드 후 |
Starting
Run xmonad
with xinit.
Bar/Tray
합성 창 관리자 (Compositing window manager)
Flags
플래그는 다음과 같습니다:
-
--recompile
-
~/.xmonad/xmonad.hs
에서 구성을 다시 컴파일합니다.
-
--restart
- 현재 실행중인 xmonad 프로세스를 다시 시작합니다.
-
--replace
- 현재 창 관리자를 xmonad로 바꿉니다.
-
--version
- xmonad의 디스플레이 버전
-
--verbose-version
- xmonad의 상세 버전 표시
Key binding
|
|
Default keyboard bindings
-
mod-shift-return
- 기본 터미널 실행
-
mod-p
- dmenu 실행
-
mod-shift-p
- gmrun 실행
-
mod-shift-c
- 현재 포커스의 윈도우 닫기.
-
mod-space
- 사용 가능한 레이아웃 알고리즘을 사용해 윈도우를 회전.
-
mod-shift-space
- 현재 작업 공간의 레이아웃을 기본값으로 재설정.
-
mod-n
- Resize viewed windows to the correct size
-
mod-tab
- Move focus to the next window
-
mod-shift-tab
- Move focus to the previous window
-
mod-j
- Move focus to the next window
-
mod-k
- Move focus to the previous window
-
mod-m
- Move focus to the master window
-
mod-return
- Swap the focused window and the master window
-
mod-shift-j
- Swap the focused window with the next window
-
mod-shift-k
- Swap the focused window with the previous window
-
mod-h
- Shrink the master area
-
mod-l
- Expand the master area
-
mod-t
- 윈도우를 타일에 배치시킨다. Floating 윈도우를 타일에 다시 배치시키고 싶을 때 사용한다.
-
mod-comma
- Increment the number of windows in the master area
-
mod-period
- Deincrement the number of windows in the master area
-
mod-shift-q
- Quit xmonad
-
mod-q
- Restart xmonad
-
mod-shift-slash
- Run xmessage with a summary of the default keybindings (useful for beginners)
-
mod-[1..9]
- Switch to workspace N
-
mod-shift-[1..9]
- Move client to workspace N
-
mod-{w,e,r}
- Switch to physical/Xinerama screens 1, 2, or 3
-
mod-shift-{w,e,r}
- Move client to screen 1, 2, or 3
-
mod-button1
- Set the window to floating mode and move by dragging
-
mod-button2
- Raise the window to the top of the stack
-
mod-button3
- Set the window to floating mode and resize by dragging
Customization
xmonad is customized in ~/.xmonad/xmonad.hs
, and then restarting with mod-q
.
You can find many extensions to the core feature set in the xmonad- contrib package, available through your package manager or from xmonad.org.
Modular Configuration
As of xmonad-0.9, any additional Haskell modules may be placed in ~/.xmonad/lib/
are available in GHC's searchpath. Hierarchical modules are supported: for example, the file ~/.xmonad/lib/XMonad/Stack/MyAdditions.hs
could contain:
module XMonad.Stack.MyAdditions (function1) where
function1 = error "function1: Not implemented yet!"
Your xmonad.hs
may then import XMonad.Stack.MyAdditions
as if that module was contained within xmonad or xmonad-contrib.
List of Tiling window manager
Troubleshooting
Xmonad 멈추는 문제
Xmonad가 window들의 아웃풋을 받아 그를 로깅을 위해 파이프로 출력하는데 파이프가 다 차버렸기 때문에 블럭된것이었다. 그래서 한 윈도우(emacs등)에서 진드감치 작업하면 며칠에 한번씩 블럭되고 여러 윈도우를 왔다갔다 하면 얼마 지나지 않아 얼어버리고 하는 것이었다. 그런데 원래 Xmonad의 상태바인 xmobar에는 stdin을 읽어 화면에 출력해주는 StdinReader
설정을 했다. 그 StdinReader
가 죽어버려서 문제였던것.
StdinReader
가 왜 죽느냐 또 찾아봤더니 UTF8 코드를 hGetLine()
이 처리를 못해서 그렇다고 한다. 넷에는 System.IO.UTF8.hGetLine
으로 처리하면 된다고 하는데, 실제로 해보니 죽기는 마찬가지. 이리저리해보다 결국 xmobar의 StdinReader
처리부에서 해당 핸들을 latin1
인코딩으로 세팅해버렸다. 그랬더니 안죽는다. 아래 실험 코드에서 bar.txt
에 UTF8문자열이 있다했을때 latin1
으로 x를 설정하기 전에는 계속 hGetLine: invalid argument (Invalid or .... multibyte or wide character)
에러를 냈던 것이다.
import IO
import System.IO
import System.IO.UTF8
main = do x <- openFile "/tmp/bar.txt" ReadMode
hSetEncoding x System.IO.latin1
y <- System.IO.UTF8.hGetLine x
IO.putStr y
GNOME with xmonad
The simplest solution to this problem for me was to use
instead of defaultConfig
in my ~/.xmonad/xmonad.hs
file.
FullScreen SDL Game
- XMonad.Hooks.EwmhDesktops 항목 참조.
- Full screen games (from Steam) in XMonad invisible / Multimedia and Games / Arch Linux Forums
- Fullscreen SDL apps/games with Xmonad?
I don't play games on my xmonad machines, but maybe this will help. Does SDL use the EWMH fullscreen hint?
I import XMonad.Hooks.EwmhDesktops and then have this in my manage hooks:
I also create an ewmh
config object:
And then I compose ewmhConfig
into my manage hooks, layout hooks, and event hooks (ewmhDesktopsEventHook
). Oh, and I put the fullscreenEventHook
also in with the event hooks.
See also
Favorite site
- Xmonad web site
- xmonad - ArchWiki
- Xmonad vs i3 detailed comparison as of 2020 - Slant
- Visual xmonad Layouts Guide | Between Two Commits
- monad/Frequently asked questions - HaskellWiki
- Linux Setup with XMonad
- This is the Xmonad Tutorial for Beginning Beginners — Xmonad Tutorial for Beginning Beginners 1.0 documentation (xmonad, xmobar, stalonetray)
Guide
- My XMonad Configuration · Xiang - 좋은 모듈들에 대하여 설명한다.
- Visual xmonad Layouts Guide - 여러 종류 레이어를 설명하고 간단한 설정방법 알려줌.