all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#58179] A small script to switch between browser tabs.
@ 2022-09-29 19:48 Nicolas Graves via Guix-patches via
  2022-09-29 19:52 ` [bug#58179] [PATCH 1/4] gnu: Add node-ws Nicolas Graves via Guix-patches via
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2022-09-29 19:48 UTC (permalink / raw)
  To: 58179


Hi!

4 patches to send a small rofi script to switch between chromium-based
browser tabs.

There are node packages in it and i didn't take care of packaging all
development dependencies (node bootstrapping).

The script should also work in firefox based browsers soon.

-- 
Best regards,
Nicolas Graves




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

* [bug#58179] [PATCH 1/4] gnu: Add node-ws.
  2022-09-29 19:48 [bug#58179] A small script to switch between browser tabs Nicolas Graves via Guix-patches via
@ 2022-09-29 19:52 ` Nicolas Graves via Guix-patches via
  2022-09-29 19:52   ` [bug#58179] [PATCH 2/4] gnu: Add node-commander Nicolas Graves via Guix-patches via
                     ` (2 more replies)
  2022-10-02 19:16 ` [bug#58179] [PATCH] gnu: Add rofi-switch-browser-tabs Nicolas Graves via Guix-patches via
  2022-10-02 19:22 ` Nicolas Graves via Guix-patches via
  2 siblings, 3 replies; 7+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2022-09-29 19:52 UTC (permalink / raw)
  To: 58179; +Cc: ngraves

* gnu/packages/node-xyz.scm (node-ws): New variable.
---
 gnu/packages/node-xyz.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm
