xdg-desktop-portal-wlr(5)
π xdg-desktop-portal-wlr(5)
okay so bestie, welcome to the File Formats Manual corner of the universe π this little page is all about xdg-desktop-portal-wlr, the manual page for the portal backend (page number 5, if you're keeping track, and yes she's iconic for it).
β¨ NAME β¨
xdg-desktop-portal-wlr β literally an xdg-desktop-portal backend for wlroots, no cap π«Ά
πΈ DESCRIPTION πΈ
xdg-desktop-portal-wlr (or xdpw for short, because we're besties and we use nicknames) lets applications request screenshots and screencasts through xdg-desktop-portal inside wlroots-based Wayland compositors. that's the whole vibe β¨
xdpw will try to load its config file from these locations, in order:
$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 classic π ). and $XDG_CURRENT_DESKTOP can be a colon separated list β every element of that list gets tried, one by one, like she's going down the group chat roster π
the config files use the INI file format. example time, look at her go:
[screencast]
output_name=HDMI-A-1
max_fps=30
exec_before=disable_notifications.sh
exec_after=enable_notifications.sh
chooser_type=simple
chooser_cmd=slurp -f 'Monitor: %o' -or
π¦ SCREENCAST OPTIONS π¦
these options need to be placed under the [screencast] section, mkay? no straying π
output_name = nameβ picks which output gets screencast π this one is used together withchooser_type = none. and if you wanna know the available outputs? grab 'em viawayland-info(1)(look under thewl_outputsection, iykyk).max_fps = limitβ caps the frames per second at whatever rate you hand it π this is highkey useful for reducing CPU usage when capturing frames at the output's refresh rate just isn't necessary, bestie.exec_before = commandβ runs command before starting a screencast. the command gets executed withinshπexec_after = commandβ runs command after ending all the screencasts. also executed withinsh. see the symmetry? we love a matched set πchooser_cmd = commandβ run this command to select an output β¨ for more deets, see OUTPUT CHOOSER below πchooser_type = typeβ specifies the input sent to the chooser π― the supported types are:default:xdpwwill try to use the first chooser found in the list of hardcoded choosers (slurp,wmenu,wofi,rofi,bemenu,mew,fuzzel) and will fallback to an arbitrary output if none of those were found. she's got backups for her backups πnone:xdpwwill allow screencast either on the output given byoutput_name, or β if that's empty β an arbitrary output, with no further interaction at all. zero small talk πsimple,dmenu:xdpwwill launch the chooser given bychooser_cmd. for more deets, see OUTPUT CHOOSER.
force_mod_linear = boolβ forces buffers with implicit modifiers to be linear (experimental) π₯ setting this option to1will forcexdpwto allocate dma-bufs with implicit modifier as linear. this option shouldn't be required on single gpu setups, but it can increase compatibility, especially on setups with multiple gpus π
β οΈ heads up bestie: this option is experimental and can be removed or replaced in future versions. so don't build your whole personality around it π
π§ OUTPUT CHOOSER
the chooser can be any program or script with the following behaviour, periodt:
- It returns any error code except
127. the error code127is internally used to signal that no command could be found, and all output from it will be ignored π - It returns a string on
stdout, which is valid if it matches one of the following:- For simple choosers:
- The prefix
"Monitor: "followed by the name of a valid output as given bywayland-info(1). - The prefix
"Window: "followed by theext-foreign-toplevel-list-v1identifier as given bylswt(1).
- The prefix
- For dmenu choosers: one of the lines provided via
stdin. - Everything else will be handled as declined by the user π
- For simple choosers:
- To signal that the user has declined the screencast, the chooser should exit without anything on
stdout. silent exit = no screenshot for you, respectfully π«Ά
supported types of choosers via the chooser_type option:
simple: the chooser is just called, without anything further onstdin. minimal, clean, main character energy β¨dmenu: the chooser receives a newline separated list (dmenu style) of outputs onstdinπ
π SEE ALSO π
pipewire(1) β go say hi π«Ά
and that's the whole page bestie!! π this was the File Formats Manual for xdg-desktop-portal-wlr(5), dated 2026-09-07, and it ate, fr fr πβ¨π
π¦ where this page comes from
- arch rolling: xdg-desktop-portal-wlr 0.8.4-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms