jtheoof / swappy

A Wayland native snapshot editing tool, inspired by Snappy on macOS
MIT License
1k stars 40 forks source link

unable to load file: /tmp/swappy-stdin-WCN1M2.png #174

Closed cosme-benito closed 3 months ago

cosme-benito commented 4 months ago

When running the command grim -g "$(slurp)" - | swappy -f - I get the error:

unable to load file: /tmp/swappy-stdin-WCN1M2.png - reason: Couldn’t recognize the image file format for file “/tmp/swappy-stdin-WCN1M2.png”

I thought it was some permission error or something so I created the file $HOME/.config/swappy.config with the contents:

[Default]
save_dir=$HOME/Pictures/screenshots
save_filename_format=swappy-%Y%m%d-%H%M%S.png
show_panel=true
line_size=5
text_size=20
text_font=sans-serif
paint_mode=brush
early_exit=false
fill_shape=false

Unfortunately this does not solve the problem, the configuration is likely being ignored. This used to work, maybe some dependency is broken/missing?

tkna91 commented 3 months ago

If you write it this way, it looks fine.

file=$HOME/Pictures/screenshots/swappy-$(date +%Y%m%d-%H%M%S).png
grim -g "$(slurp)" - | swappy -f - -o $file
cosme-benito commented 3 months ago

Turns out the problem was completely unrelated to swappy. My $XDG_DATA_DIRS was broken and unsetting it solved the problem.