# Pisound simple script launch button problem

**URL:** <https://community.blokas.io/t/pisound-simple-script-launch-button-problem/5249>\
**Category:** Support\
**Created:** [May 13, 2024, 10:08am UTC](https://community.blokas.io/t/pisound-simple-script-launch-button-problem/5249 "2024-05-13T10:08:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![diemonsterdie](https://community.blokas.io/letter_avatar_proxy/v4/letter/d/8797f3/32.png) [@diemonsterdie](https://community.blokas.io/u/diemonsterdie)\
**Post date:** [May 13, 2024, 10:08am UTC](https://community.blokas.io/t/pisound-simple-script-launch-button-problem/5249/1 "2024-05-13T10:08:11Z")

</div>

Hi there,  
I’m clueless.  
I’m in need of lauching a video (m4v) using the Button.

I made a script to lauch the vid via VLC (cvlc).  
Using  
bash ./myscript.sh  
It works.

Stored in the pisound button scripts folder, i can use the pisound config to assign the button to myscript.sh

But pressing the button, it won’t lauch.  
What am i missing?  
Thanks

---

<div class="post-metadata">

**Author:** ![diemonsterdie](https://community.blokas.io/letter_avatar_proxy/v4/letter/d/8797f3/32.png) [@diemonsterdie](https://community.blokas.io/u/diemonsterdie)\
**Post date:** [May 13, 2024, 11:56am UTC](https://community.blokas.io/t/pisound-simple-script-launch-button-problem/5249/2 "2024-05-13T11:56:57Z")

</div>

Mmm.  
In case Pisound was unable to lauch a script with a vlc, i made an other script that launches the main script.  
Now i have a VLC “cannot be used as root” problem, so, my guess is it is more of a VLC issue.

---

<div class="post-metadata">

**Author:** ![Giedrius](https://community.blokas.io/letter_avatar_proxy/v4/letter/g/6a8cbe/32.png) [@Giedrius](https://community.blokas.io/u/Giedrius)\
**Post date:** [May 14, 2024, 6:39am UTC](https://community.blokas.io/t/pisound-simple-script-launch-button-problem/5249/3 "2024-05-14T06:39:47Z")

</div>

Pisound button scripts are executed as root user, you may have to set some environment variables for the display environment and change the user if necessary. Things like:

```auto
su pi -c "DISPLAY=:0 vlc ..." &

```

Note the & at the end - it starts the process in background mode, otherwise, the button won’t respond, until the last started process exits.

Or just invoke your own .sh script through a button script using `su`.

---

<div class="post-metadata">

**Author:** ![diemonsterdie](https://community.blokas.io/letter_avatar_proxy/v4/letter/d/8797f3/32.png) [@diemonsterdie](https://community.blokas.io/u/diemonsterdie)\
**Post date:** [May 15, 2024, 9:41am UTC](https://community.blokas.io/t/pisound-simple-script-launch-button-problem/5249/4 "2024-05-15T09:41:40Z")

</div>

Hey, Giedrius!  
I cant thank you enough.  
I was looking for how launch it as a user and your line of code worked like a charm.  
I added a pkill function to the button double click, and we ‘re all set !  
Problem solved !  
Thank you !
