How to use spectacle from cli only

I would like to use spectacle to take a screenshot from a bash script to capture a rarely happening bug crash. What is the cli syntax for using spectacle? I have found spectacle -b not very helpful, as I cannot define the output file naming that way. Also it would be nice to use the spectacle cli completely independent from the manual gui (no setting change from cli to gui). Is this possible?
If not - can someone recommend me a program that can do this on wayland? scrot was great for x11, and spectacle is great for the gui stuff, so I would prefer spectacle.

all the command line switches are spelled out in the manual

man spectacle

you probably want to use the -o filename switch

1 Like

Thank you, I read the manual but it was not very verbose. I found the screenshotting did not suite the bugfinding anyway. Cheers

Have a go with FISH…

If you use bash, or zsh, it’s easy to type ‘fish’ and use it temporarily if you don’t like it as a default…

Then type spectacle - and hit space:

I find this MUCH easier than tldr and/or man.

installed fish along with zsh-autosuggestions and zsh-syntax-highlighting and still don’t see what you see on my console.

i only see the preview on the single line, not the rest of it.

is there some other package or default i need to turn on?

I think that’s TIDE prompt, do tide configure, then maybe '1 lean, 1 truecolour, 1no time 1or 2 for number of lines (mine’s 2) 1disconnected, 2 sparse 1 few icons

Have you tried spectacle --help?

1 Like

This week I worked out that, from a phone with KDE Connect, you can ask for a screenshot as long as you’re connected to WiFi by adding a command :wink:

file=/tmp/$(hostname)_$(date "+%Y%m%d_%H%M%S").png; spectacle -bno "${file}" && kdeconnect-cli -d $(kdeconnect-cli -a --id-only) --share ${file}