summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@imladris.local>2017-06-14 02:21:28 +0200
committerJose Antonio Ortega Ruiz <jao@imladris.local>2017-06-14 02:21:28 +0200
commitfa0edc1a86584a6758d8b453ca77fd92340fced6 (patch)
tree1dee058c0b517cf76f3cc6105d7e28104c41eed7
parentec9adfba23a9dbfe1e617d7a002ea5c73f1ca82f (diff)
downloadelibs-fa0edc1a86584a6758d8b453ca77fd92340fced6.tar.gz
elibs-fa0edc1a86584a6758d8b453ca77fd92340fced6.tar.bz2
new jao-notify with libnotify
-rw-r--r--emms/jao-emms-info-track.el4
-rw-r--r--emms/jao-emms-random-album.el12
-rw-r--r--org/jao-org-links.el3
-rw-r--r--sys/jao-notify.el19
-rw-r--r--sys/jao-osd.el9
5 files changed, 38 insertions, 9 deletions
diff --git a/emms/jao-emms-info-track.el b/emms/jao-emms-info-track.el
index cf4163b..04f4784 100644
--- a/emms/jao-emms-info-track.el
+++ b/emms/jao-emms-info-track.el
@@ -1,6 +1,6 @@
;; jao-emms-info-track.el -- utilities to show tracks
-;; Copyright (C) 2009, 2010, 2013 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2009, 2010, 2013, 2017 Jose Antonio Ortega Ruiz
;; Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
;; Start date: Sat Jul 04, 2009 13:47
@@ -103,7 +103,7 @@
(defun jao-emms-show-osd ()
(interactive)
(let ((str (jao-emms-current-track-str)))
- (when str (jao-osd-cat 'emms (substring str 2)))
+ (when str (jao-notify (substring str 2)))
t))
(defun jao-emms-show-osd-hook ()
diff --git a/emms/jao-emms-random-album.el b/emms/jao-emms-random-album.el
index 04dcd89..b959e36 100644
--- a/emms/jao-emms-random-album.el
+++ b/emms/jao-emms-random-album.el
@@ -1,6 +1,6 @@
;; jao-emms-random-album.el -- play random albums in emms
-;; Copyright (C) 2009, 2010 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2009, 2010, 2017 Jose Antonio Ortega Ruiz
;; Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
;; Start date: Sat Jul 04, 2009 13:06
@@ -25,6 +25,8 @@
(defvar jao-emms-random-lines nil)
(defvar jao-emms-random-lines-file
(expand-file-name "~/.emacs.d/random-lines"))
+(defvar jao-emms-random-album-notify-p t)
+(defvar jao-emms-random-album-notify-icon nil)
(defun jao-emms-random-lines ()
(or jao-emms-random-lines
@@ -94,10 +96,10 @@
(emms-browse-by-album)
(jao-emms-goto-random-album)
(emms-browser-add-tracks-and-play)
- (jao-osd-cat 'emms
- (format "Next album %s"
- (substring-no-properties (thing-at-point 'line)
- 0 -1)))
+ (when jao-emms-random-album-notify-p
+ (jao-notify (substring-no-properties (thing-at-point 'line) 0 -1)
+ "Next album"
+ jao-emms-random-album-notify-icon))
(emms-browser-bury-buffer))))
(defun jao-emms-random-album-reset ()
diff --git a/org/jao-org-links.el b/org/jao-org-links.el
index 1ce7ab3..4f8d606 100644
--- a/org/jao-org-links.el
+++ b/org/jao-org-links.el
@@ -5,7 +5,7 @@
;; doc links
(defvar jao-org--sink-dir "./")
-(org-add-link-type "doc" 'jao-org-follow-doc 'identity)
+
(defun jao-org-follow-doc (link)
(let ((dest-path (concat "./doc/"
(and (boundp 'docs-dir)
@@ -34,6 +34,7 @@
(insert (format "[[doc:%s][%s]]" (jao-org--title->file title) title)))
(defun jao-org-links-setup (sink-dir)
+ (org-add-link-type "doc" 'jao-org-follow-doc 'identity)
(setq jao-org--sink-dir (file-name-as-directory sink-dir)))
(defun jao-org-insert-safari-link ()
diff --git a/sys/jao-notify.el b/sys/jao-notify.el
new file mode 100644
index 0000000..f505525
--- /dev/null
+++ b/sys/jao-notify.el
@@ -0,0 +1,19 @@
+;; jao-notify.el -- Interacting with notification daemon
+
+;; Copyright (c) 2017 Jose Antonio Ortega Ruiz
+
+;; Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
+;; Start date: Sun Jan 08, 2017 20:24
+
+
+;;; Comentary:
+
+;;
+
+;;; Code:
+
+
+
+
+(provide 'jao-notify)
+;;; jao-notify.el ends here
diff --git a/sys/jao-osd.el b/sys/jao-osd.el
index 0b2c433..260af44 100644
--- a/sys/jao-osd.el
+++ b/sys/jao-osd.el
@@ -2,6 +2,7 @@
(defvar jao-osd-cat-color-fg "black")
(defvar jao-osd-cat-color-bg "white")
(defvar jao-osd-cat-font "Andika Basic 16")
+;; (setq jao-osd-cat-font "Inconsolata 20")
(defun jao-osd-cat-font (&optional font)
(or font jao-osd-cat-font))
@@ -51,5 +52,11 @@
(maphash (lambda (n p) (ignore-errors (kill-process p))) jao-osd-processes)
(clrhash jao-osd-processes))
-(provide 'jao-osd)
+(defun jao-notify (msg &optional title icon)
+ (let ((args (if title (format "'%s' '%s'" msg title) (format "'%s'" msg)))
+ (iflag (if (and (stringp icon) (file-exists-p icon))
+ (format " -i %s" icon)
+ "")))
+ (shell-command-to-string (format "notify-send %s%s" args iflag))))
+(provide 'jao-osd)