Re: Help with screenshot API.
rahul vadhyar <[email protected]> Sat, 5 Oct 2024 14:27:45 +0530
| Newsgroups | gmane.comp.kde.devel.kwin |
|---|---|
| Message-ID | <CAOL1oiaUWNR8Lh+w5gc1EiLzwp6nswL1WdWL-Fh9uQ5XOqf8Vg@mail.gmail.com> |
--000000000000dbee740623b6fbbe Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I finally got it working. I can now complete my application. You guys are quick. My friends expected this to take weeks. Huge supporter and daily driver of KDE, and as part of my capstone project in college, I am making a ML based kirigami app(which is why I needed screenshots). Cannot thank you guys enough. Thanks a lot, Rahul On Sat, 5 Oct 2024 at 02:33, Aleix Pol <[email protected]> wrote: > The path in Exec=3D needs to be absolute for KWin to validate it. > > On Fri, Oct 4, 2024 at 6:02=E2=80=AFPM rahul vadhyar <vadhyarrahul@gmail.= com> > wrote: > > > > After trying copying code in xdg-desktop-portal-kde, I am now presented > with > > The process is not authorized to take a screenshot > > > > From my research(https://phabricator.kde.org/D29407, > https://forum.kde.org/viewtopic.php%3Ff=3D305&t=3D176422.html), it should > have been fixed by putting the app in a root write only dir. But even aft= er > putting the app in /usr/bin and the .desktop file in > /usr/share/applications, I still cannot get rid of this error. > > > > I am providing my .desktop file as reference if that helps. > > [Desktop Entry] > > Name=3DKool Intelligence > > Exec=3Dkoolintelligence > > Icon=3Dkde > > Type=3DApplication > > Terminal=3Dfalse > > Categories=3DSystem > > X-DBUS-ServiceName=3Dorg.kde.koolintelligence > > > X-KDE-DBUS-Restricted-Interfaces=3Dorg.kde.kwin.Screenshot,org.kde.KWin.S= creenShot2 > > > > Sorry for asking every small thing, I am new to this, and the lack of > documentation around this leaves me no option. > > Please help me solve this (hopefully) final error. > > > > A very heartfelt thanks for your support, > > Rahul > > > > On Fri, 4 Oct 2024 at 20:20, Vlad Zahorodnii <[email protected]> > wrote: > >> > >> On 10/4/24 5:28 PM, rahul vadhyar wrote: > >> > Even if CaptureWorkspace returns a dictionary, I shouldn't be gettin= g > >> > the error that the API doesn't exist. > >> > >> I think that the error message is rather misleading. CaptureWorkspace > >> expects some input arguments, but the example code provides none so > >> QtDBus says that there's no CaptureWorkspace **with the specified** > >> signature. > >> > >> CaptureWorkspace expects two arguments: a dictionary with various > >> options (it can be empty), and a pipe file descriptor where kwin will > >> write screenshot to. A good example how to use that API is spectacle o= r > >> xdg-desktop-portal-kde > >> > https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/blob/30b9ac6a169ee= 9f7c36aabbec4038a8a715ac2cb/src/screenshotdialog.cpp#L158 > >> > >> > To provide more context, I am making a kirigami app. I am using the > >> > .desktop file as given in the previous email. I am also using the > >> > following command for compiling and testing > --000000000000dbee740623b6fbbe Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">I finally got it working. I can now complete my applicatio= n. You guys are quick. My friends expected this to take weeks.<div>Huge sup= porter and daily driver of KDE, and=C2=A0as part of my capstone project in = college, I am making a ML based kirigami app(which is why I needed screensh= ots).=C2=A0</div><div>Cannot thank you guys enough.</div><div><br></div><di= v>Thanks a lot,</div><div>Rahul</div><div><br></div></div><br><div class=3D= "gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, 5 Oct 2024 at 0= 2:33, Aleix Pol <<a href=3D"mailto:[email protected]">[email protected]</a= >> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px= 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The= path in Exec=3D needs to be absolute for KWin to validate it.<br> <br> On Fri, Oct 4, 2024 at 6:02=E2=80=AFPM rahul vadhyar <<a href=3D"mailto:= [email protected]" target=3D"_blank">[email protected]</a>> wr= ote:<br> ><br> > After trying copying code in xdg-desktop-portal-kde, I am now presente= d with<br> > The process is not authorized to take a screenshot<br> ><br> >=C2=A0 From my research(<a href=3D"https://phabricator.kde.org/D29407" = rel=3D"noreferrer" target=3D"_blank">https://phabricator.kde.org/D29407</a>= , <a href=3D"https://forum.kde.org/viewtopic.php%3Ff=3D305&t=3D176422.h= tml" rel=3D"noreferrer" target=3D"_blank">https://forum.kde.org/viewtopic.p= hp%3Ff=3D305&t=3D176422.html</a>), it should have been fixed by putting= the app in a root write only dir. But even after putting the app in /usr/b= in and the .desktop file in /usr/share/applications, I still cannot get rid= of this error.<br> ><br> > I am providing my .desktop file as reference if that helps.<br> > [Desktop Entry]<br> > Name=3DKool Intelligence<br> > Exec=3Dkoolintelligence<br> > Icon=3Dkde<br> > Type=3DApplication<br> > Terminal=3Dfalse<br> > Categories=3DSystem<br> > X-DBUS-ServiceName=3Dorg.kde.koolintelligence<br> > X-KDE-DBUS-Restricted-Interfaces=3Dorg.kde.kwin.Screenshot,org.kde.KWi= n.ScreenShot2<br> ><br> > Sorry for asking every small thing, I am new to this, and the lack of = documentation around this leaves me no option.<br> > Please help me solve this (hopefully) final error.<br> ><br> > A very heartfelt thanks for your support,<br> > Rahul<br> ><br> > On Fri, 4 Oct 2024 at 20:20, Vlad Zahorodnii <<a href=3D"mailto:vla= [email protected]" target=3D"_blank">[email protected]</a>> wro= te:<br> >><br> >> On 10/4/24 5:28 PM, rahul vadhyar wrote:<br> >> > Even if CaptureWorkspace returns a dictionary, I shouldn'= t be getting<br> >> > the error that the API doesn't exist.<br> >><br> >> I think that the error message is rather misleading. CaptureWorksp= ace<br> >> expects some input arguments, but the example code provides none s= o<br> >> QtDBus says that there's no CaptureWorkspace **with the specif= ied**<br> >> signature.<br> >><br> >> CaptureWorkspace expects two arguments: a dictionary with various<= br> >> options (it can be empty), and a pipe file descriptor where kwin w= ill<br> >> write screenshot to. A good example how to use that API is spectac= le or<br> >> xdg-desktop-portal-kde<br> >> <a href=3D"https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/= blob/30b9ac6a169ee9f7c36aabbec4038a8a715ac2cb/src/screenshotdialog.cpp#L158= " rel=3D"noreferrer" target=3D"_blank">https://invent.kde.org/plasma/xdg-de= sktop-portal-kde/-/blob/30b9ac6a169ee9f7c36aabbec4038a8a715ac2cb/src/screen= shotdialog.cpp#L158</a><br> >><br> >> > To provide more context, I am making a kirigami app. I am usi= ng the<br> >> > .desktop file as given in the previous email. I am also using= the<br> >> > following command for compiling and testing<br> </blockquote></div> --000000000000dbee740623b6fbbe--