From d726fc6bce480c1a87751c70e31991a0c11c6847 Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 3 Jun 2022 21:51:01 +0100 Subject: better opening of zathura docs in xmonad --- init.org | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'init.org') diff --git a/init.org b/init.org index e94491d..6535bf7 100644 --- a/init.org +++ b/init.org @@ -1892,7 +1892,7 @@ (file (jao-org-pdf-to-org-file (car info))) (page (cadr info)) (pageno (or (car (last info)) page))) - (jao-afio--goto-docs) + (ignore-errors (jao-afio--goto-docs)) (let* ((exists (file-exists-p file)) (fn (file-name-nondirectory file)) (lnk (format "[[doc:%s::%d][Page %s]]" fn page pageno))) @@ -1907,7 +1907,10 @@ (let ((id (jao-shell-string (format "xdotool search --name %s" (file-name-nondirectory file))))) (if (string-blank-p id) - (jao-shell-exec (format "zathura %s -P %s" file (or page 1))) + (progn + (when jao-xmonad-enabled + (jao-shell-exec "xdotool set_destktop 2")) + (jao-shell-exec (format "zathura %s -P %s" file (or page 1)))) (let* ((page (if page (format " && xdotool type %dg" page) "")) (cmd (format "xdotool windowactivate %s%s" id page))) (jao-shell-string cmd))))) -- cgit v1.2.3