Skip to content

Instantly share code, notes, and snippets.

@SamMousa
Created February 2, 2018 08:28
Show Gist options
  • Save SamMousa/06149950d2bfe55eb1c37f3f7723be50 to your computer and use it in GitHub Desktop.
Save SamMousa/06149950d2bfe55eb1c37f3f7723be50 to your computer and use it in GitHub Desktop.
Call via android phone from linux
#!/bin/bash
if [ ! -z "$1" ]; then
NUMBER=`zenity --entry --text "Enter phone number" --entry-text ${1:4}`
else
NUMBER=`zenity --entry --text "Enter phone number"`
fi
if [ $? -eq 0 ]
then
beep -f 600 -l 400 -r 2 &
adb shell am start -a android.intent.action.CALL -d tel:${NUMBER}
zenity --info --text "Close this window to stop the call" --modal --title "Call in progress";
adb shell input keyevent KEYCODE_ENDCALL
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment