Score:0

How to make `gnome-screenshot` or `flameshot` work in crontab under Wayland?

ng flag

I am using Ubuntu 21.04 under GNOME on Wayland. I want to take the screenshot every minute and save them to a designated folder. The simplest thing I can think of is using crontab which is available out-of-the-box in Ubuntu. There are only a handful of programs that can take screenshots under GNOME on Wayland - including gnome-screnshot and flameshot. However despite the fact these programs work from the Ubuntu terminal, they do not work when run in a cron. I guess this problem is specific to Wayland as I was successful in taking screenshot in a cron under GNOME on Xorg using scrot which is a screenshot program working in X.

I would like to stick to GNOME on Wayland because it has some advantages over X. I would like to know:

  • What screenshot software works in crontab under GNOME on Wayland?
  • Any workarounds to make flameshot or gnome-screenshot work in crontab?

Thank you so much.

HuHa avatar
es flag
I'd keep that simple and rely on a script with `sleep 60` between the screenshots.
Microtribute avatar
ng flag
@HuHa Can you possibility tell me how to make the script run automatically after I log in? Let's say the script only runs for a specific user.
HuHa avatar
es flag
You could simply add it to that user's autostart directory: Create a .desktop file for the script and put it into that user's `.config/autostart`.
heynnema avatar
ru flag
re: *"I want to take the screenshot every minute and save them to a designated folder."*... why do you want to do this... and why for a specific user? Sounds like a major privacy/spying issue...
Microtribute avatar
ng flag
@Huha Thank you for the solution. That works for me well.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.