Not working anymore: single click to launch Pd patch from USB

A little bit of chown goes a long way: If you set up the place where externals get installed to be owned by pi, then you can install them while you are logged, using pd graphically, and later run the same patches from the button (which runs them as root). Here’s my externals directory:

pi@mupi   ~
[742] : ls -ld /usr/local/lib/pd-externals/
drwxr-sr-x 5 pi pi 4096 Sep  9 15:06 /usr/local/lib/pd-externals//

pi@mupi   ~
[743] : ls -l /usr/local/lib/pd-externals/
total 524
drwxr-sr-x 2 pi pi   4096 Nov 15  2016 abl_link~/
-rw-r--r-- 1 pi pi   2967 Aug 31 22:19 abl_link~-help.pd
-rwxr-xr-x 1 pi pi 512652 Aug 31 22:21 abl_link~.pd_linux*
drwxr-sr-x 2 pi pi   4096 Jul 29  2016 freeverb~/
drwxr-sr-x 2 pi pi   4096 Nov 18  2015 ggee/
-rw-r--r-- 1 pi pi   2140 Jul 29  2016 output~.pd

Fear not, @anon86906493, as you can see I’ve got several externals installed there, and I can use them all from patches launched by the button.

The command for setting this up would be:

sudo chown -R pi:pi /usr/loca/lib/pd-externals

If sym-link or hard link /root/.pdsettings to /home/pi/.pdsettings, as @Giedrius suggests, then when you File > Preferences > Save All Settings from pd graphically, you’ll be saving the same settings that will be used when patches are launched from the button. This works well for getting the search paths right. Note that the button script explicitly sets some parameters on the command line - and those will override your preferences, so if you need to changed, change the script or remove them from the script and change in your preferences.

The command for setting this up would be:

sudo ln -s  /home/pi/.pdsettings /root/.pdsettings

Alternatively, you could edit single-click.sh script to launch pd as the pi user:

nohup sudo -u pi puredata ...
1 Like