emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* trigger org-capture window using linux shortcut key
@ 2013-05-22  6:38 jackin
  0 siblings, 0 replies; 5+ messages in thread
From: jackin @ 2013-05-22  6:38 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

      I am wondering if it is possible to start a org-capture window
(when not within emacs) using a shortcut key. Org-protocol allows this
to be done from a web browser or adobe reader which is very useful. But
I am thinking of a more general solution, for triggering a org-capture
window from any where in Linux -> type in something and -> C-c c-c.

     Any ideas or solutions? Thanks in advance.

-jackin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Trigger org-capture window using linux shortcut key
@ 2013-05-22  6:40 Jackin
  2013-05-22  7:10 ` Michael Strey
  2013-05-22 22:00 ` Matt Lundin
  0 siblings, 2 replies; 5+ messages in thread
From: Jackin @ 2013-05-22  6:40 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

      I am wondering if it is possible to start a org-capture window
(when not within emacs) using a shortcut key. Org-protocol allows this
to be done from a web browser or adobe reader which is very useful. But
I am thinking of a more general solution, for triggering a org-capture
window from any where in Linux -> type in something and -> C-c c-c.

     Any ideas or solutions? Thanks in advance.

-jackin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Trigger org-capture window using linux shortcut key
  2013-05-22  6:40 Trigger " Jackin
@ 2013-05-22  7:10 ` Michael Strey
  2013-05-22 22:00 ` Matt Lundin
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Strey @ 2013-05-22  7:10 UTC (permalink / raw)
  To: emacs-orgmode

Hi Jackin,

On Wed, May 22, 2013 at 06:40:39AM +0000, Jackin wrote:
>       I am wondering if it is possible to start a org-capture window
> (when not within emacs) using a shortcut key. Org-protocol allows this
> to be done from a web browser or adobe reader which is very useful. But
> I am thinking of a more general solution, for triggering a org-capture
> window from any where in Linux -> type in something and -> C-c c-c.
> 
>      Any ideas or solutions? Thanks in advance.

I've implemented this behaviour for my Xmonad desktop.  The solution
consists of two parts

1. The configuration of a shortcut calling a shell script in the Xmonad
configuration file .xmonad/xmonad.hs


2. A shell script simulating the keystrokes to change to the virtual
desktop were my Emacs lives and calling org-capture.

#+BEGIN_SRC shell
#!/bin/sh

xdotool key Super+m 7
emacsclient -e '(org-capture)'
#xdotool key Super+0
#+END_SRC

-- 
Michael Strey 
www.strey.biz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Trigger org-capture window using linux shortcut key
  2013-05-22  6:40 Trigger " Jackin
  2013-05-22  7:10 ` Michael Strey
@ 2013-05-22 22:00 ` Matt Lundin
  2013-06-12 11:49   ` jackin
  1 sibling, 1 reply; 5+ messages in thread
From: Matt Lundin @ 2013-05-22 22:00 UTC (permalink / raw)
  To: Jackin; +Cc: emacs-orgmode

Jackin <jackin@opt.utsunomiya-u.ac.jp> writes:

>       I am wondering if it is possible to start a org-capture window
> (when not within emacs) using a shortcut key. Org-protocol allows this
> to be done from a web browser or adobe reader which is very useful. But
> I am thinking of a more general solution, for triggering a org-capture
> window from any where in Linux -> type in something and -> C-c c-c.
>
>      Any ideas or solutions? Thanks in advance.

The answer will likely depend on which desktop or window manager you
use. I have the following in my openbox rc.xml:

    <keybind key="W-r">
      <action name="Execute">
        <execute>emacsclient -c -e "(org-capture)"</execute>
      </action>
    </keybind>

Gnome and KDE will likely have a GUI for adding custom keyboard
shortcuts.

Best,
Matt

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Trigger org-capture window using linux shortcut key
  2013-05-22 22:00 ` Matt Lundin
@ 2013-06-12 11:49   ` jackin
  0 siblings, 0 replies; 5+ messages in thread
From: jackin @ 2013-06-12 11:49 UTC (permalink / raw)
  To: Matt Lundin, Michael Strey; +Cc: emacs-orgmode

Sincere thanks for your reply . I got it to work on my Debian machine as
follows.

Ref: http://comments.gmane.org/gmane.emacs.orgmode/33650

1) I appended these lines to my ~/.emacs file

(defadvice org-capture-finalize (after delete-capture-frame activate)
  "Advise capture-finalize to close the frame if it is the capture
frame"
  (if (equal "capture" (frame-parameter nil 'name))
      (delete-frame)))

(defadvice org-capture-destroy (after delete-capture-frame activate)
  "Advise capture-destroy to close the frame if it is the capture frame"
  (if (equal "capture" (frame-parameter nil 'name))
      (delete-frame)))

(defun make-capture-frame ()
  "Create a new frame and run org-capture."
  (interactive)
  (make-frame '((name . "capture")))
  (select-frame-by-name "capture")
  (delete-other-windows)
  (org-capture)
  )


2) On the debian machine - 
System -> Preferences -> Keyboard Shortcuts -> Add ->
Command : /usr/bin/emacsclient -n -e '(make-capture-frame)'
Shortcut : Ctrl+Alt+C (or any of your favorite key combination)

That's it! Works like a charm for me and now I can capture anything that
flashes across my mind in a fraction of seconds, not disturbing my
original work flow on the PC.


regards,
Jackin



On Wed, 2013-05-22 at 17:00 -0500, Matt Lundin wrote:
> Jackin <jackin@opt.utsunomiya-u.ac.jp> writes:
> 
> >       I am wondering if it is possible to start a org-capture window
> > (when not within emacs) using a shortcut key. Org-protocol allows this
> > to be done from a web browser or adobe reader which is very useful. But
> > I am thinking of a more general solution, for triggering a org-capture
> > window from any where in Linux -> type in something and -> C-c c-c.
> >
> >      Any ideas or solutions? Thanks in advance.
> 
> The answer will likely depend on which desktop or window manager you
> use. I have the following in my openbox rc.xml:
> 
>     <keybind key="W-r">
>       <action name="Execute">
>         <execute>emacsclient -c -e "(org-capture)"</execute>
>       </action>
>     </keybind>
> 
> Gnome and KDE will likely have a GUI for adding custom keyboard
> shortcuts.
> 
> Best,
> Matt
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-06-12 11:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-22  6:38 trigger org-capture window using linux shortcut key jackin
  -- strict thread matches above, loose matches on Subject: below --
2013-05-22  6:40 Trigger " Jackin
2013-05-22  7:10 ` Michael Strey
2013-05-22 22:00 ` Matt Lundin
2013-06-12 11:49   ` jackin

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).