summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-08-29 04:54:01 +0100
committerjao <jao@gnu.org>2022-08-29 04:54:01 +0100
commit7064d9fb37614d8aeca097a829868d4024d517c1 (patch)
tree3d4d24c2d076ee198eef3c4966cf3422786b2a61
parent74785f0a4076ebdc65417727f764ff3ee6ce6355 (diff)
downloadelibs-7064d9fb37614d8aeca097a829868d4024d517c1.tar.gz
elibs-7064d9fb37614d8aeca097a829868d4024d517c1.tar.bz2
zathura: don't specify a page if none is given
-rw-r--r--init.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/init.el b/init.el
index a925623..95a484b 100644
--- a/init.el
+++ b/init.el
@@ -474,14 +474,18 @@
(defun jao-sway-send (txt) (jao-shell-string "wtype" txt))
(defun jao-zathura--open-cmd (file page &optional suffix)
- (format "zathura %s -P %s%s" file (or page 1) (or suffix "")))
+ (let ((page (if page (format "-P %s" page) "")))
+ (format "zathura %s %s %s" file page (or suffix ""))))
(defun jao-sway-open-with-zathura (file page)
(let* ((a (jao-zathura--open-cmd file page ""))
(n (file-name-nondirectory file))
- (c (format "swaymsg [title=\"%s\"] focus || %s" n a)))
+ (f (format "swaymsg -r [title=\"%s\"] focus" n))
+ (c (format "%s || %s" f a)))
(jao-shell-exec c)
- (when page (jao-sway-send (format "%dg" page)))))
+ (sit-for 0.2)
+ (jao-shell-exec f)
+ (when page (sit-for 0.2) (jao-sway-send (format "%dg" page)))))
(defun jao-sway-set-wallpaper (f)
(jao-swaymsg (format "output * bg %s fill" f))