Recently Written · git

stumpwm-init

I use dwm now. Archived.

git clone https://github.com/equwal/stumpwm-init

Log | Files | Refs


commit d213887743c8c90f8e0a3520095cd518f3bbe99b
Spenser Truex <web@spensertruex.com>
2019-12-08 12:11:46 -0800

More OPTIONAL configuration, less MANDATORY configuration.

 README.org    | 15 ++++++++++++---
 commands.lisp |  9 +++++++--
 package.lisp  |  5 ++++-
 3 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/README.org b/README.org
index f2bd784..ee9b2c1 100644
--- a/README.org
+++ b/README.org
@@ -20,8 +20,19 @@ to your ~.stumpwmrc~ (although there is some [[*Optional Configuration][optional
 * Optional Configuration
 ** xterm
 Install the =Hack= font, or add your own to =stumpwm-init:*xterm-font*=.
+#+begin_src common-lisp
+(setf stumpwm-init:*xterm-font* "Hack"
+      stumpwm-init:*xterm-font-pt* 12)
+#+end_src
+** deftermcom
+Write commands which will be run and opened in the terminal. Useful for curses
+programs.
+#+begin_src common-lisp
+(stumpwm-init:deftermcom nmtui "-e nmtui" xterm)
+#+end_src
 ** poison
-Find your mouse's name with ~xinput --list~, and set it to ~*my-mouse*~. Turns the mouse all the way off using ~xinput~.
+Find your mouse's name with ~xinput --list~, and set it to
+~stumpwm-init:*my-mouse*~. Turns the mouse all the way off using ~xinput~.
 ** app-menu
 Add programs to the app menu (bound to =M-`= by default) using ~pushnew-apps~.
 This keeps them sorted alphabetically. Any programs in ~stumpwm-init:*app-menu*~
@@ -30,8 +41,6 @@ need to be installed to work:
 - web browser
 Example:
 #+begin_src common-lisp
-(defvar *xterm-font* "Hack"
-  "The name of the font to use for xterm.")
 (stumpwm-init:pushnew-apps '("eclipse" "eclipse")
                            '("spotify" "spotify")
                            '("gimp" "gimp")
diff --git a/commands.lisp b/commands.lisp
index 0fad978..61bbe23 100644
--- a/commands.lisp
+++ b/commands.lisp
@@ -1,14 +1,19 @@
 (in-package #:stumpwm-init)
 (defvar *xterm-font-pt* 12
   "The font size to call xterm with.")
+(defvar *xterm-font* nil
+  "The font to call xterm with. Either a string (eg. \"Hack\") or NIL for
+none.")
 (defcommand xterm (&optional additional-argstr) ()
   "Call xterm with a couple of settings arguments."
   (run-shell-command
    (concatenate 'string
-                "xterm -fa '" *xterm-font* "'"
+                "xterm"
+                (if *xterm-font*
+                    (concatenate 'string " -fa '" *xterm-font* "'")
+                    "")
                 " " "-fs " (format nil "~D" *xterm-font-pt*)
                 " " additional-argstr)))
-(deftermcom nmtui "-e nmtui" xterm)
 
 (defvar *toggle* nil)
 (defvar *my-mouse* "ETPS/2 Elantech Touchpad")
diff --git a/package.lisp b/package.lisp
index f3322b1..60e58d2 100644
--- a/package.lisp
+++ b/package.lisp
@@ -26,6 +26,9 @@
    :*window-format*)
   (:export
    :*my-mouse* ;Set for the `poison' command to toggle it.
-   :*xterm-font* ;;settings for xterm to look nice.
+   :poison
    :*xterm-font-pt*
+   :*xterm-font*
+   :xterm
+   :deftermcom
    :pushnew-apps))