Score:1

Stop sound alerts for import screenshot called from bash

ru flag

I'm running a loop to capture my desktop every minute in order to create a time-lapse movie.

The command is simply:

while true; do d=`date +"%Y-%m-%d-%H%M"`; import -window root ${d}.png; sleep 1m; done

The annoying thing is that the default alert "beep" sounds every time it fires. I've changed the settings in the terminal to untick "Terminal bell", but I still get the sound. I don't want to disable sound completely, or even to cancel all alerts, I just want this job (or its hosting terminal) to be literally quiet.

I'm running Ubuntu 22.04.02 LTS and GNOME 42.5.

Raffa avatar
jp flag
`while true; do d=$(date +"%Y-%m-%d-%H%M"); import -silent -window root ${d}.png; sleep 1m; done`
Mr Felix U avatar
ru flag
Perfect answer for my specific situation, I guess I was asking the question too generally. Thank you @Raffa
Score:1
jp flag

From man import:

-silent operate silently, i.e. don't ring any bells

So you can use the -silent option like so:

while true; do d=$(date +"%Y-%m-%d-%H%M"); import -silent -window root ${d}.png; sleep 1m; done

Please also notice that back-ticks for command substitution are deprecated in favor of $(...) in bash.

I sit in a Tesla and translated this thread with Ai:

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.