1xdg-desktop-portal-wlr(5) 2 3# NAME 4 5xdg-desktop-portal-wlr - an xdg-desktop-portal backend for wlroots 6 7# DESCRIPTION 8 9xdg-desktop-portal-wlr (or xdpw for short) allows applications to request 10screenshots and screencasts via xdg-desktop-portal in wlroots-based Wayland 11compositors. 12 13xdpw will try to load the configuration file from these locations: 14 15- $XDG_CONFIG_HOME/xdg-desktop-portal-wlr/$XDG_CURRENT_DESKTOP 16- $XDG_CONFIG_HOME/xdg-desktop-portal-wlr/config 17- /usr/local/etc/xdg/xdg-desktop-portal-wlr/$XDG_CURRENT_DESKTOP 18- /usr/local/etc/xdg/xdg-desktop-portal-wlr/config 19 20_$XDG_CONFIG_HOME_ defaults to _~/.config_. 21_$XDG_CURRENT_DESKTOP_ can be a colon seperated list. Each element of that list will be tried. 22 23The configuration files use the INI file format. Example: 24 25``` 26[screencast] 27output_name=HDMI-A-1 28max_fps=30 29exec_before=disable_notifications.sh 30exec_after=enable_notifications.sh 31chooser_type=simple 32chooser_cmd=slurp -f %o -or 33``` 34 35# SCREENCAST OPTIONS 36 37These options need to be placed under the **[screencast]** section. 38 39**output_name** = _name_ 40 Select which output will be screencast. 41 42 This option is used with **chooser_type** = none. The list of available outputs 43 can be obtained via **wayland-info**(1) (under the _zxdg_output_manager_v1_ 44 section). 45 46**max_fps** = _limit_ 47 Limit the number of frames per second to the provided rate. 48 49 This is useful to reduce CPU usage when capturing frames at the output's 50 refresh rate is unnecessary. 51 52**exec_before** = _command_ 53 Execute _command_ before starting a screencast. The command will be executed within sh. 54 55**exec_after** = _command_ 56 Execute _command_ after ending all screencasts. The command will be executed within sh. 57 58**chooser_cmd** = _command_ 59 Run this command to select an output. 60 61 For more details see **OUTPUT CHOOSER**. 62 63**chooser_type** = _type_ 64 Specifies the input send to the chooser. 65 66 The supported types are: 67 - default: xdpw will try to use the first chooser found in the list of hardcoded choosers 68 (slurp, wofi, bemenu) and will fallback to an arbitrary output if none of those were found. 69 - none: xdpw will allow screencast either on the output given by **output_name**, or if empty 70 an arbitrary output without further interaction. 71 - simple, dmenu: xdpw will launch the chooser given by **chooser_cmd**. For more details 72 see **OUTPUT CHOOSER**. 73 74## OUTPUT CHOOSER 75 76The chooser can be any program or script with the following behaviour: 77- It returns any error code except 127. The error code 127 is internally used to signal 78 that no command could be found and all output from it will be ignored. 79- It returns the name of a valid output on stdout as given by **wayland-info**(1). 80 Everything else will be handled as declined by the user. 81- To signal that the user has declined screencast, the chooser should exit without 82 anything on stdout. 83 84Supported types of choosers via the **chooser_type** option: 85- simple: the chooser is just called without anything further on stdin. 86- dmenu: the chooser receives a newline separated list (dmenu style) of outputs on stdin. 87 88# SEE ALSO 89 90**pipewire**(1) 91