Commit Graph

319 Commits

Author SHA1 Message Date
Tobias Jakobi d2fa4aa5e7 screencast: protect against NULL stream in xdpw_pwr_stream_destroy()
- this allows repeated calls of xdpw_pwr_stream_destroy() on a
  single screencast instance
2021-05-24 10:03:40 +02:00
Tobias Jakobi dbe71a66c7 screencast: bring function names in line with the wlroots guidelines
- no functional changes
2021-05-24 10:03:40 +02:00
columbarius b20b9d76d7 config: fix format specifier for max_fps 2021-05-22 12:26:50 +02:00
columbarius bbd4f9d2b1 doc: add note about the list character of env XDG_CURRENT_DESKTOP 2021-05-21 19:35:58 +02:00
columbarius feede20314 config: parse XDG_CURRENT_DESKTOP as a list 2021-05-20 22:45:10 +02:00
columbarius c60b2b6ca8 config: fix memory leak config_home_fallback 2021-05-06 11:52:16 +02:00
Simon Ser efcbcb60aa contrib/systemd: add ConditionEnvironment
This makes it clear xdpw requires WAYLAND_DISPLAY to be set before
being started.

Inspired by the mako service [1].

[1]: https://github.com/emersion/mako/blob/master/contrib/systemd/mako.service
2021-05-03 18:17:29 -04:00
Simon Ser 884a2e808e readme: add dbus-update-activation-environment command
Add a dbus-update-activation-environment invocation that users can
add to their config file. This should work for most users, assuming
Sway, systemd, and D-Bus activation.

The --systemd flag also imports the variables to the systemd user
session.
2021-05-03 18:07:10 -04:00
Simon Ser 835a928bd4 readme: update "Manual startup" section
Add -r flag to xdpw to make sure any currently running process gets
replaced.

Remove the /usr/lib/xdg-desktop-portal invocation since xdpw can now be
replaced.

Adapt the wording to the latest xdpw changes.
2021-05-03 18:07:10 -04:00
Tobias Langendorf 5d4dd833a4 screenshot: implement PickColor method
closes #129
2021-05-03 23:56:06 +02:00
columbarius 47635b94eb screencast: add prompt to dmenu style default choosers 2021-05-03 15:58:40 +02:00
Tobias Langendorf 83086e9af8 screenshot: implement `interactive` option 2021-05-03 15:51:05 +02:00
columbarius 620946b320 config: add missing keys to print_config 2021-05-03 15:19:20 +02:00
columbarius f1472350f0 doc: remove quotes from samples
inih doesn't strip them and sh will try to find the binary including the whitespaces
2021-05-03 15:19:20 +02:00
columbarius 22af25749e config: use inih instead if iniparser 2021-05-03 15:19:20 +02:00
Simon Ser 7f6b4090e0 Add -r flag to slurp
This prevents the user from selecting a custom region, and forces
them to select a full output.
2021-05-03 11:57:11 +02:00
Simon Ser bb13697c01 Add wlroots to portal manifest UseIn list
XDG_CURRENT_DESKTOP can contain a list [1]. Allow users to
set a list such as XDG_CURRENT_DESKTOP=asdf:wlroots. That way, users
can use xdpw in their non-Sway compositor without specifying
XDG_CURRENT_DESKTOP=sway and without having to edit the portal
definition.

[1]: 9a2582d035/src/portal-impl.c (L189)
2021-04-23 16:51:07 +02:00
Simon Ser 5d3cf9a8fa Remove -o and -f options
These can be specified in the configuration file now.
2021-04-21 12:12:40 -04:00
columbarius f978a6eb77 Revert "screencast: workaround corrupted output_list"
This reverts commit 94f1f5d0a8.
2021-04-19 15:42:50 +02:00
columbarius e89c58c731 wlr_screencopy: make sure xdg_output_manager is supported 2021-04-19 15:42:50 +02:00
Stefano Ragni ebb50839a5 wlr_screencast: fix return value on cmd failure 2021-04-18 19:56:54 +02:00
Simon Ser 9f7e59c80a Bump to v0.3.0 2021-04-18 17:17:13 +02:00
Simon Ser af7cdec82d build: use has_headers in find_library()
This allows to make sure the library's header files are available.
2021-04-18 15:02:44 +02:00
Simon Ser 47f9e1ccea build: remove dirs from iniparser find_library() call
The docs say:

> By default the library is searched for in the system library directory (e.g.
> /usr/lib).

So it should already do the right thing.
2021-04-18 15:02:44 +02:00
Simon Ser d1328e2f4b build: remove intermediate static library
We don't really need to build an intermediate static library, and
it's causing pain wrt. include directories and dependencies.
2021-04-18 15:02:44 +02:00
Simon Ser f8f188a73e ci: add /usr/local to search paths on FreeBSD
Because of an upstream Meson bug [1], the /usr/local prefix used
by ports is not included in default Meson search paths. Do it
explicitly for now.

