diff --git a/README.md b/README.md index d489d71..ea43f6f 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,12 @@ Make sure `XDG_CURRENT_DESKTOP=sway` is set. When correctly installed, xdg-desktop-portal should automatically invoke xdg-desktop-portal-wlr when needed. +### Configuration + +See `man 5 xdg-desktop-portal-wlr`. + +### Manual startup + At the moment, some command line flags are available for testing, compatibility, or output selection. If you need to use one of these flags, you can provide an instance of xdpw using the following command: diff --git a/meson.build b/meson.build index a53e163..969feaa 100644 --- a/meson.build +++ b/meson.build @@ -124,3 +124,24 @@ install_data( 'wlr.portal', install_dir: join_paths(get_option('datadir'), 'xdg-desktop-portal', 'portals'), ) + +scdoc = dependency('scdoc', required: get_option('man-pages'), version: '>= 1.9.7') +if scdoc.found() + man_pages = ['xdg-desktop-portal-wlr.5.scd'] + foreach src : man_pages + topic = src.split('.')[0] + section = src.split('.')[1] + output = topic + '.' + section + + custom_target( + output, + input: files(src), + output: output, + command: [ + 'sh', '-c', '@0@ < @INPUT@ > @1@'.format(scdoc.get_pkgconfig_variable('scdoc'), output) + ], + install: true, + install_dir: join_paths(get_option('mandir'), 'man' + section), + ) + endforeach +endif diff --git a/meson_options.txt b/meson_options.txt index d7ae3ab..77fa135 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,3 @@ option('sd-bus-provider', type: 'combo', choices: ['auto', 'libsystemd', 'libelogind', 'basu'], value: 'auto', description: 'Provider of the sd-bus library') option('systemd', type: 'feature', value: 'auto', description: 'Install systemd user service unit') +option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages') diff --git a/xdg-desktop-portal-wlr.5.scd b/xdg-desktop-portal-wlr.5.scd new file mode 100644 index 0000000..717d0ce --- /dev/null +++ b/xdg-desktop-portal-wlr.5.scd @@ -0,0 +1,49 @@ +xdg-desktop-portal-wlr(5) + +# NAME + +xdg-desktop-portal-wlr - an xdg-desktop-portal backend for wlroots + +# DESCRIPTION + +xdg-desktop-portal-wlr (or xdpw for short) allows applications to request +screenshots and screencasts via xdg-desktop-portal in wlroots-based Wayland +compositors. + +xdpw will try to load the configuration file from these locations: + +- $XDG_CONFIG_HOME/xdg-desktop-portal-wlr/$XDG_CURRENT_DESKTOP +- $XDG_CONFIG_HOME/xdg-desktop-portal-wlr/config +- /etc/xdg/xdg-desktop-portal-wlr/$XDG_CURRENT_DESKTOP +- /etc/xdg/xdg-desktop-portal-wlr/config + +_$XDG_CONFIG_HOME_ defaults to _~/.config_. + +The configuration files use the INI file format. Example: + +``` +[screencast] +output_name=HDMI-A-1 +max_fps=30 +``` + +# SCREENCAST OPTIONS + +These options need to be placed under the **[screencast]** section. + +**output_name** = _name_ + Select which output will be screencast. + + By default, an arbitrary output is selected. The list of available outputs + can be obtained via **wayland-info**(1) (under the _zxdg_output_manager_v1_ + section). + +**max_fps** = _limit_ + Limit the number of frames per second to the provided rate. + + This is useful to reduce CPU usage when capturing frames at the output's + refresh rate is unnecessary. + +# SEE ALSO + +**pipewire**(1)