translated by @haoqixu

This commit is contained in:
xu0o0 2017-07-31 02:48:37 +08:00
parent ad19b6ba7a
commit f88cef6e8a
2 changed files with 91 additions and 87 deletions

View File

@ -1,87 +0,0 @@
【haoqixu 翻译中】Top 4 reasons I use dwm for my Linux window manager
============================================================
### A window manager handles the sizing and arrangement of the windows you open, among other things.
![Top 4 reasons I use dwm for my Linux window manager](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/car-penguin-drive-linux-yellow.png?itok=ueZE5mph "Top 4 reasons I use dwm for my Linux window manager")
Image by : 
Internet Archive [Book][4] [Images][5]. Modified by Opensource.com. CC BY-SA 4.0
I like minimalistic views. If I could run everything in a terminal I would. It's free from shiny stuff that hogs my resources and distracts my feeble mind. I also grow tired of resizing and moving windows, never getting them to align perfectly.
On my quest for minimalism, I grew fond of [Xfce][6] and used it as my main [desktop environment][7] for years on my Linux computers. Then, one day I came across a video of [Bryan Lunduke][8] talking about the awesome [window manager][9] he used called [Awesome][10]. It neatly arranges all of your windows for you, and so, sounded like just what I wanted. I tried it out but didn't get the hang of the configuration needed to tweak it into my liking. So, I moved on and discovered [xmonad][11], but I had a similar result. It worked fine but I couldn't get around the Haskell part to really turn it into my perfect desktop.
Years passed and by accident, I found my way to [suckless.org][12] and their version of a window manager called [dwm][13].
In short, a desktop environment such as KDE, Gnome, or Xfce includes many things, of which a window manager is one, but also with select applications. A window manager alone handles (among other window related things) the sizing and arrangement of the windows you open. Different desktop environments use different window managers. KDE has KWin, Gnome 2 has Metacity, Gnome 3 has Mutter, and Xfce has Xfwm. Conveniently, for all of these, you can change the default window manager to something else, which is what I've been doing for a while. I've been switching mine to dwm, and here's why I love it.
### Dynamic window management
The killer feature for dwm, as with Awesome and xmonad, is the part where the tool automatically arranges the windows for you, filling the entire space of your screen. Sure, for most desktop environments today it's possible to create keyboard shortcuts to arrange windows to the left, right, top, bottom or full screen, but with dwm it's just one less thing to think about.
Dwm divides the screen into a master and a stack area. There are three layouts to choose from: tile, monocle, and floating. When using tile mode, which is what I use the most, it puts the window which requires the most attention in the master area while the others are tiled in the stack area. In the monocle layout, all windows are maximized and you toggle between them. The floating layout allows you resize the windows as you want (as the most window managers do), which is handy if you're using Gimp or a similar application where custom size windows makes more sense.
Usually, in your desktop environment, you can use different workspaces to sort your windows and gather similar applications in designated workspaces. At work, I use one workspace for ongoing work and one for internet browsing. Dwm has a similar function called tags. You can group windows by tags and by selecting a tag, you display all the windows with that tag.
### Efficiency
Dwm is efficient if you want to save as much power as you can on your computer. Xfce and other lightweight environments are great on older or weaker machines, but dwm uses (in my case) about 1/3 of resources compared to Xfce after login. When I was using an eee pc with 1 GB RAM it made quite a difference if the memory was occupied to 660 MB or 230 MB. That left me with more room for the editors and browsers I wanted to use.
### Minimalistic
I typically set up my applications beside each other: the terminal as the master window (usually running Vim as an editor), a browser for email, and another browser window open for research or [Trello][14]. For casual internet browsing, I fire up a Chromium window in another workspace or a  _tag_  as I mentioned earlier.
### [dwm.png][1]
![](https://opensource.com/sites/default/files/dwm.png)
Screenshot by author.
With standard desktop environments, you often have at least one or two panels, top and bottom or on the side, taking up space. I have tried out the autohide panel function that most of them have, but I was annoyed every time I accidently put the mouse pointer too close to the edge and the panel popped out at the most inconvenient time. You can make them smaller as well but I still enjoy the minimalistic status bar on top of the screen available in dwm.
### Speed
When evaluating speed, I count both how quickly dwm is loaded when I log in and how quickly the applications launch when I start them. When using newer, faster computers you might not care about this detail yet, but for me, there is a noticable difference between various desktop environments and window managers. I don't want to actually wait for my computer to perform such easy tasks, it should just pop up. Also, using keyboard shortcuts to launch everything is faster than using a mouse or a touchpad, and my hands don't have to leave the keyboard.
### Conclusion
That said, I would not recommend dwm to the novice user. It takes some time to read up on how to configure it to your liking (unless you are satisfied with the setup provided by your Linux distribution). I have found some of the patches you might want to include can be tricky to get working and the support community is small (the IRC channel states "No patch-handholding"). So, it might take a bit of effort to get exactly what you want. However, once you do, it's well worth that bit investment.
And hey, it looks as awesome as Awesome.
--------------------------------------------------------------------------------
作者简介:
Jimmy Sjölund - Jimmy Sjölund is a senior IT service manager and innovation coach at Telia Company, focusing on organisation development, exploring agile and lean workflows and is a visualisation enthusiast. He's also an open source evangelist, previously engaged in Ubuntu Studio and Plume Creator.
-----------------
via: https://opensource.com/article/17/7/top-4-reasons-i-use-dwm-linux-window-manager
作者:[ Jimmy Sjölund Feed ][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/jimmysjolund
[1]:https://opensource.com/file/363336
[2]:https://opensource.com/article/17/7/top-4-reasons-i-use-dwm-linux-window-manager?rate=T8qhopZLfd1eum_NMLOSGckUh2nIjfeRpkERGjGhu7w
[3]:https://opensource.com/user/56551/feed
[4]:https://www.flickr.com/photos/internetarchivebookimages/14746482994/in/photolist-ot6zCN-odgbDq-orm48o-otifuv-otdyWa-ouDjnZ-otGT2L-odYVqY-otmff7-otGamG-otnmSg-rxnhoq-orTmKf-otUn6k-otBg1e-Gm6FEf-x4Fh64-otUcGR-wcXsxg-tLTN9R-otrWYV-otnyUE-iaaBKz-ovcPPi-ovokCg-ov4pwM-x8Tdf1-hT5mYr-otb75b-8Zk6XR-vtefQ7-vtehjQ-xhhN9r-vdXhWm-xFBgtQ-vdXdJU-vvTH6R-uyG5rH-vuZChC-xhhGii-vvU5Uv-vvTNpB-vvxqsV-xyN2Ai-vdXcFw-vdXuNC-wBMhes-xxYmxu-vdXxwS-vvU8Zt
[5]:https://www.flickr.com/photos/internetarchivebookimages/14774719031/in/photolist-ovAie2-otPK99-xtDX7p-tmxqWf-ow3i43-odd68o-xUPaxW-yHCtWi-wZVsrD-DExW5g-BrzB7b-CmMpC9-oy4hyF-x3UDWA-ow1m4A-x1ij7w-tBdz9a-tQMoRm-wn3tdw-oegTJz-owgrs2-rtpeX1-vNN6g9-owemNT-x3o3pX-wiJyEs-CGCC4W-owg22q-oeT71w-w6PRMn-Ds8gyR-x2Aodm-owoJQm-owtGp9-qVxppC-xM3Gw7-owgV5J-ou9WEs-wihHtF-CRmosE-uk9vB3-wiKdW6-oeGKq3-oeFS4f-x5AZtd-w6PNuv-xgkofr-wZx1gJ-EaYPED-oxCbFP
[6]:https://xfce.org/
[7]:https://en.wikipedia.org/wiki/Desktop_environment
[8]:http://lunduke.com/
[9]:https://en.wikipedia.org/wiki/Window_manager
[10]:https://awesomewm.org/
[11]:http://xmonad.org/
[12]:http://suckless.org/
[13]:http://dwm.suckless.org/
[14]:https://opensource.com/node/22546
[15]:https://opensource.com/users/jimmysjolund
[16]:https://opensource.com/users/jimmysjolund
[17]:https://opensource.com/article/17/7/top-4-reasons-i-use-dwm-linux-window-manager#comments

View File

@ -0,0 +1,91 @@
我选择 dwm 作为窗口管理器的 4 大理由
============================================================
### 窗口管理器负责管理打开窗口的大小、布置以及其它相关的方面。
![Top 4 reasons I use dwm for my Linux window manager](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/car-penguin-drive-linux-yellow.png?itok=ueZE5mph "我选择 dwm 作为窗口管理器的 4 大理由")
图片来自:
Internet Archive [Book][4] [Images][5] 由 Opensource.com 修改 CC BY-SA 4.0
我喜欢极简的视图。如果可能,我会尽量在一个终端下运行所有需要的程序。这避免了一些浮夸的特效占用我的资源或者分散我的注意力。而且,调整窗口大小和位置却依旧无法使它们完美地对齐,这也让我感到厌烦。
出于对极简化的追求,我喜欢上了 [Xfce][6] 并且把它作为我主要的 Linux [桌面环境][7]好几年了。直到后来我看了 [Bryan Lunduke][8] 关于他所使用的 [Awesome][10] [窗口管理器][9]的视频。Awesome 为用户整齐地布置好他们的窗口,看起来就是我想要的效果。我在尝试之后却发现我难以把它配置成我喜欢的样子。于是我继续查找,发现了 [xmonad][11] 然而我遇到了同样的问题。[Xmonad][11] 可以良好运作但为了把它配置成我理想中的样子我却不得不先通过 Haskell 语言这关。(译者: AwesomeWM 使用 lua 语言作为配置语言,而 xmonad 使用 Haskell 语言)
几年后,我无意间发现了 [suckless.org][12] 和他们的窗口管理器 [dwm][13]。
简而言之,一个窗口管理器,例如 KDEGnome 或者 Xfce包括了许多部件其中除了窗口管理器还有其它应用程序。窗口管理器负责管理打开窗口的大小、布置以及其它窗口相关的方面。不同的桌面环境使用不同的窗口管理器KDE 使用 KWinGnome 2 使用 Metacity Gnome 3 使用 Mutter 以及 Xfce 使用 Xfwm。你可以方便地替换这些桌面环境的默认窗口管理器。我已经把我的窗口管理器替换成 dwm下面我说说我喜欢 dwm 的理因。
### 动态窗口管理
与 Awesome 及 xmonad 一样dwm 的杀手锏是它能利用屏幕的所有空间为你自动排列好窗口。当然,在现在的大多数桌面环境中,你也可以设置相应的快捷键把你的窗口放置在屏幕的上下左右或者是全屏,但是有了 dwm 我们就不需要考虑这么多了。
Dwm 把屏幕分为主区域和栈区域。它包含三种布局平铺单片镜monocle和浮动。平铺模式是我最常使用的它把一个主要的窗口放置在主区域将其余窗口平铺在栈区域中。在单片镜模式中所有窗口都会被最大化你可以在它们之间相互切换。浮动模式允许你自由调整窗口大小就像在大多数窗口管理器下那样这在你使用像 Gimp
这类需要自定义窗口大小的应用时更为方便。
一般情况下在你的桌面环境下你可以使用不同的工作空间来分类你的窗口把相近的应用程序放置在计划好的工作空间中。在工作时我会使用一个工作空间来进行工作同时使用另一个工作空间来浏览网页。Dwm 有一个相似的功能叫标签。你可以使用标签给窗口分组,当你选中一个标签时,就能显示具有相应标签的窗口。
### 高效
Dwm 能让你的计算机尽量地节省电量。Xfce 和其它轻量桌面环境在较旧或者较低性能的机器上很受欢迎,但是相比于 Xfcedwm 在登录后只使用了 1/3 的资源(在我的例子中)。当我在使用一台 1 GB 内存的Eee PC (译者:华硕生产的一款上网本,已停产)时,占用 660 MB 和 230MB 的差别就很大了。这让我有足够的内存空间运行我的编辑器和浏览器。
### 极简
通常,我让我的应用程序彼此相邻:作为主窗口的终端(通常运行着 Vim用来查阅邮件的浏览器和另外一个用来查阅资料或者 [Trello][14] 的浏览器窗口。对于临时的网页浏览,我会在另一个工作空间或者说是另一个 _标签_ 中开启一个 Chromium 窗口。
### [dwm.png][1]
![](https://opensource.com/sites/default/files/dwm.png)
来自作者的屏幕截图。
在标准的桌面环境下,通常会有一或两个面板占据着屏幕上下或者两侧的空间。我尝试过使用自动隐藏功能,但当光标太靠近边缘导致面板弹出造成的不便实在让我很厌烦。你也可以把它们设置得更小,但我还是更喜欢 dwm 的极简状态栏。
### 速度
评判速度时,我比较看重 dwm 在登录后的加载速度和启动程序的速度。如果使用更快更新的计算机,你可能不会在意这些细节,但是对我来说,不同的桌面环境和窗口管理器会有明显的差距。
我实在不想连这种简单的操作也要等待,它们应该一下子就完成。另外,使用键盘快捷键来启动程序比起用鼠标或者触控板要快一些,而且我不想让双手离开键盘。
### 小结
即便如此,我也不会向新手用户推荐 dwm。研究如何配置它需要耗费一些时间除非你对你的发行版提供的默认配置感到满意。我发现要让一些你想要的补丁正常工作可能会有点棘手而且相应的社区也比较小IRC 频道明确表示不提供补丁的手把手教学)。所以,为了得到你想要的效果,你得有些付出才行。不过,这也是值得的。
而且你看,它就像 Awesome 一样酷炫。
--------------------------------------------------------------------------------
作者简介:
Jimmy Sjölund - Jimmy Sjölund 是 Telia Company 的高级 IT 服务经理,关注团队开发、探索敏捷工作流和精益工作流的创新导师,以及可视化方向爱好者。他同时也是一名开源布道者,先前从事于 Ubuntu Studio 和 Plume Creator。
-----------------
via: https://opensource.com/article/17/7/top-4-reasons-i-use-dwm-linux-window-manager
作者:[ Jimmy Sjölund Feed ][a]
译者:[haoqixu](https://github.com/haoqixu)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/jimmysjolund
[1]:https://opensource.com/file/363336
[2]:https://opensource.com/article/17/7/top-4-reasons-i-use-dwm-linux-window-manager?rate=T8qhopZLfd1eum_NMLOSGckUh2nIjfeRpkERGjGhu7w
[3]:https://opensource.com/user/56551/feed
[4]:https://www.flickr.com/photos/internetarchivebookimages/14746482994/in/photolist-ot6zCN-odgbDq-orm48o-otifuv-otdyWa-ouDjnZ-otGT2L-odYVqY-otmff7-otGamG-otnmSg-rxnhoq-orTmKf-otUn6k-otBg1e-Gm6FEf-x4Fh64-otUcGR-wcXsxg-tLTN9R-otrWYV-otnyUE-iaaBKz-ovcPPi-ovokCg-ov4pwM-x8Tdf1-hT5mYr-otb75b-8Zk6XR-vtefQ7-vtehjQ-xhhN9r-vdXhWm-xFBgtQ-vdXdJU-vvTH6R-uyG5rH-vuZChC-xhhGii-vvU5Uv-vvTNpB-vvxqsV-xyN2Ai-vdXcFw-vdXuNC-wBMhes-xxYmxu-vdXxwS-vvU8Zt
[5]:https://www.flickr.com/photos/internetarchivebookimages/14774719031/in/photolist-ovAie2-otPK99-xtDX7p-tmxqWf-ow3i43-odd68o-xUPaxW-yHCtWi-wZVsrD-DExW5g-BrzB7b-CmMpC9-oy4hyF-x3UDWA-ow1m4A-x1ij7w-tBdz9a-tQMoRm-wn3tdw-oegTJz-owgrs2-rtpeX1-vNN6g9-owemNT-x3o3pX-wiJyEs-CGCC4W-owg22q-oeT71w-w6PRMn-Ds8gyR-x2Aodm-owoJQm-owtGp9-qVxppC-xM3Gw7-owgV5J-ou9WEs-wihHtF-CRmosE-uk9vB3-wiKdW6-oeGKq3-oeFS4f-x5AZtd-w6PNuv-xgkofr-wZx1gJ-EaYPED-oxCbFP
[6]:https://xfce.org/
[7]:https://en.wikipedia.org/wiki/Desktop_environment
[8]:http://lunduke.com/
[9]:https://en.wikipedia.org/wiki/Window_manager
[10]:https://awesomewm.org/
[11]:http://xmonad.org/
[12]:http://suckless.org/
[13]:http://dwm.suckless.org/
[14]:https://opensource.com/node/22546
[15]:https://opensource.com/users/jimmysjolund
[16]:https://opensource.com/users/jimmysjolund
[17]:https://opensource.com/article/17/7/top-4-reasons-i-use-dwm-linux-window-manager#comments