From 27d65f50b9709ab2e2e91e6ff2e8cd9e792cd574 Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 4 Sep 2022 03:30:20 +0100 Subject: jao-river-enable --- init.el | 28 ++++++++++++++++------------ lib/eos/jao-tracking.el | 2 -- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/init.el b/init.el index 464dfd3..98dc82a 100644 --- a/init.el +++ b/init.el @@ -251,13 +251,11 @@ (pdf-view-mode "application/pdf" (display-graphic-p)) ("zathura \"%s\"" "application/pdf") (image-mode "image/*" (display-graphic-p)) - (,(concat "riverctl toggle-focused-tags 64" - " && riverctl focus-view next" - " && qutebrowser \"%s\"") - "text/html" (and jao-wayland-enabled (not (display-graphic-p)))) - ("swayimg \"%s\"" "image/*" jao-sway-enabled) + ("firefox %s && riverctl set-focused-tags 2" "text/html" jao-river-enabled) + ("swayimg \"%s\"" "image/*": jao-sway-enabled) ("imv-wayland \"%s\"" "image/*" jao-wayland-enabled) - ("imv-x11 \"%s\"" "image/*" (display-graphic-p)))))) + ("imv-x11 \"%s\"" "image/*"))))) + ;;; Crypto ;;;; PGP, EPG, passwords (setq auth-source-debug nil) @@ -466,9 +464,6 @@ (jao-trisect) (message "Welcome to wayland")) -(when jao-wayland-enabled - (add-hook 'after-init-hook #'jao-wayland-enable)) - (defsubst jao-wayland-type (&rest args) (apply #'jao-shell-exec* t "wtype" args)) @@ -501,9 +496,6 @@ (defun jao-river-zathura-to-org () (let ((title (jao-river-get-focused-title))) - (when (string-match-p "\\.pdf" title) - (message "%s" title) - (jao-notify title "Opening ORG counterpart")) (jao-river-to-ws 1) (jao-pdf-goto-zathura-org title t))) @@ -532,6 +524,15 @@ (sit-for 0.2) (jao-tracking-set-log "")) +(defun jao-river-enable () + (jao-wayland-enable) + (when (jao-shell-running-p "i3bar-river") + (jao-tracking-set-log "")) + (message "Welcome to river")) + +(when jao-river-enabled + (add-hook 'after-init-hook #'jao-river-enable)) + ;;;; sway (defmacro jao-def-swaymsg (name msg) `(defun ,(intern (format "jao-sway-%s" name)) () @@ -572,6 +573,9 @@ (interactive) (jao-sway-run-or-focus "firefox")) +(when jao-sway-enabled + (add-hook 'after-init-hook #'jao-wayland-enable)) + ;;;; wallpaper (defvar jao-wallpaper-dir "~/.wallpapers/") diff --git a/lib/eos/jao-tracking.el b/lib/eos/jao-tracking.el index 23bd099..5fca653 100644 --- a/lib/eos/jao-tracking.el +++ b/lib/eos/jao-tracking.el @@ -101,8 +101,6 @@ (cmd (format "wmctrl -r emacs -b %s,demands_attention" action))) (shell-command-to-string cmd)))) -(jao-tracking-set-log "") - (defun jao-tracking--buffer-str (s) (if (listp s) `(:propertize ,(plist-get s :propertize) -- cgit v1.2.3