Compare commits
4 Commits
c23524cd30
...
main
Author | SHA1 | Date | |
---|---|---|---|
ae7a95230f | |||
115a8a89a3 | |||
8109f43855 | |||
a81c61ab0a |
18
README.org
18
README.org
@ -18,14 +18,9 @@ discuss anything.
|
|||||||
pipewire-0 currently requires presence of PipeWire command line tools,
|
pipewire-0 currently requires presence of PipeWire command line tools,
|
||||||
namely [[https://docs.pipewire.org/page_man_pw_cli_1.html][pw-cli]] and [[https://docs.pipewire.org/page_man_pw_metadata_1.html][pw-metadata]].
|
namely [[https://docs.pipewire.org/page_man_pw_cli_1.html][pw-cli]] and [[https://docs.pipewire.org/page_man_pw_metadata_1.html][pw-metadata]].
|
||||||
|
|
||||||
To install pipewire-0, put the *.el files to a site-lisp directory and
|
You can install pipewire-0 from [[https://melpa.org/#/pipewire][MELPA]]. If you use [[https://github.com/radian-software/straight.el][straight.el]] and
|
||||||
add the following line to your Emacs configuration:
|
prefer using source repos directly, you can install pipewire-0 as
|
||||||
|
follows:
|
||||||
#+begin_src elisp
|
|
||||||
(require ’pipewire)
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
Or if you use [[https://github.com/radian-software/straight.el][straight.el]], you can install pipewire-0 as follows:
|
|
||||||
|
|
||||||
#+begin_src elisp
|
#+begin_src elisp
|
||||||
(straight-use-package
|
(straight-use-package
|
||||||
@ -34,6 +29,13 @@ Or if you use [[https://github.com/radian-software/straight.el][straight.el]], y
|
|||||||
:local-repo "pipewire-0"))
|
:local-repo "pipewire-0"))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
To install pipewire-0 manually, put the *.el files to a site-lisp
|
||||||
|
directory and add the following line to your Emacs configuration:
|
||||||
|
|
||||||
|
#+begin_src elisp
|
||||||
|
(require ’pipewire)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** User interface
|
** User interface
|
||||||
|
|
||||||
=M-x pipewire= enters a buffer with PipeWire objects:
|
=M-x pipewire= enters a buffer with PipeWire objects:
|
||||||
|
28
pipewire.el
28
pipewire.el
@ -25,11 +25,18 @@
|
|||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;;
|
;;
|
||||||
;; PipeWire user interface based on pipewire-lib.
|
;; PipeWire user interface and library.
|
||||||
;; An interactive buffer can be displayed using `M-x pipewire'.
|
;; It currently uses pw-cli and pw-metadata command line utilities to
|
||||||
|
;; interact with PipeWire.
|
||||||
|
;;
|
||||||
|
;; An interactive PipeWire buffer can be displayed using `M-x pipewire'.
|
||||||
|
;; There you can view basic PipeWire status and change some settings.
|
||||||
;; `pipewire-increase-volume', `pipewire-decrease-volume' and
|
;; `pipewire-increase-volume', `pipewire-decrease-volume' and
|
||||||
;; `pipewire-toggle-muted' functions are also suitable to bind on the
|
;; `pipewire-toggle-muted' functions can be used also standalone and
|
||||||
;; multimedia keys.
|
;; are suitable to bind on the multimedia keys.
|
||||||
|
;;
|
||||||
|
;; The package can be used also non-interactively in Elisp programs.
|
||||||
|
;; See pipewire-lib.el source file for available functions.
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
@ -150,7 +157,7 @@ The indicator is displayed only on graphical terminals."
|
|||||||
(interactive)
|
(interactive)
|
||||||
(when (and (not (eq major-mode 'pipewire-mode))
|
(when (and (not (eq major-mode 'pipewire-mode))
|
||||||
(not (equal (buffer-name) pipewire-buffer)))
|
(not (equal (buffer-name) pipewire-buffer)))
|
||||||
(error "Not in a PipeWire buffer"))
|
(user-error "Not in a PipeWire buffer"))
|
||||||
(pipewire-lib-refresh)
|
(pipewire-lib-refresh)
|
||||||
(let ((inhibit-read-only t)
|
(let ((inhibit-read-only t)
|
||||||
(default-ids (mapcar #'cdr (pipewire-lib-default-nodes)))
|
(default-ids (mapcar #'cdr (pipewire-lib-default-nodes)))
|
||||||
@ -287,9 +294,10 @@ object. Otherwise apply it on the default audio sink."
|
|||||||
(defun pipewire-toggle-microphone ()
|
(defun pipewire-toggle-microphone ()
|
||||||
"Switch mute status of the default audio input."
|
"Switch mute status of the default audio input."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let* ((object (car (pipewire-lib-default-capture-ports)))
|
(let ((object (car (pipewire-lib-default-capture-ports))))
|
||||||
(muted-p (pipewire-lib-toggle-mute object)))
|
(if object
|
||||||
(pipewire--update-muted object muted-p)))
|
(pipewire--update-muted object (pipewire-lib-toggle-mute object))
|
||||||
|
(user-error "No default audio input"))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun pipewire-set-volume (volume &optional object single-p)
|
(defun pipewire-set-volume (volume &optional object single-p)
|
||||||
@ -384,7 +392,7 @@ Otherwise ask for the Node to set as the default Node."
|
|||||||
;; Without this, ports of the device may not be displayed on the update:
|
;; Without this, ports of the device may not be displayed on the update:
|
||||||
(sit-for 0)
|
(sit-for 0)
|
||||||
(pipewire--update))
|
(pipewire--update))
|
||||||
(error "Nothing to set a profile for here")))
|
(user-error "Nothing to set a profile for here")))
|
||||||
|
|
||||||
(defun pipewire-properties ()
|
(defun pipewire-properties ()
|
||||||
"Display properties of the object at the current point."
|
"Display properties of the object at the current point."
|
||||||
@ -398,7 +406,7 @@ Otherwise ask for the Node to set as the default Node."
|
|||||||
(insert (format "%s: %s\n" p (pipewire-lib-object-value object p)))))
|
(insert (format "%s: %s\n" p (pipewire-lib-object-value object p)))))
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(view-mode))
|
(view-mode))
|
||||||
(error "No PipeWire object here")))
|
(user-error "No PipeWire object here")))
|
||||||
|
|
||||||
(defvar pipewire-mode-map
|
(defvar pipewire-mode-map
|
||||||
(let ((map (make-sparse-keymap)))
|
(let ((map (make-sparse-keymap)))
|
||||||
|
Reference in New Issue
Block a user