SHARE
TWEET

Sounds.index_update.sh

a guest Nov 1st, 2015 145 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. #set -x
  4. if [ ! -f /usr/share/sounds/jolla-ringtones/stereo.index.orig ]; then
  5. /bin/cp -f /usr/share/sounds/jolla-ringtones/stereo.index /usr/share/sounds/jolla-ringtones/stereo.index.orig
  6. fi
  7.  
  8. list=$(ls -1 /usr/share/sounds/jolla-ringtones/stereo)
  9.  
  10. echo "{
  11.     \"translationCatalog\" : \"jolla-ringtones\",
  12.     \"files\" : [" > /usr/share/sounds/jolla-ringtones/stereo.index
  13.  
  14. for i in $list
  15. do
  16. echo "        { \"displayName\" : \"$(echo $i|cut -d '.' -f1)\"          , \"fileName\" : \"$i\" }," >> /usr/share/sounds/jolla-ringtones/stereo.index
  17. done
  18.  
  19. echo "    ]
  20. }" >> /usr/share/sounds/jolla-ringtones/stereo.index
  21.  
  22. fix1=$(cat /usr/share/sounds/jolla-ringtones/stereo.index|tail -3|head -1)
  23. fix2=$(cat /usr/share/sounds/jolla-ringtones/stereo.index|tail -3|head -1|sed 's/},/}/')
  24. sed -i -e 's@'"$fix1"'@'"$fix2"'@g' /usr/share/sounds/jolla-ringtones/stereo.index
  25.  
  26. systemctl-user restart ambienced
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top