Skip to content

Instantly share code, notes, and snippets.

@lopesivan
Created April 26, 2026 08:30
Show Gist options
  • Select an option

  • Save lopesivan/d45b829815b5c21af35cbcfce3e7e6a3 to your computer and use it in GitHub Desktop.

Select an option

Save lopesivan/d45b829815b5c21af35cbcfce3e7e6a3 to your computer and use it in GitHub Desktop.
workspace-setup.sh
#!/bin/bash
echo "Setting up workspace ..."
dirs=(
ibus-table
tracker3
gtk-3.0
ibus
JNA
evolution
go-build
gtk-4.0
Google
main.kts.compiled.cache
vmware
mesa_shader_cache
fontconfig
gstreamer-1.0
gnome-desktop-thumbnailer
nvim-pde
thumbnails
pip
update-manager-core
ranger
ubuntu-report
Homebrew
JetBrains
google-chrome)
c=/home/ivan/.config
C=/home/ivan/.cache
L=/home/ivan/.local
# remove o diretório /home/ivan/.cache
test -d $C && rm -rf $C
# crie a estrutura do diretório /home/ivan/.cache em /workspace/.cache
for d in ${dirs[*]}; do
mkdir -p /workspace/.cache/$d
done
# ln -s /home/ivan/.config/jdtls /home/ivan/.cache
ln -s $c/jdtls $C
# se existe o link /home/ivan/.cache -> /workspace/.cache então remova
test -L $C && rm $C
# crie o link /home/ivan/.cache
ln -s /workspace/.cache /home/ivan
#
dirs=(
CLionProjects
IdeaProjects
PycharmProjects
RiderProjects
RubymineProjects
AndroidStudioProjects
WebstormProjects
DialogBlocksProjects
RustroverProjects
unity
Projects
obs)
for d in ${dirs[*]}; do
# se existe diretório em ~/$d então remova
_d=/home/ivan/$d
test -d "$_d" && rm -rf "$_d"
# se existe diretório em /workspace/$d então crie
test -d /workspace/"$d" || mkdir /workspace/"$d"
# if exist link `~/$d' then remove.
_l=/home/ivan/$d
test -L "$_l" && rm "$_l"
# crie links que apontam para os diretórios criados.
ln -s /workspace/"$d" /home/ivan
done
o=/workspace/QtDesignStudio
d=/home/ivan/Documentos
test -d $o || mkdir -p $o
test -L ${d}/QtDesignStudio && rm ${d}/QtDesignStudio
ln -s $o $d
o=/workspace/go/src
d=/home/ivan/go/1.23.1
test -d $o || mkdir -p $o
test -L ${d}/src && rm ${d}/src
ln -s $o $d
o=/workspace/.npm
d=/home/ivan/
test -d $o || mkdir -p $o
ln -s $o $d
o=/workspace/.wxwidgets
d=/home/ivan/.local/wxwidgets
test -d $o || mkdir -p $o
ln -s $o $d
o=/workspace/.gradle
d=/home/ivan/
test -d $o || mkdir -p $o
ln -s $o $d
o=/workspace/.java
d=/home/ivan/
test -d $o || mkdir -p $o
ln -s $o $d
L=/home/ivan/.local
c=/home/ivan/.config
s=/home/ivan/.local/share
C=/home/ivan/.cache
_L=$s/jupyter
test -L $_L && rm $_L
ln -s $c/jupyter $s/jupyter
_L=$s/nvim-pde
test -L $_L && rm $_L
ln -s $c/nvim-pde-local $s/nvim-pde
mkdir -p /home/ivan/.local/share/nvim/shada
mkdir -p /home/ivan/.local/share/nvim-pde/shada
touch /home/ivan/.local/share/nvim/shada/main.shada
touch /home/ivan/.local/share/nvim-pde/shada/main.shada
nvim -u NORC --headless -c 'qall'
_L=$s/.cpan
test -L $_L && rm $_L
ln -s $c/cpan $s/.cpan
_L=$C/winetricks
test -L $_L && rm $_L
ln -s $c/winetricks $C
_L=$s/qutebrowser
test -L $_L && rm $_L
ln -s $c/qutebrowser/qutebrowser $s
_L=$C/devbox
test -L $_L && rm $_L
ln -s $c/devbox $C
_L=$C/matplotlib
test -L $_L && rm $_L
ln -s $c/plot/matplotlib $C
#godot
c=/home/ivan/.config
C=/home/ivan/.cache
s=/home/ivan/.local/share
_L=$s/godot
test -L $_L && rm $_L
ln -s $c/godot/godot $s
# Git
#git clone /home/ivan/git/neovim-pde /workspace/neovim-pde
TARGET=/workspace
chown ivan:ivan -R $TARGET
#chown ivan:ivan -R /home/ivan/.local
echo 0 >/tmp/workspace-activated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment