dwm - tutorial
快捷键:
看了下config.def.h文件的默认设置:
[Alt]+[p] dmenu for running programs like the x-www-browser
[Shift]+[Alt]+[q] To quite dwm cleanly
[Shift]+[Alt]+[c] To kill a window
[Shift]+[Alt]+[Enter] Launch terminal
[Shift]+[Alt]+[1,2,3,...] Move current window to area 1,2,3...
[Alt]+[1,2,3,...] Switch to area 1,2,3...
[Alt]+[0] 预览1-9所有内容
[Alt]+tab Switch view area
[Alt]+j 激活下一个窗口
[Alt]+k 激活上一个窗口
[Alt]+h 左移边界
[Alt]+l 右移边界
[Alt]+i 分割Master窗口(+1)
[Alt]+d 还原Master窗口(-1)
[Alt]+b 隐藏/显示dmenu菜单
[Alt]+t [Alt]+f [Alt]+m 切換桌面布局方式
[Alt]+space 前後布局切換
[Alt]+[Enter] 切換Master窗口
=tutorial===========
Launching
To launch dwm, ideally you should setup a ~/.xinitrc with at least exec dwm.
Introduction
Using dwm can be done in pure keyboard control or through some extra mouse handling. See the config.def.h for what are the default bindings. They are used in this tutorial.
[Shift]+[Alt]+[Enter] - launch terminal
[Alt]+[p] - dmenu for running programs like the x-www-browser
By default there are 9 tags.
Window model
Launch a few terminals with [Shift]+[Alt]+[Enter] and dwm will tile the windows between the master and stack. A new terminal appears on the master window. Existing windows are pushed upon a stack to the right of the screen. [Alt]+[Enter] toggles windows between master and stack.
+------+----------------------------------+--------+
| tags | title | status +
+------+---------------------+------------+--------+
| | |
| | |
| | |
| | |
| master | stack |
| | |
| | |
| | |
| | |
+----------------------------+---------------------+
Moving Around
To move to another terminal, press [Alt]+[j] or [Alt]+[k].
To move a terminal to another tag, hover to the terminal and press [Shift]+[Alt]+[2].
To focus on another tag, press [Alt]+[tag number].
To move a terminal to master or stack, press [Alt]+[d] or [Alt]+[i].
As stated in the dwm manpage, you can click tags with the left mouse button and simulating [Alt]+[tag number], but you can also click another tag with the right mouse button in order to bring those windows additionally into your current focus.
To kill a window, press [Shift]+[Alt]+[c].
Layouts
By default dwm is in tiled layout mode. Ensure it is tiled mode with:
[Alt]+[t]
You should also notice the []= symbol between the tag numbers and the title bar.
dwm has two further layout modes, floating ><> [Alt]+[f] and monocle [M] [Alt]+[m]. Monocle is good for ensuring a window is kept maximized and focused. This is useful in web kiosk environments and watching flash videos. Further layout modes can be included through patches.
Floating
Floating layout will be familiar to Windows users. Use [Alt]+[right mouse button] to resize the floating window and [Alt]+[left mouse button] to move it around.
There are several ways to get specific windows into being managed as a floating window, despite the tiled layout being activated. First there is [Alt]+[Shift]+[space], which will toggle floating mode on the active window. Then there is the possible to simply resize the window using [Alt]+[right mouse button]. The last method is to [Alt]+[middle mouse button] onto the window, to toggle it in being floating. These floating windows then can be used to force certain window sizes, when some application requires this for aesthetics or simply to being usable.
If you want to set some type of window to be always floating, look at the config.def.h and the rules array, where the last but one element defines this behaviour.
Quitting
To quit dwm cleanly:
[Shift]+[Alt]+[q]
Status
By default dwm is showing dwm-X.X in its statusbar. This text can be changed by setting the WM_NAME property of the root window.
Using the tools of X.org, this can be set using:
% xsetroot -name "Some Text"
There are various tools and methods to populate this text with useful information from your system or services running on your system. A barebone for doing this in C is dwmstatus. See the xinitrc example for how to do it using a script.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)