Add l5-flashlight application
This commit is contained in:
parent
2556299314
commit
f8e5e07a22
2
Makefile
2
Makefile
|
@ -1,2 +1,2 @@
|
|||
all:
|
||||
shellcheck l5-contacts-importer l5-screenshot
|
||||
shellcheck l5-contacts-importer l5-screenshot l5-flashlight
|
||||
|
|
|
@ -25,3 +25,4 @@ Description: Librem 5 Goodies
|
|||
- L5 Contacts Importer: A simple application to import contacts from a vcard
|
||||
file to GNOME Contacts.
|
||||
- L5 Screenshot: A simple application to make screenshots on the Librem 5
|
||||
- L5 Flashlight: A simple application to control the torch on the Librem 5
|
||||
|
|
|
@ -2,3 +2,5 @@ l5-contacts-importer /usr/bin
|
|||
l5-contacts-importer.desktop /usr/share/applications
|
||||
l5-screenshot /usr/bin
|
||||
l5-screenshot.desktop /usr/share/applications
|
||||
l5-flashlight /usr/bin
|
||||
l5-flashlight.desktop /usr/share/applications
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
Test-Command: /usr/bin/l5-contacts-importer --help && /usr/bin/l5-screenshot --help
|
||||
Test-Command: /usr/bin/l5-contacts-importer --help && /usr/bin/l5-screenshot --help && /usr/bin/l5-flashlight --help
|
||||
Restrictions: superficial
|
||||
Depends: librem5-goodies
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
function usage()
|
||||
{
|
||||
echo "Usage: $0, or just press the Flashlight Icon in the app tray"
|
||||
exit 0
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
--help|-h|-?)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# Enable the LED so we can poll its state
|
||||
sudo bash -c 'echo 255 > /sys/class/leds/flash_en/brightness'
|
||||
|
||||
yad --title flashlight --form \
|
||||
--field='Flashlight ON!switch-on-symbolic':fbtn "sudo i2cset -y 1 0x53 0x10 0x1a" \
|
||||
--field='Flashlight OFF!switch-off-symbolic':fbtn "sudo i2cset -y 1 0x53 0x10 0x18" \
|
||||
--button='Close!gtk-cancel':1
|
||||
|
||||
sudo bash -c 'echo 0 > /sys/class/leds/flash_en/brightness'
|
||||
exit
|
|
@ -0,0 +1,6 @@
|
|||
[Desktop Entry]
|
||||
Name=Flashlight
|
||||
Type=Application
|
||||
Icon=system-shutdown
|
||||
Exec=flashlight
|
||||
Categories=Utility;
|
Loading…
Reference in New Issue