From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.help Subject: Re: Screenshots, frame shots straight from Emacs Date: Sat, 31 Jul 2021 23:59:19 -0300 Message-ID: References: <87sg1dgbbk.fsf@omarpolo.com> <87pmwhg843.fsf@omarpolo.com> <8735t96mxj.fsf@omarpolo.com> <87pmw961ox.fsf@zoho.eu> <874kcpxln9.fsf@logand.com> <87pmvcdgqg.fsf@t14.reltub.ca> <87a6mgwz17.fsf@logand.com> <87fsw8butp.fsf@t14.reltub.ca> <878s20d81n.fsf@logand.com> <87wnp62hhe.fsf@logand.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33808"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs , Leo Butler To: Tomas Hlavaty Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 01 05:00:13 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mA1hy-0008UO-TJ for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 01 Aug 2021 05:00:10 +0200 Original-Received: from localhost ([::1]:37846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mA1hx-0006sp-EM for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 31 Jul 2021 23:00:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mA1hP-0006sf-E8 for help-gnu-emacs@gnu.org; Sat, 31 Jul 2021 22:59:35 -0400 Original-Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:34672) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mA1hN-0002Xm-OB for help-gnu-emacs@gnu.org; Sat, 31 Jul 2021 22:59:35 -0400 Original-Received: by mail-pj1-x1032.google.com with SMTP id b1-20020a17090a8001b029017700de3903so15656548pjn.1 for ; Sat, 31 Jul 2021 19:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Kb2EmHUV0jIkE5j/JSbAnkDxLJPN+qf3bcRFplQzCYE=; b=Y3NdGUy2frao9XQ/Tbpwx696n8/Otl/zODkafJPfIWDHu/Z6ZubKB5mdKQkZoePL24 l+TDfHk+tbPv0YEFQuj9vRD4FxNhRTJahOpZ1q/ss9uyvp/VDzRQdf4gN5UBX/JBvHHT lSb8tWG+jtj9fUWYDmQWQwmBX2JWrntj7b8nDWbo+PFpitCxl295oi0fjFhzxRIyKjAB U24dGrgr4ofVFFzJGF7UmtA5eA8isTPozCnRRlanXUlSJ1IM0+efKLWcpGzk4o//bn24 TaJOimdVJ2Z64SqAr5t4KUd3RdHXEZyrEsoyx21gVrOm1Hs3TflnOM5mRZv1quZFun/O bvUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Kb2EmHUV0jIkE5j/JSbAnkDxLJPN+qf3bcRFplQzCYE=; b=s/Jo+UMILJx2vF7iDaOmO5/SJyxg4gRQJe/9YsKSU9WJYeaoOmorKYyIL850dmoTxU 2ED9BA7RmuZKuh8aWjaxN8M4W+EFGjw2uGcg8J4Baciyu/sf+IVU1unkq1LLbpzyvi+1 /r9R0VF2xpD6zEpLm6fUn0vTz04qJgor9MofrX+F2UkmF05+JH+p1z1L4SSRs2fQ6VMU eL9MsH5SjmrhSeLQjF8Y6riSXrqhDhWebxUraWVqeSzDzAXMKVnF/EjRxIOKLw4PVcTi Yzp+aJYB0Ssp9YSp2pFItf+e+1lFEUTf+24XFP+wk5OWr7+UFkUmx0RhHqUv9AVkgrU7 hC5A== X-Gm-Message-State: AOAM530luta9qFYg9lOQ1dLAbGVMEBULIfgljY3g0l/Sj7C0SAS4ocR2 0axDtwBD1cmaO5Pg7xgzEC2YI1gu/DRvS10Y94Q= X-Google-Smtp-Source: ABdhPJyAei+mN8l6umUE3oKE5hjA5Qe5Y4RrSunlwh84DV5cwCpLy1ulvRHTvTUVG2L1vdnzwMW/cd7OvOQnq/0Ilf0= X-Received: by 2002:aa7:9522:0:b029:39d:55c9:734b with SMTP id c2-20020aa795220000b029039d55c9734bmr10228411pfp.31.1627786771423; Sat, 31 Jul 2021 19:59:31 -0700 (PDT) In-Reply-To: <87wnp62hhe.fsf@logand.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=eduardoochs@gmail.com; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:132243 Archived-At: By the way, here is what I use to take screenshots... This is a "5-minute hack" built on top of eev, following the style that I explained here: http://angg.twu.net/emacsconf2020.html http://angg.twu.net/.emacs.videos.html#eev2020 Here is its only defun (and a defalias): ;; Skel: (find-find-links-links-new "sshot" "nsecs" "") ;; Test: (find-sshot-links) ;; (defun find-sshot-links (&optional nsecs &rest pos-spec-list) "Visit a temporary buffer containing hyperlinks taking a screenshot." (interactive) (setq nsecs (or nsecs "5")) (setq nsecs (or nsecs "{nsecs}")) (apply 'find-elinks `((find-sshot-links ,nsecs ,@pos-spec-list) (find-sshot-links "{nsecs}") ;; Convention: the first sexp always regenerates the buffer. (find-efunction 'find-sshot-links) "" ,(ee-template0 "\ \(eev \"sleep {nsecs} && scrot --select /tmp/sshot.png\") \(find-bgprocess '(\"sh\" \"-c\" \"sleep {nsecs} && scrot --select /tmp/sshot.png\")) \(find-bgprocess '(\"sh\" \"-c\" \"sleep {nsecs} && scrot --border --select /tmp/sshot.png\")) \(find-bgprocess \"xzgv /tmp/sshot.png\") \(find-bgprocess \"gimp /tmp/sshot.png\") \(find-fline \"/tmp/\" \"sshot.png\") \(find-fline \"/tmp/sshot.png\") \(imgbb-upload \"/tmp/sshot.png\") ") ) pos-spec-list)) (defalias 'sshot 'find-sshot-links) To take a screenshot I type M-x sshot, and I then get a temporary buffer containing this: # (find-sshot-links "5") # (find-sshot-links "{nsecs}") # (find-efunction 'find-sshot-links) (eev "sleep 5 && scrot --select /tmp/sshot.png") (find-bgprocess '("sh" "-c" "sleep 5 && scrot --select /tmp/sshot.png")) (find-bgprocess '("sh" "-c" "sleep 5 && scrot --border --select /tmp/sshot.png")) (find-bgprocess "xzgv /tmp/sshot.png") (find-bgprocess "gimp /tmp/sshot.png") (find-fline "/tmp/" "sshot.png") (find-fline "/tmp/sshot.png") (xz "/tmp/sshot.png") (imgbb-upload "/tmp/sshot.png") The `find-bgprocess'es run scrot after a delay of 5 seconds... so I have 5 seconds after executing the `find-bgprocess' to put the right window (emacs-y or not) in the foreground, and then click on it in the way that scrot or scrot --border expects. I need to adapt that to include lines that run the other programs that were suggested in this thread, but I was too busy in these last weeks... =( Cheers, Eduardo Ochs http://angg.twu.net/#eev