#!/bin/sh # DBus interface to FreeSmartPhone. BUS='org.freesmartphone.odeviced' IDLE_SERVICE='/org/freesmartphone/Device/IdleNotifier/0' TIMEOUT_OBJECT='org.freesmartphone.Device.IdleNotifier.SetTimeout' DISPLAY_SERVICE='/org/freesmartphone/Device/Display/0' BRIGHT_OBJECT='org.freesmartphone.Device.Display.SetBrightness' # We use fsoraw to allocate GPS. ## Turn on GPS power. ## With fso-gpsd instead of gpsd, power will be turned on/off automatically. ## Unfortunately fso-gpsd compatibility layer is not longer ## compatible with Navit. #GPS_POWER="$(om gps power)" #if [ "$GPS_POWER" != "1" ]; then # om gps power 1 #fi # Disable X.org screensaver. # # NOTICE: There is also a FSO screensaver triggered by # IdleNotifier status change. Look at # /etc/freesmartphone/oevents/rules.yaml # # Forces deactivation of X.org screensaver if it is active. xset s reset # Disables screensaver functions. xset s off # Disables DPMS (Energy Star) features. xset -dpms # TODO: Recover from screen locked! (power button does, anyway) ## Disable FreeSmartPhone idle timeout (old DBus interface). ## Values are saved automatically in /etc/frameworkd.conf. #mdbus2 -s org.freesmartphone.odeviced \ # /org/freesmartphone/Device/IdleNotifier/0 \ # org.freesmartphone.Device.IdleNotifier.SetTimeout idle 0 # Disable FreeSmartPhone idle timeout (new DBus interface). # Values are saved into /etc/freesmartphone/conf/GTA02/fsodeviced.conf. # To disable a timeout, set it to -1 echo "$BUS $IDLE_SERVICE $TIMEOUT_OBJECT idle_dim -1" | mdbus2 -s -i 2> /dev/null # NOTICE: Not valid anymore: must use the FSO DBus! ## Set OpenMoko screen brightness. ##om backlight brightness 100 ## om screen power 1 # Set backlight brightness to 100% echo "$BUS $DISPLAY_SERVICE $BRIGHT_OBJECT 100" | mdbus2 -s -i 2> /dev/null export LANG=it_IT.UTF-8 fsoraw --force --resources=GPS,Display -- /usr/bin/navit # We used fsoraw to allocate GPS. ## Turn off GPS power. ## See above about fso-gpsd. #if [ "$GPS_POWER" != "1" ]; then # om gps power 0 #fi # Restore X.org screensaver. # # NOTICE: See above about FSO screensaver. # # Enables DPMS (Energy Star) features. xset +dpms # Restores default screensaver settings. xset s default ## Restore FreeSmartPhone idle timeout (old DBus interface). #mdbus2 -s org.freesmartphone.odeviced \ # /org/freesmartphone/Device/IdleNotifier/0 \ # org.freesmartphone.Device.IdleNotifier.SetTimeout idle 20 # Restore FreeSmartPhone idle timeout (new DBus interface). echo "$BUS $IDLE_SERVICE $TIMEOUT_OBJECT idle_dim 20" | mdbus2 -s -i 2> /dev/null