[QUICK & DIRTY] Emacs in X11 without WM

Forum rules
Share your brain ;)
machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

[QUICK & DIRTY] Emacs in X11 without WM

Unread post by machinebacon » Sun Nov 29, 2015 4:10 pm

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!
..gnutella..

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5877
Joined: Tue Sep 03, 2013 7:05 am

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

Unread post by GekkoP » Sun Nov 29, 2015 8:17 pm

Nice one. Thanks!

User avatar
franksinistra
Ivana Fukalot
Posts: 1093
Joined: Mon Jan 27, 2014 2:03 am
Location: 印尼国

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

Unread post by franksinistra » Mon Nov 30, 2015 5:38 am

Cool, thanks!
rice no more.

User avatar
Snap
Sperminator
Posts: 189
Joined: Sun Oct 05, 2014 8:11 pm

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

Unread post by Snap » Mon Nov 30, 2015 9:18 am

Thanks for this guide, bacon.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

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

Unread post by machinebacon » Tue Jan 05, 2016 2:09 pm

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
Attachments
2016010514519986211280x800.png
..gnutella..

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5877
Joined: Tue Sep 03, 2013 7:05 am

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

Unread post by GekkoP » Tue Jan 05, 2016 3:28 pm

I am interested, of course. I have one machine I can use for this one.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

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

Unread post by machinebacon » Tue Jan 05, 2016 3:51 pm

do you need some external packages from the repos? magit, wl, clisp?
..gnutella..

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5877
Joined: Tue Sep 03, 2013 7:05 am

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

Unread post by GekkoP » Tue Jan 05, 2016 3:57 pm

I use Magit, but feel free to leave everything out. I will bloat set it up later.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

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

Unread post by machinebacon » Tue Jan 05, 2016 5:31 pm

okay, I'll make this happen tonight :)
..gnutella..

User avatar
franksinistra
Ivana Fukalot
Posts: 1093
Joined: Mon Jan 27, 2014 2:03 am
Location: 印尼国

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

Unread post by franksinistra » Wed Jan 06, 2016 10:44 am

^ Praise baconator!
rice no more.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

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

Unread post by machinebacon » Wed Jan 06, 2016 7:29 pm

It's on the way up :)
..gnutella..

Post Reply