diff options
author | jao <jao@gnu.org> | 2022-08-29 04:54:01 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-08-29 04:54:01 +0100 |
commit | 7064d9fb37614d8aeca097a829868d4024d517c1 (patch) | |
tree | 3d4d24c2d076ee198eef3c4966cf3422786b2a61 | |
parent | 74785f0a4076ebdc65417727f764ff3ee6ce6355 (diff) | |
download | elibs-7064d9fb37614d8aeca097a829868d4024d517c1.tar.gz elibs-7064d9fb37614d8aeca097a829868d4024d517c1.tar.bz2 |
zathura: don't specify a page if none is given
-rw-r--r-- | init.el | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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)) |