-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy path+wsl.el
32 lines (28 loc) · 1.09 KB
/
+wsl.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
;;; ~/.doom.d/+wsl.el -*- lexical-binding: t; -*-
;; * set browser in wsl
(setq-default sysTypeSpecific system-type) ;; get the system-type value
(cond
;; If type is "gnu/linux", override to "wsl/linux" if it's WSL.
((eq sysTypeSpecific 'gnu/linux)
(when IS-WSL
(setq-default sysTypeSpecific "wsl/linux") ;; for later use.
(setq
cmdExeBin "/mnt/c/Windows/System32/cmd.exe"
cmdExeArgs '("/c" "start" ""))
(setq
browse-url-generic-program cmdExeBin
browse-url-generic-args cmdExeArgs
browse-url-browser-function 'browse-url-generic)
(defun org-file-apps-wsl (path)
(shell-command (concat
"/mnt/c/Windows/System32/cmd.exe /c start \""
(file-relative-name path) "\"")))
(after! org
(setq org-file-apps
`(("pdf" . emacs)
("\\.x?html?\\'" . (lambda (file link)
(org-file-apps-wsl file)))
(auto-mode . emacs)
(directory . emacs)
(t . (lambda (file link)
(org-file-apps-wsl file)))))))))