Created
August 9, 2014 22:34
-
-
Save vrs/54938ef173b120eff12b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# canything can be found here: https://github.com/keiji0/canything | |
focus=$(xdotool getwindowfocus) | |
list="./folders" | |
tosort=$1 | |
if [ -z "$tosort" ] | |
then | |
echo "read script source." | |
exit 1 | |
fi | |
for file in "$tosort/"*; do | |
feh -d. "$file" & | |
sleep 0.3 | |
xdotool windowfocus "$focus" | |
dest=$(sort "$list" |uniq -c |sort -nr |sed 's/^ *//' |canything |sed 's/^[0-9]* *//' |tee -a "$list") | |
mv -v -n -t "$dest" "$file" | |
killall feh | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment