-
Notifications
You must be signed in to change notification settings - Fork 57
/
xonsh.sh
executable file
·114 lines (87 loc) · 2.82 KB
/
xonsh.sh
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/bash
# This script is intended to setup a fresh desktop with ROS and
# with dependencies on homebrew or linuxbrew depending on the OS being used
# @author Andrew Hundt <[email protected]>
echo ""
echo "###############################################################################################"
echo "# XONSH python based shell (this file contains setup/config scripts)"
echo "###############################################################################################"
echo "# Bash to Xonsh translation http://xon.sh/bash_to_xsh.html"
echo "# "
echo "# MANUAL STEPS:"
echo "# "
echo "# First make sure you have python3 and pip3 installed!"
echo "# "
echo "# ./python.sh"
DIR=$(pwd)
# /bin/bash
set -e
set -u
set -x
# note don't install xonsh with homebrew/linuxbrew
# because it will be in a a virtualenv that can't
# access your other apps.
# https://github.com/xonsh/xonsh/issues/2475
#
# However, you can work around this by using
# the xonsh included xip, which is like pip
# but makes sure to use you xonsh environment.
###########################
# Configuring your system
# about .xonshrc:
# http://xon.sh/xonshrc.html
#
# Customizing your xonshrc:
# http://xon.sh/customization.html
# If you want to customize your paths based on the directory
# you are in to automatically be set up for different projects,
# you will want to use events:
#
# http://xon.sh/tutorial_events.html
#
# Specifically on_chdir: http://xon.sh/events.html#on-chdir-olddir-str-newdir-str-none
#
###########################
# Environment Variables
#
# these are the variables you can set to change how things run.
# like how history works, path completion, etc
#
# http://xon.sh/envvars.html
###########################
# Extensions
# for details see:
# http://xon.sh/xontribs.html
############################
# History
#
# http://xon.sh/tutorial_hist.html
###########################
# Python Install
./python.sh
############################
# Xonsh Install
pip3 install gnureadline pygments prompt_toolkit ply psutil ipykernel matplotlib xonsh xonsh-vox-tabcomplete xontrib-z xontrib-fzf-widgets --upgrade --user
############################
# Install
if [ ! -f $HOME/.xonshrc ] ; then
ln -s $DIR/.xonshrc $HOME/.xonshrc
# sometimes you can't run chsh...
if [ -x "$(command -v ypchsh)" ] ; then
echo "TODO(ahundt) fix chsh... doesn't work on this platform right now... see robotics_setup/README.md"
#ypchsh -s $(which zsh)
else
chsh -s $(which xonsh)
fi
fi
############################
# xonsh config.json. Disabled because it is no longer supported in Xonsh 0.9.x
# if [ ! -f $HOME/.config/xonsh/config.json ] ; then
# mkdir -p $HOME/.config/xonsh/
# ln -s $DIR/.config/xonsh/config.json $HOME/.config/xonsh/config.json
# fi
############################
# .xonshrc
if [ ! -f $HOME/.xonshrc ] ; then
ln -s $DIR/.xonshrc $HOME/.xonshrc
fi