commit c62c198193bfb3738c17e384ce4991f659ba7c58 Author: Matěj Cepl Date: Mon Oct 17 14:56:01 2022 +0200 Original package. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1983c24 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/idlehack +.osc diff --git a/_service b/_service new file mode 100644 index 0000000..d12f5db --- /dev/null +++ b/_service @@ -0,0 +1,15 @@ + + + 0.0+git + https://github.com/loops/idlehack.git + git + .git* + enable + mcepl@cepl.eu + + + *.tar + gz + + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..f1f4c5e --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + https://github.com/loops/idlehack.git + 03b91c2a7717d72e9ff5fcd2eca46daae5964a5c \ No newline at end of file diff --git a/idlehack-0.0+git.1638710471.03b91c2.tar.gz b/idlehack-0.0+git.1638710471.03b91c2.tar.gz new file mode 100644 index 0000000..567ca91 Binary files /dev/null and b/idlehack-0.0+git.1638710471.03b91c2.tar.gz differ diff --git a/idlehack.changes b/idlehack.changes new file mode 100644 index 0000000..4cf21f1 --- /dev/null +++ b/idlehack.changes @@ -0,0 +1,9 @@ +------------------------------------------------------------------- +Mon Dec 6 07:04:01 UTC 2021 - Matej Cepl + +- Use right macros for user systemd services. + +------------------------------------------------------------------- +Sun Dec 5 21:21:32 UTC 2021 - Matej Cepl + +- Initial packaging effort diff --git a/idlehack.spec b/idlehack.spec new file mode 100644 index 0000000..aac5bab --- /dev/null +++ b/idlehack.spec @@ -0,0 +1,71 @@ +# +# spec file for package idlehack +# +# Copyright (c) 2021 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: idlehack +Version: 0.0+git.1638710471.03b91c2 +Release: 0 +Summary: Monitor dbus and inhibit swayidle when Firefox or Chromium request it +License: ISC +URL: https://github.com/loops/idlehack +Source0: idlehack-%{version}.tar.gz +# PATCH-FIX-UPSTREAM order_libs.patch bugno mcepl@suse.com +# Fix building +Patch0: order_libs.patch +BuildRequires: pkgconfig +BuildRequires: systemd-rpm-macros +BuildRequires: pkgconfig(dbus-1) +BuildRequires: pkgconfig(libsystemd) >= 237 +BuildRequires: pkgconfig(x11) + +%description +Listen for Firefox/Chromium dbus messages that request screensaver +inhibit, typically because the user is watching video. Sway doesn't +currently listen for such messages, so here we create a daemon that +listens for these messages and then invokes "/bin/swayidle-inhibit" +which is responsible for temporarily disabling the screen blanking. + +%prep +%autosetup -p1 + +%build +%make_build + +%install +install -D -m 0755 idlehack %{buildroot}/%{_libexecdir}/idlehack +install -D -m 0755 swayidle-inhibit %{buildroot}/%{_bindir}/swayidle-inhibit +install -D -m 0644 idlehack.service %{buildroot}/%{_userunitdir}/idlehack.service + +%pre +%systemd_user_pre idlehack.service + +%post +%systemd_user_post idlehack.service + +%preun +%systemd_user_preun idlehack.service + +%postun +%systemd_user_postun idlehack.service + +%files +%doc README +%{_bindir}/swayidle-inhibit +%{_userunitdir}/idlehack.service +%{_libexecdir}/idlehack + +%changelog diff --git a/order_libs.patch b/order_libs.patch new file mode 100644 index 0000000..36c1165 --- /dev/null +++ b/order_libs.patch @@ -0,0 +1,13 @@ +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -1,4 +1,4 @@ + CFLAGS:=$(shell pkg-config --cflags dbus-1) -DHAVE_LIBSYSTEMD -DHAVE_UNISTD_H -DGETTIMEOFDAY_TWO_ARGS -O3 + LDFLAGS:=$(shell pkg-config --libs dbus-1) $(shell pkg-config --libs libsystemd) +-idlehack: idlehack.c blurb.c yarandom.c +- ++idlehack: idlehack.o blurb.o yarandom.o ++ cc -o $@ $? $(LDFLAGS)