Emacs Is My New Window Manager

Most companies that employ me, hand me a “work laptop” as I enter the building. Of course, I do not install personal software and keep a clear division between my “work like” and my “real life.”

However, I also don’t like to carry two computers just to jot down personal notes. My remedy is to install a virtualization system and create a “personal” virtual machine. (Building cloud software as my day job means I usually have a few VMs running all the time.)

Since I want this VM to have minimal impact on my work, I base it on a “Server” version of Ubuntu. however, I like some graphical features, so my most minimal after market installation approach is: 1

sudo apt-get install -y xinit

Since most of what I do is org-mode work, the next step is:

sudo apt-get install -y emacs

I have played with a lot of window managers, and while some claim to be unobtrusive and minimal 2 , I really just want Emacs in full-screen mode (utilizing all screen estate possible), with the occassional running of a browser. 3

To accomplish this, I create an .xinitrc file that contains only:

exec emacs

That’s right, folks, Emacs is my window manager . I add the following to my Emacs init.el script:

(set-frame-parameter nil 'fullscreen 'fullboth)

And now I can split the screen into windows, launch programs, etc… all without fondling the mouse, and since Emacs is in its graphical mode, I can use my favorite fonts, decorate the fringe, etc.

If I need a program that doesn’t run well within Emacs, I can call xterm (or any other application) with M-! xterm .

Web Browsing

Unlike the previous century, this century has been defined by web applications. Most of my web efforts are looking up code documentation and other technical resources, and this is good using a text-oriented browser like w3m or eww embedded within Emacs.

Whenever a page doesn’t render well (can you say JavaScript), I can hit the & key to bring up the Chromium web browser. 4 . I can call this function to bring up my email:

(start-process "" nil "xdg-open" "http://mail.google.com")

Keep in mind, running X window applications overlay Emacs, but for me this is fine, as these windows are temporary, and when closed, I’m dropped back to Emacs.

If a temporary overlay becomes cumbersome, and I need to move windows around, I can kick off an actual window manager: M-! blackbox

Other Applications

I realize that running shells inside Emacs isn’t for everyone, but currently using Emacs as my entire Linux desktop works pretty well. Especially since I can split the frame into a series of windows running:

I use a function to start my favorite time-sinks…er, applications, at one time:

(defun setup-windows ()
  "Organize a series of windows for ultimate distraction."

  ;; Start with the Stack Overflow interface
  (sx-tab-frontpage t nil)

  ;; Put IRC on the other side
  (other-window 1)

  ;; My RSS Feed goes on top:

  ;; And start up the Twitter interface above that:
  (other-window 2)

  (window-configuration-to-register ?w))

The last line insert this “current” configuration in a register, so after stomping and stirring my windows, I return to this organization with C-x r j w .

Perhaps another screenshot of these results are in order:

稿源:Howardism (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 后端存储 » Emacs Is My New Window Manager

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录