Skip to content

Commit

Permalink
Import into Git
Browse files Browse the repository at this point in the history
  • Loading branch information
Koekelas committed Sep 21, 2020
1 parent 0c968a3 commit 59e4fc0
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
prefix := /usr/local
exec_prefix := $(prefix)
bindir := $(exec_prefix)/bin
datarootdir := $(prefix)/share
sysconfdir := $(prefix)/etc

.PHONY: install uninstall
install:
install -t $(bindir) -D -m 755 exwm
install -t $(sysconfdir)/exwm -D -m 644 exwmrc
install -t $(datarootdir)/xsessions -D -m 644 exwm.desktop

uninstall:
-rm $(bindir)/exwm
-rm -r $(sysconfdir)/exwm
-rm $(datarootdir)/xsessions/exwm.desktop
47 changes: 47 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
#+TITLE: EXWM GDM

Launch [[https://github.com/ch11ng/exwm][EXWM]] from [[https://wiki.gnome.org/Projects/GDM][GDM]].

* Motivation
Cobbling together a desktop environment doesn't appeal to me. Reusing
GNOME lets me focus on what does. GDM launches a rootless Xorg,
sources =.profile=, unlocks the keyring, etc.

* Getting started
To get started, run:

#+BEGIN_SRC sh
git clone https://github.com/Koekelas/exwm-gdm.git
#+END_SRC

Then, to install, provided =/usr= and =/etc= are correct (they are on
[[https://ubuntu.com/desktop][Ubuntu]], [[https://www.archlinux.org/][Arch Linux]] and likely other GNU/Linux distributions), run from
this directory:

#+BEGIN_SRC sh
make install prefix=/usr sysconfdir=/etc
#+END_SRC

Finally, in Emacs, evaluate ~(package-install 'exwm)~ and add
~(exwm-initialize)~ to the Emacs initialization file. Now, when in GDM,
after choosing a user, click the gear and choose EXWM.

* How to

** Change how Emacs is launched
Create =$XDG_CONFIG_DIR/exwm/exwmrc= (typically =~/.config/exwm/exwmrc=),
a shell script, for example:

#+BEGIN_SRC sh
# Set SSH agent (GNOME Keyring Daemon)
eval $(gnome-keyring-daemon -s)
export SSH_AUTH_SOCK

# Launch Emacs
exec emacs
#+END_SRC

** Enable EXWM only when Emacs is launched from GDM
Check if =$XDG_CURRENT_DESKTOP= equals =EXWM=, for example:

#+BEGIN_SRC emacs-lisp
(when (string= (getenv "XDG_CURRENT_DESKTOP") "EXWM")
(exwm-enable))
#+END_SRC
6 changes: 6 additions & 0 deletions exwm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

exwmrc="${XDG_CONFIG_HOME:-$HOME/.config}/exwm/exwmrc"

[[ ! -f "$exwmrc" ]] && exwmrc="/etc/exwm/exwmrc"
. "$exwmrc"
6 changes: 6 additions & 0 deletions exwm.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Desktop Entry]
Type=Application
Name=EXWM
TryExec=/usr/bin/exwm
Exec=/usr/bin/exwm
DesktopNames=EXWM
1 change: 1 addition & 0 deletions exwmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exec emacs

0 comments on commit 59e4fc0

Please sign in to comment.