From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CBM3A73spmKIhwAAbAwnHQ (envelope-from ) for ; Mon, 13 Jun 2022 09:52:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id wJL6Ar3spmJj5wAAauVa8A (envelope-from ) for ; Mon, 13 Jun 2022 09:52:29 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AB0F2A129 for ; Mon, 13 Jun 2022 09:52:28 +0200 (CEST) Received: from localhost ([::1]:60158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o0es7-0001X4-Er for larch@yhetil.org; Mon, 13 Jun 2022 03:52:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0emp-0000wm-Qj for emacs-orgmode@gnu.org; Mon, 13 Jun 2022 03:47:03 -0400 Received: from ciao.gmane.io ([116.202.254.214]:45308) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0eme-0001jN-MO for emacs-orgmode@gnu.org; Mon, 13 Jun 2022 03:46:57 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1o0emc-0000w0-Hu for emacs-orgmode@gnu.org; Mon, 13 Jun 2022 09:46:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: idea for capture anywhere in x Date: Mon, 13 Jun 2022 14:46:37 +0700 Message-ID: References: <87sgbsq2t5.fsf@gmail.com> <87tuw31iub.fsf@mm.st> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 28 X-Spam_score: 2.8 X-Spam_bar: ++ X-Spam_report: (2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1655106748; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=dn8NogIUCQ1ETV9xhoxB9SwACmreCdCuiRmTbRWFOYI=; b=fQbS6lO6Z0OUxop6Gh9YhmfXP0gOktiIBVz/++TuOySPsqUZOlhgBbBbi4VI49q8vtc5XZ nkn1eC1CDu0QvUoHqrI2LuCv62YyPr0psSx1RpmfX5WGBFKxsTiNNFTGpaw5xHsU/1h+53 XK2yEpH7xtKJdbqglkf54/Mw70EB+erObFDFy2cjWKAtrOt+Q4Aj8oPYBeClGglHUjAYW0 frw59d9HUozOpJ6RRzk14kzKIUyftndAJ/4085ecfXq4X3aPqaY+6tMno+rkdWkY+PRsm7 Z9ob9jJeAlWAEK5bNOjyhFt+Jb1Q8mzqysC8vDrZdS05B7b28wAzv32mBcq+Qg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655106748; a=rsa-sha256; cv=none; b=s7xH77cJFelc/6aiiOG/wlLgKjAH/nQFaWe1G/2SzTfkgrJddW2cTWhb8SXEimFIjS4Fha LPwevGcpx+NlkTGvv2xuM3VBsqF5u4BXKFc+kiVQNEDbLo5K4tMJshxOW8YTYOE1VQx8jN iddq3u0h/lJ0naHolDe7o1hs3JGhijXeBLXiqDm8EFGPn4GODrDnApDl/sXw+2niFptn0Y EGwsuYR6m9bVwwzrhCe9wVSr7BsLJzVcd0p586yknibSh+C4RuAhhiXZYi5S689zODec3a MT8vK+MfYMDIWhqYgyZ0wvXHKDwU/ac5c3mkdYoB+jQKeaE+3x4cws3QFntk9Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 2.41 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: AB0F2A129 X-Spam-Score: 2.41 X-Migadu-Scanner: scn0.migadu.com X-TUID: BuZqRqyn/W0U On 10/06/2022 09:35, Samuel Wales wrote: > with the org capture firefox extension broken, i recalled this old > thread, thinking it might be a fix, and i think i understand the > issue. so i thought i would summarize here in this one post. Samuel, have you managed to fix org-protocol setup? From other messages I am almost sure that the issue is not with the firefox add-on. Anyway in this thread people suggested to use `org-capture' directly, so it may be a workaround for a while emacsclient --eval '(org-capture nil "c")' You can add such command to your fluxbox menu. I have the following template: ("c" "Clipboard" entry (file "") "* %?%(org-get-x-clipboard 'CLIPBOARD) " :empty-lines 1) I do not remember why "%c" and "%x" substitutions did not work for me, perhaps too old org system package. 'PRIMARY should be even more convenient. > otoh, if there is such a thing as "a cli command that will ask firefox > for its current url" then it is possible. It was you who found https://github.com/bitspook/spookfox I never tried it, but I do not see any way to fetch something from firefox besides this kind of extensions (KDE plasma integration or https://github.com/osnr/TabFS). You can copy URL to clipboard, just select text and obtain both PRIMARY and CLIPBOARD from an org-capture template. An idea for any application accordingly to the subject. It is possible to obtain window title, something like xdotool getactivewindow getwindowname (untested), or more low level xprop -id "$( xprop -root -f _NET_ACTIVE_WINDOW 0x '=$0' _NET_ACTIVE_WINDOW | cut -f 2- -d = )" -f _NET_WM_NAME 8s '=$0' _NET_WM_NAME | cut -f 2- -d = Finally a bonus for those who read mails till the end of the message. I have figured out how to get org markup from selection in firefox, libreoffice writer, etc. Unsure if such approach has some security issues, I never tried to evaluate to which degree pandoc is safe. It can be called from emacs to insert output into the current buffer or "| xclip -in" may be appended to replace selection buffer. More accurate script can check "xclip -out -target TARGETS" for presence of "text/html" string #!/bin/bash set -o pipefail selection=primary xclip -selection "$selection" -out -target text/html 2>/dev/null | pandoc --from=html --to=org - || xclip -selection "$selection" -out