# Ubuntu App Center/Snap Store/Software example

The name of the snap is  `snap-store`, this is used in many places.  

The library has to be copied into the local snap folder of the application.  
The location of the library is distribution dependent, folder in home might only appear after first run.  
`cp /path/to/libgtk-nocsd.so.0 ~/snap/snap-store/current/`

App Center has the executable `snap-store`. `~/.local/bin/snap-store` has to be created as an executable file, with this content:
```
#!/usr/bin/env bash

echo "LD_PRELOAD=\$SNAP_USER_DATA/libgtk-nocsd.so.0 \$SNAP/bin/software '$@'" | snap run --shell snap-store
```

Then, as a last step, the .desktop file has to be edited to open the modified version instead.  
`/var/lib/snapd/desktop/applications/snap-store_snap-store.desktop` is the one for App Center.  
The file has to be copied into  `~/.local/share/applications/`.  
`cp /var/lib/snapd/desktop/applications/snap-store_snap-store.desktop ~/.local/share/applications/`  
Then the Exec line has to be edited and replaced with `~/.local/bin/snap-store %U`:  
`sed -i "s/^Exec=.*$/Exec=~\/.local\/bin\/snap-store %U/" ~/.local/share/applications/snap-store_snap-store.desktop`

Optional for terminal usage:  
PATH needs to be set up correctly, for example my `~/.bash_profile` has this line:
```
export PATH=/home/morsmortium/.local/bin:$PATH
```
This means that the local executable will be used instead of the system one, if available.  

After all this, if App Center is opened from the app launcher or from the command line with `snap-store`, it will open without CSD.  
It can be opened without this applied with using `/snap/bin/snap-store` from the command line, which goes around `~/.local/bin/snap-store`.
