aboutsummaryrefslogtreecommitdiff
path: root/.local/share/bin/ipod-sync
blob: 62c8c80ccb4aa86bf5a1d93f1aa4890bf6bbb596 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh

UUID="81CC-A462"

if test ! -h "/dev/disk/by-uuid/$UUID"; then
	notify-send "ipod-sync" "can't find disk with uuid $UUID"
	exit 1
fi

read -r -d '' commands << EOF
echo "mounting..."
sudo mount "/dev/disk/by-uuid/$UUID" /mnt/ipod -o uid=loek,gid=users
echo "mounted"

echo "copying music..."
musicopy

echo "pushing scrobbler.log to last.fm..."
pyapplier -y -f /mnt/ipod/.scrobbler.log

echo "unmounting..."
sudo umount /mnt/ipod
echo "done! exiting..."
sleep 1
EOF

st -T "[floating]" -g "100x15--154-140" -e sh -c "$commands"