Skip to content

Commit

Permalink
Add a bashrc with a PS1 to improve the flatpak shell
Browse files Browse the repository at this point in the history
  • Loading branch information
Job79 committed Dec 13, 2023
1 parent e42aba9 commit 9507442
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if [[ $- == *i* ]]
then
PS1='[📦 \w]\$ '
fi
7 changes: 7 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ endforeach

first_run_template = files(get_option('first_run_template'))
sdk_update_template = files(get_option('sdk_update_template'))
bashrc_filename = fs.name(get_option('bashrc'))
first_run_filename = fs.name(get_option('first_run_template'))
sdk_update_filename = fs.name(get_option('sdk_update_template'))

Expand All @@ -46,6 +47,7 @@ wrapper_data = configuration_data({
'EDITOR_BINARY': editor_path,
'EDITOR_ARGS': ' '.join(editor_args),
'EDITOR_TITLE': get_option('editor_title'),
'BASHRC': join_paths(datadir, bashrc_filename),
'FIRST_RUN_README': join_paths(datadir, first_run_filename),
'SDK_UPDATE_README': join_paths(datadir, sdk_update_filename),
'FLAGFILE_PREFIX': get_option('flagfile_prefix'),
Expand All @@ -67,6 +69,11 @@ configure_file(input: 'vscode.sh',
install_dir: get_option('bindir'),
install_mode: 'rwxr-xr-x')

configure_file(input: 'bashrc',
output: bashrc_filename,
copy: true,
install_dir: datadir)

configure_file(input: first_run_template,
output: first_run_filename,
configuration: readme_data,
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ option('editor_title', type: 'string', value: 'Visual Studio Code')
option('program_name', type: 'string', value: 'code')
option('flatpak_id', type: 'string')
option('sdk_version', type: 'string')
option('bashrc', type: 'string', value: 'bashrc')
option('first_run_template', type: 'string', value: 'first_run.txt')
option('sdk_update_template', type: 'string', value: 'sdk_update.txt')
option('flagfile_prefix', type: 'string', value: 'flatpak-vscode')
Expand Down
1 change: 1 addition & 0 deletions vscode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ if [ "${FLATPAK_ISOLATE_GEM}" -ne 0 ]; then
fi
fi

export ENV="@BASHRC@"
export FLATPAK_IDE_ENV=1

if [ ! -f "${FIRST_RUN}" ]; then
Expand Down

0 comments on commit 9507442

Please sign in to comment.