aboutsummaryrefslogtreecommitdiff
(require 'exwm)
(require 'exwm-config)

(require 'exwm-systemtray)
(exwm-systemtray-enable)

(setq exwm-input-simulation-keys
      '(([?\C-b] . [left])
        ([?\C-f] . [right])
        ([?\C-p] . [up])
        ([?\C-n] . [down])
        ([?\C-a] . [home])
        ([?\C-e] . [end])
        ([?\M-v] . [prior])
        ([?\C-v] . [next])
        ([?\C-d] . [delete])
        ([?\C-k] . [S-end C-x])
        ([?\C-s] . [C-f])
        ([?\C-y] . [C-v])
        ([?\C-w] . [C-x])
        ([?\M-w] . [C-c])))
(put 'exwm-input-simulation-keys 'saved-value t)

(require 'exwm-edit)
(add-hook 'exwm-edit-compose-hook
          (lambda () (funcall 'markdown-mode)))

(call-process-shell-command "setxkbmap -option ctrl:nocaps")

(defun truncate-exwm-title  (s)
  (if (<= (string-width s) 49)
      s
    (truncate-exwm-title (substring s 0 -1))))

(defun exwm-rename-buffer ()
  (interactive)
  (exwm-workspace-rename-buffer
   (concat exwm-class-name ":"
           (if (or (not (stringp exwm-title))
                   (<= (string-width exwm-title) 50))
               exwm-title
             (concat (truncate-exwm-title exwm-title) "…")))))
(add-hook 'exwm-update-class-hook 'exwm-rename-buffer)
(add-hook 'exwm-update-title-hook 'exwm-rename-buffer)

(start-process-shell-command "nm-applet" nil "nm-applet")

(advice-add #'exwm-config-misc
            :around
            (lambda (old-func &rest args)
              (scroll-bar-mode -1)
              (fringe-mode 1)))

(exwm-config-example)