Last active
June 28, 2017 11:06
-
-
Save abidibo/db1527a4dd906fb4b92ce6db4895b556 to your computer and use it in GitHub Desktop.
webdev and appdev scripts to automate startup dev screens and tools
This file contains 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/bash | |
if [ -z "$1" ]; then | |
echo "Usage: . appdev [ProjectName]" | |
else | |
window=dev:0 | |
project=$1 | |
cd ~/Dev/mobile/${project} | |
tmux split-window -v | |
tmux split-window -h | |
tmux send-keys -t "2" 'npm run start' C-m | |
tmux send-keys -t "1" 'react-native run-android' C-m | |
tmux send-keys -t "0" 'cd App && reactvim' C-m | |
wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz | |
wmctrl -s 4 | |
gnome-terminal --title emulator -x bash -c "cd /home/abidibo/Android/Sdk/emulator && ./emulator -avd Nexus_6_API_23 -qemu -m 1024 -enable-kvm; bash" | |
# TODO actually check window was open | |
# https://askubuntu.com/questions/885034/how-can-i-wait-until-an-application-has-started | |
# wmctrl -r emulator -t4 | |
sleep 3 | |
wmctrl -s 5 | |
nohup chromium-browser http://localhost:8081/debugger-ui &>/dev/null & | |
sleep 5 | |
wmctrl -s 1 | |
fi |
This file contains 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/bash | |
if [ -z "$1" ]; then | |
echo "Usage: . webdev [project-name]" | |
else | |
window=dev:0 | |
project=$1 | |
cd ~/Web/www/${project}/${project} | |
source ../.virtualenv/bin/activate | |
tmux split-window -h | |
tmux send-keys -t "1" 'source ../.virtualenv/bin/activate' C-m | |
tmux send-keys -t "1" 'python manage.py runserver' C-m | |
tmux send-keys -t "0" 'djangovim' C-m | |
wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz | |
wmctrl -s 2 | |
nohup firefox http://localhost:8000 &>/dev/null & | |
sleep 5 | |
wmctrl -s 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment