View Single Post
Posts: 307 | Thanked: 488 times | Joined on Sep 2010 @ USA around Chicago
#323
Originally Posted by romu View Post
Oh great, thank you. Now, we just need to package this into something more usable than a terminal. Personaly, I can't, but I would greatly appreciate
Here is a way you can do it.

I would create a folder called scripts under nemo home directory so you can keep your scripts together. It is not are requirement.

Create a file /home/nemo/scripts/flashlight.sh and copy the following to it.

Code:
#!/bin/bash
FLASHCTL=/sys/class/leds/led\:flash_torch/brightness
FLASHON=`cat $FLASHCTL`

if [ "$FLASHON" == 0 ]
then
   /bin/echo 1 > $FLASHCTL
else
   /bin/echo 0 > $FLASHCTL
fi
Create the icon file /usr/share/applications/flashlight.desktop and copy the following. Icon=flashlight expects a png file in /usr/share/icons/hicolor/86x86/apps/flashlight.png

Code:
[Desktop Entry]
Type=Application
Icon=flashlight
Exec=/home/nemo/scripts/flashlight.sh
Name=Flash Light
The above will create an icon that turns flashlight on and off.

Hope this helps to get you going.

Edit:

Make sure the script is executable.
Code:
chmod 755 /home/nemo/scripts/flashlight.sh
__________________
Apps for iPhone & iPad
Malayalam Keyboard for iPhoneTelugu Keyboard for iPhoneGujarati Keyboard for iPhone

Last edited by abyzthomas; 2016-01-03 at 16:46.
 

The Following 7 Users Say Thank You to abyzthomas For This Useful Post: