(define-module (ruther packages browser-selector) #:use-module (guix packages) #:use-module (guix build-system copy) #:use-module (guix gexp) #:use-module (guix licenses) #:use-module (gnu packages guile)) (define-public browser-selector (package (name "browser-selector") (version "1.0") (source (local-file "browser-selector-script")) (build-system copy-build-system) (arguments '(#:install-plan '(("browser-selector-script" "bin/browser-selector")) #:phases (modify-phases %standard-phases (add-after 'install 'make-executable (lambda* (#:key outputs #:allow-other-keys) (let ((bin-file (string-append (assoc-ref outputs "out") "/bin/browser-selector"))) (chmod bin-file #o755)))) (add-after 'make-executable 'install-desktop-file (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (make-desktop-entry-file (string-append out "/share/applications/browser-selector.desktop") #:name "Browser Selector" #:comment "Smart browser selector for URLs" #:exec (string-append out "/bin/browser-selector %u") #:categories '("Network" "WebBrowser") #:mime-type '("text/html" "text/xml" "application/xhtml+xml" "x-scheme-handler/http" "x-scheme-handler/https")))))))) (native-inputs (list guile-3.0)) (home-page "") (synopsis "Smart browser selector for URLs") (description "A Guile script that automatically selects Firefox or LibreWolf based on URL patterns. YouTube, Netflix, Max, Twitch, and Discord open in Firefox, while all other URLs open in LibreWolf.") (license gpl3+)))