emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Sharon Kimble <boudiccas@skimble.plus.com>
To: org-mode-email <emacs-orgmode@gnu.org>
Subject: pop-up flashing box using org-timer?
Date: Wed, 09 Dec 2015 13:32:54 +0000	[thread overview]
Message-ID: <878u53px15.fsf@skimble.plus.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3203 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

             reply	other threads:[~2015-12-09 13:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-09 13:32 Sharon Kimble [this message]
2015-12-09 16:20 ` pop-up flashing box using org-timer? Nick Dokos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878u53px15.fsf@skimble.plus.com \
    --to=boudiccas@skimble.plus.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).