1. Martin Loz
  2. darkroom-mode
  3. Issues
Issue #3 resolved

similar for GNU/Linux → code snippet

Arne Babenhauserheide
created an issue

I just created something similar for my own box and thought you might be interested in the code, for example to make your darkroom work on GNU/Linux, too:

{{{ ;;;; Activate distraction free editing with F11

; hide mode line, from http://dse.livejournal.com/66834.html / http://webonastick.com (autoload 'hide-mode-line "hide-mode-line" nil t)

; fullscreen, taken from http://www.emacswiki.org/emacs/FullScreen#toc1 (defun toggle-fullscreen (&optional f) (interactive) (let ((current-value (frame-parameter nil 'fullscreen))) (set-frame-parameter nil 'fullscreen (if (equal 'fullboth current-value) (if (boundp 'old-fullscreen) old-fullscreen nil) (progn (setq old-fullscreen current-value) 'fullboth)))))

; simple darkroom with fullscreen, fringe, mode-line, menu-bar and scroll-bar hiding. (defvar darkroom-enabled nil)

(defun toggle-darkroom () (interactive) (if (not darkroom-enabled) (setq darkroom-enabled t) (setq darkroom-enabled nil)) (toggle-fullscreen) (hide-mode-line) (if darkroom-enabled (progn (fringe-mode 'both) (menu-bar-mode -1) (scroll-bar-mode -1) (set-fringe-mode 200)) (progn (fringe-mode 'default) (menu-bar-mode) (scroll-bar-mode t) (set-fringe-mode 8))))

; Activate with F11 -> enhanced fullscreen :) (global-set-key [f11] 'toggle-darkroom)

(provide 'activate-darkroom) }}}

Comments (3)

  1. Log in to comment