View Single Post
Mikkosssss's Avatar
Posts: 645 | Thanked: 519 times | Joined on Apr 2012 @ Finland
#153
The flashlight from powermenu isn't working on Xperia X so I made a script for it.

If you want to get flashlight working on Xperia follow the instructions that I quoted by Morpog but replace flash.sh content with:

Code:
#!/bin/bash
# Toggle Flash
dbus-send --type=method_call --print-reply --dest=com.jolla.settings.system.flashlight /com/jolla/settings/system/flashlight com.jolla.settings.system.flashlight.toggleFlashlight
Someone could also test if the dbus method works for other devices if coderus wants to replace control file method.

Originally Posted by Morpog View Post
Instruction for Flash script:

Create a flash.sh file in /home/nemo/ with content:

Code:
#!/bin/bash
# Toggle Flash
STATUS=$(cat /home/nemo/flash.txt)
if [ $STATUS == "0" ]
	then
	echo 1 > /home/nemo/flash.txt;echo 1 > /sys/kernel/debug/flash_adp1650/mode
        else
        echo 0 > /home/nemo/flash.txt;echo 0 > /sys/kernel/debug/flash_adp1650/mode
fi
Make the script executable:
chmod +x /home/nemo/flash.sh

Create a flash.desktop file in /home/nemo/.local/share/applications/ with content:

Code:
[Desktop Entry]
Type=Application
X-Nemo-Application-Type=no-invoker
Name=Flash
Icon=icon-launcher-default
Exec=/home/nemo/flash.sh
Open powermenu --> configuration --> choose prefered action and set it to "Application" and select Flash app. Works in locked and unlocked state.
__________________
────────────────────
Try:My N9 bootvideo

Last edited by Mikkosssss; 2018-01-02 at 20:10.
 

The Following 2 Users Say Thank You to Mikkosssss For This Useful Post: