Page 1 of 1

[QUICK & DIRTY] Emacs in X11 without WM

Posted: Sun Nov 29, 2015 4:10 pm
by machinebacon
Welcome to the Quick & Dirty series here on the LinuxBBQ BBS.

You want to have all the convenience of an Xserver without 'bloat' added (let's say Emacs itself isn't bloat, OK?)

The following steps will give you a X session with Emacs running in full-screen without a window manager. Hitting C-x C-c will shut down X and drop you back to login.

1) we don't need a so-called display manager (LightDM, etc)
2) in our ~/.xinitrc we have the following lines (more or less, just be sure the last line is exactly the same)

Code: Select all

#!/bin/bash

# disable blanking
xset s off &
xset -dpms &
# pick a mouse pointer
xsetroot -cursor_name left_ptr &
# Ctrl-Alt-Backspace kills the X session (let's keep this in case gnus dies on you)
setxkbmap -option terminate:ctrl_alt_bksp &

exec emacs -fs
3) use 'startx' to run

You might argue that this would also work in an x-terminal-emulator with emacs -nw -fs -- that's true, but you wouldn't have the nice PDF displays or image previews in dired.

Extra hint:

You can put the following snipped into your emacs configuration to assign fullscreen to F11 and to set the frame to maximized -- it is optional:

Code: Select all

(defun toggle-fullscreen ()
  "Toggle full screen on X11"
  (interactive)
  (when (eq window-system 'x)
    (set-frame-parameter
     nil 'fullscreen
     (when (not (frame-parameter nil 'fullscreen)) 'fullboth))))

(global-set-key [f11] 'toggle-fullscreen)

(custom-set-variables
  '(initial-frame-alist (quote ((fullscreen . maximized)))))
Have fun!

Re: [QUICK & DIRTY] Emacs in X11 without WM

Posted: Sun Nov 29, 2015 8:17 pm
by GekkoP
Nice one. Thanks!

Re: [QUICK & DIRTY] Emacs in X11 without WM

Posted: Mon Nov 30, 2015 5:38 am
by franksinistra
Cool, thanks!

Re: [QUICK & DIRTY] Emacs in X11 without WM

Posted: Mon Nov 30, 2015 9:18 am
by Snap
Thanks for this guide, bacon.

Re: [QUICK & DIRTY] Emacs in X11 without WM

Posted: Tue Jan 05, 2016 2:09 pm
by machinebacon
This is how it looks like "by default" without .emacs file. If interested, I spin it up and put it on sourceforge. no-GTK, but X11

Re: [QUICK & DIRTY] Emacs in X11 without WM

Posted: Tue Jan 05, 2016 3:28 pm
by GekkoP
I am interested, of course. I have one machine I can use for this one.

Re: [QUICK & DIRTY] Emacs in X11 without WM

Posted: Tue Jan 05, 2016 3:51 pm
by machinebacon
do you need some external packages from the repos? magit, wl, clisp?

Re: [QUICK & DIRTY] Emacs in X11 without WM

Posted: Tue Jan 05, 2016 3:57 pm
by GekkoP
I use Magit, but feel free to leave everything out. I will bloat set it up later.

Re: [QUICK & DIRTY] Emacs in X11 without WM

Posted: Tue Jan 05, 2016 5:31 pm
by machinebacon
okay, I'll make this happen tonight :)

Re: [QUICK & DIRTY] Emacs in X11 without WM

Posted: Wed Jan 06, 2016 10:44 am
by franksinistra
^ Praise baconator!

Re: [QUICK & DIRTY] Emacs in X11 without WM

Posted: Wed Jan 06, 2016 7:29 pm
by machinebacon
It's on the way up :)