Trouble executing Bash Script from keyboard binding.

Hello everyone,
I am new to the board and fvwm but I hope that someone can help me and I really hope to contribute what i can to the community. I’ve had fvwm installed for a few days and I love it. I love how much I can customize it with just alittle thinking and scripting. I have been trying to integrate some features that I am use to in other WM and I have done a pretty good job so far. But here is my problem. I am executing a script with some key binding shortcuts.

Key Up A C Exec bash ~/.fvwm/script/volume.sh up Key Down A C Exec bash ~/.fvwm/script/volume.sh down Key Right A C Exec bash ~/.fvwm/script/volume.sh osd

I have formatted these a few ways to get the desired effect ( Exec exec /bin/sh and so on).
The functionality works like a charm, if I pull up a terminal with alsamixer running, the key strokes bring the volume up and down beautifully. My problem comes with trying it integrate the volume state in conky.

${color white}Speaker Volume: ${execbar tail -n1 /home/reppard/.fvwm/script/testing}

This function works as well, conky is doing its job and reading the file.

Heres a snipit from my script

volumeUp () { VOL=$(getMasterVolume) [[ $VOL -ge 100 ]] && exit 0 setMasterVolume $((VOL + $STEP)) echo $VOL >> testing .testing }

The testing file updates fine if i execute the script from terminal and conky updates it but when I use my shortcut key bindings the volume increases or decreases but the testing file stays unchanged. Any help would be greatly appreciated.

Key ... Exec exec ~/random_file.sh

Add:

set -vx

To your shell script and then look on STDERR to see what it’s doing. FVWM typically logs to ~/.xsession-errors by default.

– Thomas Adam

Add:

set -vx

To your shell script and then look on STDERR to see what it’s doing. FVWM typically logs to ~/.xsession-errors by default.

– Thomas Adam
[/quote]
Thank you Thomas for your speedy reply. That gave me some input, log had the script complaining about the file not being there…which it was. The log is still complaining about it but I got it working. Your advice atleast made me rethink my approach. All I did was specify the path as a variable:

TEST="/home/reppard/.fvwm/script/testing.txt"

And write to that variable:

volumeUp () { VOL=$(getMasterVolume) [[ $VOL -ge 100 ]] && exit 0 setMasterVolume $((VOL + $STEP)) echo $VOL >> $TEST .$TEST }

Works like a charm now, thanks man!