5 ms·
If I read this right then it means "every 5 second, open the last scanned page (and nothing else / close the previous one)". But this seems like an inefficient
by pflanze 5y ago
If I read this right then it means "every 5 second, open the last scanned page (and nothing else / close the previous one)". But this seems like an inefficient way to do it, opening and killing all irrelevant pages all the time. This will be more efficient and react more quickly:
lastfile=
while true; do
newestfile=$(ls *.pnm | tail -1)
if [ "$newestfile" != "$lastfile" ]; then
kill %
display -rotate 90 "$newestfile" &
lastfile=$newestfile
fi
sleep 0.3
done
- timonoko 5y ago"Saving precious bits like it is 1969". This would make an excellent song title.
- pflanze 5y agoSorry but I find your answer disappointing and crossing over into offending. I spent some time first trying to understand how your code makes sense, then to write up a better solution and posted it, and you don't seem to be thankful at all and are instead dissing my effort. Sure, if it works for you, fine, I was under the impression that you didn't know better. You could have saved me time by indicating that you know your solution is hacky but you don't care.
- timonoko 5y agoYes it is inefficient and weird. And thank you for saving the world. Not only Terran energy crisis, but we are also running out of useful data bits as universal entropy goes to infinity. https://en.wikipedia.org/wiki/Heat_death_of_the_universe https://en.wikipedia.org/wiki/Heat_death_of_the_universe
- deleted 5y ago[deleted]
- pflanze 5y agoPlease check the HN guidelines. "Be kind. Don't be snarky."
- aliswe 5y agodont take offense, i am certain that if you would call eachother up you both would get along terrifically. text is a horrible communication medium!
- pflanze 5y agoThanks. Yes, sometimes communication falls short and down, and one's own state of mind is time dependent and doesn't see everything involved. I was in an eager "would like to see positive feedback" state of mind just as timonoko may have been when originally posting their solution, and then interpreted the rejection in an overly negative light. My apologies to them and for the noise.
- deleted 5y ago[deleted]