[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] pop-up flashing box using org-timer?
From: |
Sharon Kimble |
Subject: |
[O] pop-up flashing box using org-timer? |
Date: |
Wed, 09 Dec 2015 13:32:54 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
I'm using org-timer via "C-c C-x ;" and setting it for 30 minutes for a
repetitive job that I'm doing. When it ends it has a small popup which
shows its ended but that soon disappears. Is it possible for it to show
a flashing popup that will show even if I'm not an org-mode buffer? Like
in the code block showing at the end?
I am using the following code for showing appointments that are, and
have just, occurred. Is it possible for this code be adapted to show a
similar popup that flashes like this does please?
Thanks
Sharon.
--8<---------------cut here---------------start------------->8---
#+BEGIN_SRC emacs-lisp
(appt-activate t)
;; 5 minute warning
(setq appt-message-warning-time '15)
(setq appt-display-interval '5)
#+END_SRC
[2014-11-14 Fri 11:43]
#+BEGIN_SRC emacs-lisp
(defun djcb-popup (title msg &optional icon sound)
;; http://emacs-fu.blogspot.co.uk/2009/11/showing-pop-ups.html
"Show a popup if we're on X, or echo it otherwise; TITLE is the title
of the message, MSG is the context. Optionally, you can provide an ICON and
a sound to be played"
(interactive)
(when sound (shell-command
(concat "mplayer -really-quiet " sound " 2> /dev/null")))
(if (eq window-system 'x)
(shell-command (concat "notify-send "
(if icon (concat "-i " icon) "")
" '" title "' '" msg "'"))
;; text only version
(message (concat title ": " msg))))
(djcb-popup "Warning" "The end is near"
"/usr/share/icons/test.png" "/usr/share/sounds/beep.ogg")
;; the appointment notification facility
(setq
appt-message-warning-time 15 ;; warn 15 min in advance
appt-display-mode-line t ;; show in the modeline
appt-display-format 'window) ;; use our func
(appt-activate 1) ;; active appt (appointment notification)
(display-time) ;; time display is required for this...
;; update appt each time agenda opened
(add-hook 'org-finalize-agenda-hook 'org-agenda-to-appt)
;; our little façade-function for djcb-popup
(defun djcb-appt-display (min-to-app new-time msg)
(djcb-popup (format "Appointment in %s minute(s)" min-to-app) msg
"/usr/share/icons/gnome/32x32/status/appointment-soon.png" ))
;; "/usr/share/sounds/ubuntu/stereo/phone-incoming-call.ogg"
(setq appt-disp-window-function (function djcb-appt-display))
;; you might also want to set:
(setq org-agenda-skip-unavailable-files t)
;; so these warnings won't annoy the little remember-frame
;; also: I have noted infrequent problems when using ElScreen
;; (the wrong frame might be chosen for Remember in about 10% of the cases)
#+END_SRC
[2014-11-14 Fri 12:07]
#+BEGIN_SRC emacs-lisp
(defun my-appt-disp-window (min-to-app new-time msg)
(save-window-excursion (async-shell-command
(concat "/usr/bin/zenity --info --title='Appointment' --text='" msg "'")
nil nil)))
#+END_SRC
[2014-11-14 Fri 11:44]
--8<---------------cut here---------------end--------------->8---
--
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
Debian 8.0, fluxbox 1.3.7, emacs 24.5.1
signature.asc
Description: PGP signature
- [O] pop-up flashing box using org-timer?,
Sharon Kimble <=