mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-11-25 00:38:23 -05:00
emacs: add ddgr integration
This commit is contained in:
parent
fd3511d513
commit
67296cf1f1
@ -62,7 +62,7 @@
|
|||||||
(add-hook 'exwm-update-title-hook #'follie/exwm-rename-buffer)
|
(add-hook 'exwm-update-title-hook #'follie/exwm-rename-buffer)
|
||||||
|
|
||||||
;; Force tiling by default
|
;; Force tiling by default
|
||||||
(setq exwm-manage-force-tiling nil)
|
;;(setq exwm-manage-force-tiling t)
|
||||||
;; Window rules
|
;; Window rules
|
||||||
(add-hook 'exwm-manage-finish-hook #'follie/configure-window-by-class)
|
(add-hook 'exwm-manage-finish-hook #'follie/configure-window-by-class)
|
||||||
|
|
||||||
@ -112,11 +112,16 @@
|
|||||||
;; Reset to line-mode (C-c C-k switches to char-mode via exwm-input-release-keyboard)
|
;; Reset to line-mode (C-c C-k switches to char-mode via exwm-input-release-keyboard)
|
||||||
([?\s-r] . exwm-reset)
|
([?\s-r] . exwm-reset)
|
||||||
|
|
||||||
;; Move between windows
|
;; Move between windows with arrow keys
|
||||||
([s-left] . windmove-left)
|
([s-left] . windmove-left)
|
||||||
([s-right] . windmove-right)
|
([s-right] . windmove-right)
|
||||||
([s-up] . windmove-up)
|
([s-up] . windmove-up)
|
||||||
([s-down] . windmove-down)
|
([s-down] . windmove-down)
|
||||||
|
;; or with vim keys
|
||||||
|
([?\s-h] . windmove-left)
|
||||||
|
([?\s-l] . windmove-right)
|
||||||
|
([?\s-k] . windmove-up)
|
||||||
|
([?\s-j] . windmove-down)
|
||||||
|
|
||||||
;; Launch applications via shell command
|
;; Launch applications via shell command
|
||||||
([?\s-&] . (lambda (command)
|
([?\s-&] . (lambda (command)
|
||||||
@ -135,6 +140,8 @@
|
|||||||
(exwm-workspace-switch-create ,i))))
|
(exwm-workspace-switch-create ,i))))
|
||||||
(number-sequence 0 9))))
|
(number-sequence 0 9))))
|
||||||
(exwm-input-set-key (kbd "s-SPC") 'counsel-linux-app)
|
(exwm-input-set-key (kbd "s-SPC") 'counsel-linux-app)
|
||||||
|
(exwm-input-set-key (kbd "s-t") 'exwm-floating-toggle-floating)
|
||||||
|
(exwm-input-set-key (kbd "s-f") 'exwm-layout-toggle-fullscreen)
|
||||||
|
|
||||||
;; Enable EXWM
|
;; Enable EXWM
|
||||||
(exwm-enable)
|
(exwm-enable)
|
||||||
@ -143,7 +150,7 @@
|
|||||||
(exwm-config-ido)
|
(exwm-config-ido)
|
||||||
(ido-mode nil))
|
(ido-mode nil))
|
||||||
|
|
||||||
;; Edit everthing in X windows with Emacs
|
;; Edit everything in X windows with Emacs
|
||||||
(use-package! exwm-edit
|
(use-package! exwm-edit
|
||||||
:after exwm
|
:after exwm
|
||||||
:config
|
:config
|
||||||
@ -207,7 +214,15 @@
|
|||||||
;; Function keys
|
;; Function keys
|
||||||
(use-package! desktop-environment
|
(use-package! desktop-environment
|
||||||
:after exwm
|
:after exwm
|
||||||
:config (desktop-environment-mode)
|
:diminish desktop-environment-mode
|
||||||
|
:config
|
||||||
|
;; Give me back Super+l
|
||||||
|
(progn
|
||||||
|
(setf
|
||||||
|
(alist-get (elt (kbd "s-l") 0) desktop-environment-mode-map nil t)
|
||||||
|
nil)
|
||||||
|
(desktop-environment-mode))
|
||||||
|
(exwm-input-set-key (kbd "s-x") #'desktop-environment-lock-screen)
|
||||||
:custom
|
:custom
|
||||||
;; Brightness
|
;; Brightness
|
||||||
(desktop-environment-brightness-get-command "brightnessctl")
|
(desktop-environment-brightness-get-command "brightnessctl")
|
||||||
@ -245,3 +260,19 @@
|
|||||||
(defun follie/toggle-desktop-notifications ()
|
(defun follie/toggle-desktop-notifications ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(start-process-shell-command "notify-send" nil "notify-send \"DUNST_COMMAND_TOGGLE\""))
|
(start-process-shell-command "notify-send" nil "notify-send \"DUNST_COMMAND_TOGGLE\""))
|
||||||
|
|
||||||
|
;; DuckDuckGo
|
||||||
|
(defun ddgr ()
|
||||||
|
"Duck the web inside Emacs with ddgr"
|
||||||
|
(interactive)
|
||||||
|
(let* ((query (read-from-minibuffer "Search query: "))
|
||||||
|
(results (shell-command-to-string (concat "ddgr -x --np --noua -C " query)))
|
||||||
|
(buffer "*DuckDuckGo*"))
|
||||||
|
(when (get-buffer buffer)
|
||||||
|
(kill-buffer buffer))
|
||||||
|
(with-current-buffer (generate-new-buffer buffer)
|
||||||
|
(insert "** Search results:\n\n")
|
||||||
|
(insert results))
|
||||||
|
(switch-to-buffer buffer)
|
||||||
|
(org-mode)
|
||||||
|
(evil-goto-first-line)))
|
||||||
|
Loading…
Reference in New Issue
Block a user