Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # read user input
- speed=0.0
- animator=1.0
- default=0.6
- if [ "$1" = "enable" ]; then
- check=`echo "$2" | grep -E ^\-?[0-9]*\.?[0-9]+$`
- if [ "$check" != '' ]; then
- # got a number arg
- speed=$2
- else
- # no number arg, default to $default
- speed=$default
- fi
- elif [ "$1" == "disable" ]; then
- animator=0.0
- else
- # unknown command, explain
- echo -e "\n----- Usage -----\n"
- echo -e "~$: device_animations enable"
- echo -e " - Window animation speed: $default"
- echo -e " - Transitions animation speed: $default"
- echo -e " - Animator speed: 1.0\n"
- echo -e "~$: device_animations enable 0.2"
- echo -e " - Window animation speed: 0.2"
- echo -e " - Transitions animation speed: 0.2"
- echo -e " - Animator speed: 1.0\n"
- echo -e "~$: device_animations disable"
- echo -e " - Window animation speed: 0.0"
- echo -e " - Transitions animation speed: 0.0"
- echo -e " - Animator speed: 0.0\n"
- exit
- fi
- # read old values
- echo -e "\n----- Before change -----\n"
- echo -e "Window animation speed: '`adb shell settings get global window_animation_scale`'"
- echo -e "Transitions animation speed: '`adb shell settings get global transition_animation_scale`'"
- echo -e "Animator speed: '`adb shell settings get global animator_duration_scale`'"
- # change values
- echo -e "\n----- Changing to '$speed' -----\n"
- adb shell settings put global window_animation_scale $speed
- adb shell settings put global transition_animation_scale $speed
- adb shell settings put global animator_duration_scale $animator
- echo -e "Done."
- # read new values
- echo -e "\n----- After change -----\n"
- echo -e "Window animation speed: '`adb shell settings get global window_animation_scale`'"
- echo -e "Transitions animation speed: '`adb shell settings get global transition_animation_scale`'"
- echo -e "Animator speed: '`adb shell settings get global animator_duration_scale`'\n"
Add Comment
Please, Sign In to add comment