2015-06-06 06:40:33 -04:00
|
|
|
;;; core-os-linux.el --- Debian-specific settings
|
|
|
|
|
2016-10-24 02:45:42 +02:00
|
|
|
(setq x-super-keysym 'meta
|
|
|
|
x-meta-keysym 'alt)
|
|
|
|
|
2016-10-02 23:29:51 +02:00
|
|
|
(defun doom-open-with (command &rest args)
|
|
|
|
"Open PATH in APP-NAME, using xdg-open."
|
|
|
|
(interactive)
|
|
|
|
(unless args
|
|
|
|
(setq args (f-full (s-replace "'" "\\'"
|
|
|
|
(or path (if (eq major-mode 'dired-mode)
|
|
|
|
(dired-get-file-for-visit)
|
|
|
|
(buffer-file-name)))))))
|
|
|
|
(let ((command (apply 'format command
|
|
|
|
(mapcar (lambda (a) (shell-quote-argument a))
|
|
|
|
args))))
|
|
|
|
(message "Running: %s" command)
|
|
|
|
(shell-command command)))
|
|
|
|
|
2016-09-23 16:09:19 +02:00
|
|
|
|
2016-10-02 23:29:51 +02:00
|
|
|
;;
|
|
|
|
;; OS-specific functions
|
|
|
|
;;
|
|
|
|
|
|
|
|
(defun os-open-in-browser ()
|
|
|
|
"Open the current file in the browser."
|
2015-06-06 06:40:33 -04:00
|
|
|
(interactive)
|
2016-10-02 23:29:51 +02:00
|
|
|
(browse-url buffer-file-name))
|
|
|
|
|
|
|
|
(defun os-open-in-default-program ()
|
|
|
|
"Open the current file (or selected file in dired) with xdg-open."
|
|
|
|
(interactive)
|
|
|
|
(doom-open-with "xdg-open '%s'"))
|
|
|
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
;; Plugins
|
|
|
|
;;
|
2015-06-06 06:40:33 -04:00
|
|
|
|
2016-10-02 23:29:51 +02:00
|
|
|
(use-package openwith
|
|
|
|
:config
|
|
|
|
(openwith-mode t)
|
|
|
|
(setq openwith-associations
|
|
|
|
'(("\\.\\(pdf\\|jpe?g\\|gif\\|docx?\\|pptx?\\|xlsx?\\|zip\\|tar\\(\\.gz\\)?\\|rar\\)$"
|
|
|
|
"xdg-open" (file)))))
|
2016-02-20 15:30:30 -05:00
|
|
|
|
2015-06-06 06:40:33 -04:00
|
|
|
(provide 'core-os-linux)
|
|
|
|
;;; core-os-linux.el ends here
|