[1]: https://github.com/mesonbuild/meson/issues/4468
2021-04-18 15:02:44 +02:00
columbarius 5e4edae701 wlr_screencast: remove wl_display_dispatch
wl_display_dispatch is unnecessary and can cause hangs, if no new requests are queued
2021-04-17 16:25:54 +02:00
Simon Ser 4af11c7a4f readme: don't show PR status in CI badge 2021-04-17 11:58:29 +02:00
columbarius ca46a98b86 wlr_screencast: add xdg_output_listener after output registration if possible 2021-04-17 11:33:48 +02:00
columbarius 3ca286b0b4 wlr_screencast: call wlr_remove_output only if global is an output 2021-04-17 11:33:48 +02:00
columbarius d83431335d wlr_screencast: create clean xdpw_wlr_output and free on remove 2021-04-17 11:33:48 +02:00
Aleksei Bavshin 9ba958c7d2 Fix gcc warnings on invalid `free` call
```
../src/core/config.c: In function ‘finish_config’:
../src/core/config.c:26:9: error: ‘free’ called on pointer ‘config_7(D)’ with nonzero offset 16 [-Werror=free-nonheap-object]
   26 |         free(&config->screencast_conf.exec_before);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/core/config.c:27:9: error: ‘free’ called on pointer ‘config_7(D)’ with nonzero offset 24 [-Werror=free-nonheap-object]
   27 |         free(&config->screencast_conf.exec_after);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/core/config.c:28:9: error: ‘free’ called on pointer ‘config_7(D)’ with nonzero offset 32 [-Werror=free-nonheap-object]
   28 |         free(&config->screencast_conf.chooser_cmd);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```
2021-04-10 10:50:24 +02:00
columbarius 94f1f5d0a8 screencast: workaround corrupted output_list 2021-04-02 15:07:38 +02:00
columbarius d556426359 man: add entry for chooser_cmd and chooser_type 2021-04-02 15:07:38 +02:00
columbarius 9d78b21695 screencast: add outputchooser with config option
Supports "dmenu" chooser type, which is called with a dmenu type list
piped to stdin, "simple" type, which recieves nothing on stdin and
default, which tries the hardcoded choosers.
Choosers are required to return the name of the choosen output as given
by the xdg-output protocol.

Thanks to piater for closing overlooked pipes.
Thanks to ericonr for suggestions regarding fork and pipes.
2021-04-02 15:07:38 +02:00
David96 4c2d8fc808 Add exec_before and exec_after
Adds an option to execute some program before and after screencast (e.g.
for disabling notifications during a cast)
2021-03-16 23:44:08 +01:00
Dan Shick d3e1f7100c Update CI config to build man pages 2021-03-16 21:26:14 +01:00
Stefano Ragni 6c8f6ca78e pipewire: Fix building EnumFormat spa object
Make sure that in SPA_POD_CHOICE_ENUM_Id(n_vals, ...) we always pass
exactly n_vals arguments. For this we build the object with separate
spa_pod_builder_add calls, since n_vals is known at runtime.
Fix #102
2021-03-16 15:43:47 -04:00
Simon Ser f3bd5195e4 Add man page 2021-03-15 18:09:32 +01:00
Simon Ser a18c298ad4 Don't use ~/.config when XDG_CONFIG_HOME is set
According to the spec, ~/.config is a fallback used when
XDG_CONFIG_HOME is unset. When the user has explicitly set
XDG_CONFIG_HOME, we shouldn't try to use the fallback.
2021-03-15 18:08:57 +01:00
Simon Ser 491cbb1cc6 Constify config_path arguments
These are not modified.
2021-03-15 18:08:57 +01:00
Simon Ser b92ad3eb6b Drop /etc/xdg-desktop-portal-wlr/ from config file dirs
We were checking both /etc/xdg-desktop-portal-wlr/ and
/etc/xdg/xdg-desktop-portal-wlr/. These two directories serve the same
purpose, let's just settle on a single one.
2021-03-15 18:08:57 +01:00
Zsolt Donca ab8ff54f4c Control how many frames are captured per second
The goal is to control the rate of capture while in screencast, as it
can represent a performance issue and can cause input lag and the
feeling of having a laggy mouse.

This commit addresses the issue reported in #66.

The code measures the time elapsed to make a single screen capture, and
calculates how much to wait for the next capture to achieve the targeted
frame rate. To delay the capturing of the next frame, the code
introduces timers into the event loop based on the event loop in
https://github.com/emersion/mako

Added a command-line argument and an entry in the config file as well
for the max FPS. The default value is 0, meaning no rate control.

Added code to measure the average FPS every 5 seconds and print it with
DEBUG level.
2021-03-08 16:59:17 +01:00
danshick 323d89ead7 Fix link to trigger-screen-shot.py 2021-03-04 20:42:40 +01:00
Simon Ser 4489ea4bb6 Fix whitespace issues in meson.build 2021-03-04 20:17:35 +01:00
Simon Ser d3ac33a0aa Fix segfault in config_parse_file
configfile is a `char *`. %s needs a `char *`, so we shouldn't
dereference the pointer here.

Closes: https://github.com/emersion/xdg-desktop-portal-wlr/issues/91
2021-03-04 14:16:30 -05:00
columbarius 07154bb1e3
Add support for config file
Closes: https://github.com/emersion/xdg-desktop-portal-wlr/issues/60
2021-03-03 10:29:56 +01:00
Simon Ser e103e120e2 Bump to v0.2.0 2021-02-15 10:22:29 +01:00
danshick 92e6877fce
Update README to include repology badge 2021-02-15 10:20:30 +01:00
Simon Ser 5401e7f9f2 Add --replace flag
This allows replacing a running xdpw instance. xdg-desktop-portal
itself has this feature.

This is useful when developing, to stop the currently running
system instance.
2021-02-11 13:24:53 -05:00