Keyboard shortcut doesnt output random numbers
Posted: Sat Aug 04, 2018 1:50 am
Hello there.
Im trying to configure a keyboard shortcut on Raspbian using the default GUI environnement, Openbox.
Im using the following piece of code I wrote to take screenshots using the raspi2png library wich supports OpenGL capture.
I modified the following configuration file: /home/pi/.config/openbox/lxde-pi-rc.xml
My goal is simple; When I hit CTRL+Alt+P, I want it to take a screenshot named with a random number.
Here is the code:
Dont get me wrong; it works. But the "${RANDOM}" doesnt output a random number; it simply outputs "${RANDOM}".
Buut I tested the command in lxterminal and it outputs the random number...
What am I doing wrong?
Cheers.
Im trying to configure a keyboard shortcut on Raspbian using the default GUI environnement, Openbox.
Im using the following piece of code I wrote to take screenshots using the raspi2png library wich supports OpenGL capture.
I modified the following configuration file: /home/pi/.config/openbox/lxde-pi-rc.xml
My goal is simple; When I hit CTRL+Alt+P, I want it to take a screenshot named with a random number.
Here is the code:
Code: Select all
</keybind>
<keybind key="C-A-P">
<action name="Execute">
<command>raspi2png -p Desktop/Screenshots/snap${RANDOM}.png</command>
</action>
</keybind>
Buut I tested the command in lxterminal and it outputs the random number...
What am I doing wrong?
Cheers.