From 514b3abfc33eb6b0e2eecec5fe6cae35ac1dbbcd Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Wed, 24 Nov 2021 09:00:47 -0500 Subject: update setup code --- desktop/.xmonad/xmonad.hs | 5 ++--- desktop/.xsession | 11 ++++++++++- emacs/.doom.d/config.el | 46 +++++++++++++++++++++++++--------------------- emacs/.doom.d/init.el | 4 +++- emacs/.doom.d/packages.el | 4 +++- setup.sh | 4 ++++ 6 files changed, 47 insertions(+), 27 deletions(-) diff --git a/desktop/.xmonad/xmonad.hs b/desktop/.xmonad/xmonad.hs index 061e351..2bc7c07 100644 --- a/desktop/.xmonad/xmonad.hs +++ b/desktop/.xmonad/xmonad.hs @@ -24,7 +24,6 @@ import XMonad.Hooks.EwmhDesktops import Control.Applicative ((<$>), pure) import XMonad.Hooks.SetWMName import XMonad.Hooks.ManageHelpers -import Data.List.Split import Control.Monad cViolet = "#68217A" @@ -55,7 +54,7 @@ bar = statusBar dzenCommand myDzenPP toggleStrutsKey where toggleStrutsKey XConfig{modMask = modm} = (modm, xK_b) main = do - host <- (head . splitOn "." . nodeName) <$> getSystemID + host <- (takeWhile (/= '.') . nodeName) <$> getSystemID setEnv "HOST" host True config <- bar (myConfig host) xmonad config @@ -160,7 +159,7 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $ -- , ((modm , xK_q ), spawn "xmonad --recompile; xmonad --restart") -- Lock screen - , ((modm .|. shiftMask, xK_z), spawn "mate-screensaver-command --lock") + , ((modm .|. shiftMask, xK_z), spawn "lock-screen.sh") ] ++ diff --git a/desktop/.xsession b/desktop/.xsession index 01cd8f1..afc60b7 100755 --- a/desktop/.xsession +++ b/desktop/.xsession @@ -10,9 +10,18 @@ fi source ~/.zshenv +find_planck_keyboard() { + xinput list | grep -q "OLKB Planck" +} + export TERMINAL=urxvt xrdb -merge $HOME/.Xresources -I$HOME -setxkbmap us -variant dvorak -option compose:ralt -option caps:ctrl_modifier +if find_planck_keyboard; then + setxkbmap us -option compose:ralt +else + setxkbmap us -variant dvorak -option compose:ralt -option caps:ctrl_modifier +fi + xsetroot -solid "#2A3462" pasystray & xss-lock -- /usr/bin/env xscreensaver-command --lock & diff --git a/emacs/.doom.d/config.el b/emacs/.doom.d/config.el index 4b106db..355a2ed 100644 --- a/emacs/.doom.d/config.el +++ b/emacs/.doom.d/config.el @@ -8,27 +8,29 @@ (setq user-full-name "KJ Orbekk" user-mail-address "kj@orbekk.com") -;; Doom exposes five (optional) variables for controlling fonts in Doom. Here -;; are the three important ones: -;; -;; + `doom-font' -;; + `doom-variable-pitch-font' -;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for -;; presentations or streaming. -;; -;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd -;; font string. You generally only need these two: -(setq doom-font (font-spec :family "iosevka" :size 14)) -(setq doom-variable-pitch-font (font-spec :family "Noto Serif" :size 16)) - -;; There are two ways to load a theme. Both assume the theme is installed and -;; available. You can either set `doom-theme' or manually load a theme with the -;; `load-theme' function. This is the default: +(defmacro system-specific-config (system-regex &rest code) + "Run CODE on systems that match SYSTEM-REGEX." + `(when (string-match ,system-regex (system-name)) + ,@code)) + +(setq kj/font-size 14) (setq doom-theme 'doom-dark+) -(when (equal "pincer" (system-name)) - (setq doom-theme 'doom-one-light)) -(when (equal "orbekk" (system-name)) - (setq doom-theme 'doom-acario-light)) + +(system-specific-config + "pincer" + (setq doom-theme 'doom-one-light)) + +(system-specific-config + "orbekk" + (setq doom-theme 'doom-acario-light)) + +(system-specific-config + "^zot\." + (setq kj/font-size 18) + (setq doom-theme 'doom-acario-light)) + +(setq doom-font (font-spec :family "iosevka" :size kj/font-size)) +(setq doom-variable-pitch-font (font-spec :family "Noto Serif" :size kj/font-size)) ;; If you use `org' and don't want your org files in the default location below, ;; change `org-directory'. It must be set before org loads! @@ -156,4 +158,6 @@ (map! (:after evil-org :leader "n P" #'kj/org-publish)) -(load-file "~/.doom.d/config.local.el") +(let ((local-config "~/.doom.d/config.local.el")) + (when (file-exists-p local-config) + (load-file local-config))) diff --git a/emacs/.doom.d/init.el b/emacs/.doom.d/init.el index 4c04ad3..e2ea82f 100644 --- a/emacs/.doom.d/init.el +++ b/emacs/.doom.d/init.el @@ -13,7 +13,9 @@ ;; ;; Alternatively, press 'gd' (or 'C-c g d') on a module to browse its ;; directory (for easy access to its source code). -(load-file "~/.doom.d/init.local.el") +(let ((local-config "~/.doom.d/init.local.el")) + (when (file-exists-p local-config) + (load-file local-config))) (doom! :input ;;chinese diff --git a/emacs/.doom.d/packages.el b/emacs/.doom.d/packages.el index 95c7e51..666cb66 100644 --- a/emacs/.doom.d/packages.el +++ b/emacs/.doom.d/packages.el @@ -48,4 +48,6 @@ ;; (package! hledger-mode) -(load-file "~/.doom.d/packages.local.el") +(let ((local-config "~/.doom.d/packages.local.el")) + (when (file-exists-p local-config) + (load-file local-config))) diff --git a/setup.sh b/setup.sh index 9b0f1d8..587a64c 100755 --- a/setup.sh +++ b/setup.sh @@ -6,6 +6,9 @@ STOW="stow -R --no-folding -v" cd "$(dirname $0)" git submodule update --init --recursive --depth 1 +touch ~/.zshrc.local +touch ~/.zshenv.local + $STOW common $STOW zsh touch $HOME/.zshrc.local @@ -28,6 +31,7 @@ if which emacs >/dev/null; then if [[ ! -e ~/.emacs.d ]]; then git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d fi + doom install doom sync # Too slow! fi -- cgit v1.2.3 From 5b61ad58ce2b09c298db7364cf16f2725575598b Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Thu, 2 Dec 2021 17:49:40 -0500 Subject: update --- emacs/.doom.d/config.el | 2 +- emacs/.doom.d/init.el | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/emacs/.doom.d/config.el b/emacs/.doom.d/config.el index 355a2ed..b2b8eca 100644 --- a/emacs/.doom.d/config.el +++ b/emacs/.doom.d/config.el @@ -26,7 +26,7 @@ (system-specific-config "^zot\." - (setq kj/font-size 18) + (setq kj/font-size 20) (setq doom-theme 'doom-acario-light)) (setq doom-font (font-spec :family "iosevka" :size kj/font-size)) diff --git a/emacs/.doom.d/init.el b/emacs/.doom.d/init.el index e2ea82f..65390f7 100644 --- a/emacs/.doom.d/init.el +++ b/emacs/.doom.d/init.el @@ -52,7 +52,7 @@ (window-select +numbers) ; visually switch windows workspaces ; tab emulation, persistence & separate workspaces zen ; distraction-free coding or writing - (emoji +unicode) ; 😇 + ;; (emoji +unicode) ; 😇 :editor (evil +everywhere); come to the dark side, we have cookies @@ -82,7 +82,7 @@ vterm ; the best terminal emulation in Emacs :checkers - syntax ; tasing you for every semicolon you forget + ;;syntax ; tasing you for every semicolon you forget ;;spell ; tasing you for misspelling mispelling ;;grammar ; tasing grammar mistake every you make @@ -96,7 +96,7 @@ (eval +overlay) ; run code, run (also, repls) ;;gist ; interacting with github gists lookup ; navigate your code and its documentation - ;;lsp + (lsp +eglot) ;;macos ; MacOS-specific commands magit ; a git porcelain for Emacs ;;make ; run make tasks from Emacs @@ -111,7 +111,7 @@ :lang ;;agda ; types of types of types of types... - cc ; C/C++/Obj-C madness + (cc +lsp) ; C/C++/Obj-C madness clojure ; java with a lisp ;;common-lisp ; if you've seen one lisp, you've seen them all ;;coq ; proofs-as-programs -- cgit v1.2.3