index b14b407e19..4c92e07537 100644
--- a/gnu/packages/node-xyz.scm
+++ b/gnu/packages/node-xyz.scm
@@ -1512,6 +1512,35 @@ (define-public node-serialport
 projects.  It combines a high-level Node.js stream interface with a useful
 default set of parsers and bindings.")))
 
+(define-public node-ws
+  (package
+    (name "node-ws")
+    (version "8.8.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/websockets/ws")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1nwig6rxakd72nr1sbcl7qqwab3w5116s7dcblnz45fslf9lql8i"))))
+    (build-system node-build-system)
+    (arguments
+     '(#:tests? #f
+       #:phases (modify-phases %standard-phases
+                  (replace 'configure
+                    (lambda _
+                      (invoke "npm" "--offline" "--ignore-scripts" "install"
+                              "--production"))))))
+    (home-page "https://github.com/websockets/ws")
+    (synopsis "Websocket client and server for Node.js")
+    (description "This package provides a simple websocket client and server
+for Node.js.  It doesn't work in a browser.  It can send and receive data,
+authenticate clients, broadwast to other websocket clients, use external
+APIs...")
+    (license license:expat)))
+
 (define-public node-yazl
   (package
     (name "node-yazl")
-- 
2.37.3





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

* [bug#58179] [PATCH 2/4] gnu: Add node-commander.
  2022-09-29 19:52 ` [bug#58179] [PATCH 1/4] gnu: Add node-ws Nicolas Graves via Guix-patches via
@ 2022-09-29 19:52   ` Nicolas Graves via Guix-patches via
  2022-09-29 19:52   ` [bug#58179] [PATCH 3/4] gnu: Add node-chrome-remote-interface Nicolas Graves via Guix-patches via
  2022-09-29 19:52   ` [bug#58179] [PATCH 4/4] gnu: Add rofi-switch-browser-tabs/chromium Nicolas Graves via Guix-patches via
  2 siblings, 0 replies; 7+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2022-09-29 19:52 UTC (permalink / raw)
  To: 58179; +Cc: ngraves

* gnu/packages/node-xyz.scm (node-commander): New variable.
---
 gnu/packages/node-xyz.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm
index 4c92e07537..c14ff7f421 100644
--- a/gnu/packages/node-xyz.scm
+++ b/gnu/packages/node-xyz.scm
@@ -106,6 +106,34 @@ (define-public node-color-name
      "This package provides a JSON list with color names and their values.")
     (license license:expat)))
 
+(define-public node-commander
+  (package
+    (name "node-commander")
+    (version "9.3.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/tj/commander.js")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1yvm0qjirxxdrf7dng0h770n8abz83ymzv4r0wa8ww5x2l2xzsvz"))))
+    (build-system node-build-system)
+    (arguments
+     '(#:tests? #f
+       #:phases (modify-phases %standard-phases
+                  (replace 'configure
+                    (lambda _
+                      (invoke "npm" "--offline" "--ignore-scripts" "install"
+                              "--production"))))))
+    (home-page "https://github.com/tj/commander.js")
+    (synopsis "Complete solution for Node.js command-line interfaces")
+    (description "This package can parse arguments into options and
+command-arguments, disaply usage errors for problems, and implements a help
+system.")
+    (license license:expat)))
+
 (define-public node-crx3
   (package
     (name "node-crx3")
-- 
2.37.3





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

* [bug#58179] [PATCH 3/4] gnu: Add node-chrome-remote-interface.
  2022-09-29 19:52 ` [bug#58179] [PATCH 1/4] gnu: Add node-ws Nicolas Graves via Guix-patches via
  2022-09-29 19:52   ` [bug#58179] [PATCH 2/4] gnu: Add node-commander Nicolas Graves via Guix-patches via
@ 2022-09-29 19:52   ` Nicolas Graves via Guix-patches via
  2022-09-29 19:52   ` [bug#58179] [PATCH 4/4] gnu: Add rofi-switch-browser-tabs/chromium Nicolas Graves via Guix-patches via
  2 siblings, 0 replies; 7+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2022-09-29 19:52 UTC (permalink / raw)
  To: 58179; +Cc: ngraves

* gnu/packages/node-xyz.scm (node-chrome-remote-interface): New variable.
---
 gnu/packages/node-xyz.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm
index c14ff7f421..8dd11333ef 100644
--- a/gnu/packages/node-xyz.scm
+++ b/gnu/packages/node-xyz.scm
@@ -85,6 +85,36 @@ (define-public node-buffer-crc32
 and fancy character sets, signed or unsigned data and has tests, for Node.")
     (license license:expat)))
 
+(define-public node-chrome-remote-interface
+  (package
+    (name "node-chrome-remote-interface")
+    (version "0.31.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/cyrus-and/chrome-remote-interface")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0gbz8cj6s1mxvzaa9wpvdky2mcrdaz3ql552rkzzi6xlziqsrx69"))))
+    (build-system node-build-system)
+    (arguments
+     '(#:tests? #f
+       #:phases (modify-phases %standard-phases
+                  (replace 'configure
+                    (lambda _
+                      (invoke "npm" "--offline" "--ignore-scripts" "install"
+                              "--production"))))))
+    (inputs (list node-ws node-commander))
+    (home-page "https://github.com/cyrus-and/chrome-remote-interface")
+    (synopsis "Chrome Debugging Protocol interface")
+    (description "This package is a Chrome Debugging Protocol interface that
+helps to instrument Chrome (or any other suitable implementation) by providing
+a simple abstraction of commands and notifications using a straightforward
+JavaScript API.")
+    (license license:expat)))
+
 (define-public node-color-name
   (package
     (name "node-color-name")
-- 
2.37.3





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

* [bug#58179] [PATCH 4/4] gnu: Add rofi-switch-browser-tabs/chromium.
  2022-09-29 19:52 ` [bug#58179] [PATCH 1/4] gnu: Add node-ws Nicolas Graves via Guix-patches via
  2022-09-29 19:52   ` [bug#58179] [PATCH 2/4] gnu: Add node-commander Nicolas Graves via Guix-patches via
  2022-09-29 19:52   ` [bug#58179] [PATCH 3/4] gnu: Add node-chrome-remote-interface Nicolas Graves via Guix-patches via
@ 2022-09-29 19:52   ` Nicolas Graves via Guix-patches via
  2 siblings, 0 replies; 7+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2022-09-29 19:52 UTC (permalink / raw)
  To: 58179; +Cc: ngraves

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 3257 bytes --]

* gnu/packages/xdisorg.scm (rofi-switch-browser-tabs/chromium): New variable.
---
 gnu/packages/xdisorg.scm | 42 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index 9908f29191..2fa12ba220 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -56,6 +56,7 @@
 ;;; Copyright © 2022 Jai Vetrivelan <jaivetrivelan@gmail.com>
 ;;; Copyright © 2022 Derek Chuank <derekchuank@outlook.com>
 ;;; Copyright © 2022 Wamm K. D. <jaft.r@outlook.com>
+;;; Copyright © 2022 Nicolas Graves <ngraves@ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -118,6 +119,7 @@ (define-module (gnu packages xdisorg)
   #:use-module (gnu packages man)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages node-xyz)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
@@ -128,6 +130,7 @@ (define-module (gnu packages xdisorg)
   #:use-module (gnu packages terminals)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages)
   #:use-module (ice-9 match))
 
@@ -1905,6 +1908,45 @@ (define-public rofi-calc
 natural language input and provide results.")
     (license license:expat)))
 
+(define-public rofi-switch-browser-tabs/chromium
+  (let* ((commit "788cce881ba8c3891175fbbe62b9c799aa47652b")
+         (revision "0"))
+    (package
+      (name "rofi-switch-browser-tabs-chromium")
+      (version (git-version "0.0.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/kevinmorio/rofi-switch-browser-tabs")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0m4vldx9k6wxx7s7zkkwbj11r7vckvdky8fypf73qzmgl0yn4vmi"))
+         ;; The firefox version is strongly outdated.
+         ;; Firefox and firefox-based browsers will soon (and partially do)
+         ;; support this feature using this same package.
+         ;; Not working for firefox v105.0
+         (modules '((guix build utils)))
+         (snippet '(delete-file-recursively "firefox-switch-tabs"))))
+      (build-system copy-build-system)
+      (arguments
+       '(#:phases
+         (modify-phases %standard-phases
+           (add-before 'install 'chmod
+             (lambda _
+               (chmod "chrome-switch-tabs/chrome-switch-tabs" #o555))))
+         #:install-plan
+         (list '("chrome-switch-tabs/chrome-switch-tabs" "bin/"))))
+      (propagated-inputs (list jq node-chrome-remote-interface))
+      (home-page "https://github.com/kevinmorio/rofi-switch-browser-tabs")
+      (synopsis "Use rofi to switch between browser tabs")
+      (description "This packages provides a simple rofi mode to switch between
+tabs in Chromium-based browsers.  It also has experimental support for
+firefox-based browsers.  Once installed, simply run
+@code{rofi -modi 'chrome:chrome-switch-tabs' -show chrome}.")
+      (license license:expat))))
+
 (define-public tint2
   (package
     (name "tint2")
-- 
2.37.3





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

* [bug#58179] [PATCH] gnu: Add rofi-switch-browser-tabs.
  2022-09-29 19:48 [bug#58179] A small script to switch between browser tabs Nicolas Graves via Guix-patches via
  2022-09-29 19:52 ` [bug#58179] [PATCH 1/4] gnu: Add node-ws Nicolas Graves via Guix-patches via
@ 2022-10-02 19:16 ` Nicolas Graves via Guix-patches via
  2022-10-02 19:22 ` Nicolas Graves via Guix-patches via
  2 siblings, 0 replies; 7+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2022-10-02 19:16 UTC (permalink / raw)
  To: 58179


* gnu/packages/xdisorg.scm (rofi-switch-browser-tabs): New variable.
---
 gnu/packages/xdisorg.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index 9908f29191..aa673ce84d 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -1905,6 +1905,38 @@ (define-public rofi-calc
 natural language input and provide results.")
     (license license:expat)))
 
+(define-public rofi-switch-browser-tabs
+  (let* ((commit "e1516cc2cb824fb9bdfe45680429e36d6e3789c5")
+         (revision "0"))
+    (package
+      (name "rofi-switch-browser-tabs")
+      (version (git-version "0.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/nicolas-graves/rofi-switch-browser-tabs")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "15r3ajf60vgirrlapqf10xlklmwpj4k39sii9ji6djm16anpqwsm"))))
+      (build-system copy-build-system)
+      (arguments
+       '(#:phases
+         (modify-phases %standard-phases
+           (add-before 'install 'exe
+             (lambda _ (chmod "switch-browser-tabs" #o555))))
+         #:install-plan
+         (list '("switch-browser-tabs" "bin/"))))
+      (propagated-inputs (list wget jq))
+      (home-page "https://github.com/nicolas-graves/rofi-switch-browser-tabs")
+      (synopsis "Use rofi to switch between browser tabs")
+      (description "This packages provides a simple rofi mode to switch between
+tabs in Chromium-based browsers.  Once installed, just run your browser with
+@code{--remote-debugging-port=9222} and use
+@code{rofi -modi 'switch-tabs:switch-browser-tabs' -show switch-tabs}.")
+      (license license:expat))))
+
 (define-public tint2
   (package
     (name "tint2")
-- 
2.37.3


<#secure method=pgpmime mode=sign>

-- 
Best regards,
Nicolas Graves




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

* [bug#58179] [PATCH] gnu: Add rofi-switch-browser-tabs.
  2022-09-29 19:48 [bug#58179] A small script to switch between browser tabs Nicolas Graves via Guix-patches via
  2022-09-29 19:52 ` [bug#58179] [PATCH 1/4] gnu: Add node-ws Nicolas Graves via Guix-patches via
  2022-10-02 19:16 ` [bug#58179] [PATCH] gnu: Add rofi-switch-browser-tabs Nicolas Graves via Guix-patches via
@ 2022-10-02 19:22 ` Nicolas Graves via Guix-patches via
  2 siblings, 0 replies; 7+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2022-10-02 19:22 UTC (permalink / raw)
  To: 58179


* gnu/packages/xdisorg.scm (rofi-switch-browser-tabs): New variable.
---
 gnu/packages/xdisorg.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index 9908f29191..e8c201f375 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -56,6 +56,7 @@
 ;;; Copyright © 2022 Jai Vetrivelan <jaivetrivelan@gmail.com>
 ;;; Copyright © 2022 Derek Chuank <derekchuank@outlook.com>
 ;;; Copyright © 2022 Wamm K. D. <jaft.r@outlook.com>
+;;; Copyright © 2022 Nicolas Graves <ngraves@ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -126,6 +127,7 @@ (define-module (gnu packages xdisorg)
   #:use-module (gnu packages sphinx)
   #:use-module (gnu packages tcl)
   #:use-module (gnu packages terminals)
+  #:use-module (gnu packages wget)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages)
@@ -1905,6 +1907,38 @@ (define-public rofi-calc
 natural language input and provide results.")
     (license license:expat)))

+(define-public rofi-switch-browser-tabs
+  (let* ((commit "e1516cc2cb824fb9bdfe45680429e36d6e3789c5")
+         (revision "0"))
+    (package
+      (name "rofi-switch-browser-tabs")
+      (version (git-version "0.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/nicolas-graves/rofi-switch-browser-tabs")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "15r3ajf60vgirrlapqf10xlklmwpj4k39sii9ji6djm16anpqwsm"))))
+      (build-system copy-build-system)
+      (arguments
+       '(#:phases
+         (modify-phases %standard-phases
+           (add-before 'install 'exe
+             (lambda _ (chmod "switch-browser-tabs" #o555))))
+         #:install-plan
+         (list '("switch-browser-tabs" "bin/"))))
+      (propagated-inputs (list wget jq))
+      (home-page "https://github.com/nicolas-graves/rofi-switch-browser-tabs")
+      (synopsis "Use rofi to switch between browser tabs")
+      (description "This packages provides a simple rofi mode to switch between
+tabs in Chromium-based browsers.  Once installed, just run your browser with
+@code{--remote-debugging-port=9222} and use
+@code{rofi -modi 'switch-tabs:switch-browser-tabs' -show switch-tabs}.")
+      (license license:expat))))
+
 (define-public tint2
   (package
     (name "tint2")
--
2.37.3

Sorry for the double send.
In a few words, I forked the project and made it work with minimal
changes without node-chrome-remote-interface. The first commits aren't
useful for this final package anymore, although they are correct and
could still be added if wanted.

--
Best regards,
Nicolas Graves




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

end of thread, other threads:[~2022-10-02 19:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29 19:48 [bug#58179] A small script to switch between browser tabs Nicolas Graves via Guix-patches via
2022-09-29 19:52 ` [bug#58179] [PATCH 1/4] gnu: Add node-ws Nicolas Graves via Guix-patches via
2022-09-29 19:52   ` [bug#58179] [PATCH 2/4] gnu: Add node-commander Nicolas Graves via Guix-patches via
2022-09-29 19:52   ` [bug#58179] [PATCH 3/4] gnu: Add node-chrome-remote-interface Nicolas Graves via Guix-patches via
2022-09-29 19:52   ` [bug#58179] [PATCH 4/4] gnu: Add rofi-switch-browser-tabs/chromium Nicolas Graves via Guix-patches via
2022-10-02 19:16 ` [bug#58179] [PATCH] gnu: Add rofi-switch-browser-tabs Nicolas Graves via Guix-patches via
2022-10-02 19:22 ` Nicolas Graves via Guix-patches via

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.