vscode script supports vscodium and uses USER as subdirectory
gnome terminal alias to use from vscdoegiskard
parent
ade5236b01
commit
a5d1389297
|
@ -0,0 +1 @@
|
|||
alias gterm='GNOME_TERMINAL_SCREEN='\'''\'' gnome-terminal'
|
|
@ -1,6 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
command -v code >/dev/null 2>&1 || exit
|
||||
VSCODE_BIN=$(command -v code)
|
||||
VSCODE_BIN=${VSCODE_BIN:-$(command -v codium)}
|
||||
echo $VSCODE_BIN
|
||||
[[ $VSCODE_BIN ]] || { echo "no vscode binary on machine";exit; }
|
||||
echo all good
|
||||
|
||||
# set default home here
|
||||
# can pass
|
||||
|
@ -9,12 +13,11 @@ vscode () {
|
|||
local home=/opt/vscode
|
||||
home=${VSCODE_HOME:-$home}
|
||||
[[ $1 == "-h" ]] && home=$2 && shift 2
|
||||
mkdir -p $home
|
||||
[[ $? -ne 0 ]] && echo "unable to set vscode home at $home, aborting" && return 1
|
||||
exts=${home}/extensions
|
||||
user=${home}/user
|
||||
exe=$(command -v code)
|
||||
$exe --user-data-dir=$user --extensions-dir=$exts "$@"
|
||||
mkdir -p ${home}/${USER}
|
||||
[[ $? -ne 0 ]] && echo "unable to set vscode home at $home/$USER, aborting" && return 1
|
||||
exts=${home}/${USER}/extensions
|
||||
user=${home}/${USER}/data
|
||||
$VSCODE_BIN --user-data-dir=$user --extensions-dir=$exts "$@"
|
||||
}
|
||||
|
||||
# # if script was executed then call the function
|
||||
|
|
Reference in New Issue