diff --git a/Kobo/KoboAuraTapHomeIcon.bin b/Kobo/KoboAuraTapHomeIcon.bin new file mode 100644 index 000000000..04d7793c3 Binary files /dev/null and b/Kobo/KoboAuraTapHomeIcon.bin differ diff --git a/Kobo/KoboMiniTapHomeIcon.bin b/Kobo/KoboMiniTapHomeIcon.bin new file mode 100644 index 000000000..da61f0602 Binary files /dev/null and b/Kobo/KoboMiniTapHomeIcon.bin differ diff --git a/Kobo/KoboTouchHomeButton.bin b/Kobo/KoboTouchHomeButton.bin new file mode 100644 index 000000000..544c4c8c0 Binary files /dev/null and b/Kobo/KoboTouchHomeButton.bin differ diff --git a/Makefile b/Makefile index 90059d069..e697577e7 100644 --- a/Makefile +++ b/Makefile @@ -101,7 +101,7 @@ koboupdate: all zip -9 -r \ ../koreader-kobo-$(MACHINE)-$(VERSION).zip \ KoboRoot.tgz koreader koreader.png README_kobo.txt \ - -x "koreader/resources/fonts/*" "koreader/resources/icons/src/*" "koreader/spec/*" + -x "koreader/resources/fonts/*" "koreader/resources/icons/src/*" "koreader/spec/*" "koreader/Kobo/*" pot: $(XGETTEXT_BIN) reader.lua `find frontend -iname "*.lua"` \ diff --git a/frontend/ui/device/basepowerd.lua b/frontend/ui/device/basepowerd.lua index 2ce343b24..af36cbdf6 100644 --- a/frontend/ui/device/basepowerd.lua +++ b/frontend/ui/device/basepowerd.lua @@ -20,6 +20,7 @@ end function BasePowerD:init() end function BasePowerD:toggleFrontlight() end function BasePowerD:setIntensityHW() end +function BasePowerD:setIntensitySW() end function BasePowerD:getCapacityHW() end function BasePowerD:isChargingHW() end function BasePowerD:suspendHW() end @@ -39,6 +40,14 @@ function BasePowerD:setIntensity(intensity) self:setIntensityHW() end +function BasePowerD:setIntensityWithoutHW(intensity) + intensity = intensity < self.fl_min and self.fl_min or intensity + intensity = intensity > self.fl_max and self.fl_max or intensity + self.flIntensity = intensity + self:setIntensitySW() +end + + function BasePowerD:getCapacity() if capacity_pulled_count == capacity_cached_count then capacity_pulled_count = 0 diff --git a/frontend/ui/device/kobopowerd.lua b/frontend/ui/device/kobopowerd.lua index fef464d17..5ed20dc9b 100644 --- a/frontend/ui/device/kobopowerd.lua +++ b/frontend/ui/device/kobopowerd.lua @@ -28,6 +28,13 @@ function KoboPowerD:setIntensityHW() end end +function KoboPowerD:setIntensitySW() + if self.fl ~= nil then + self.fl:restoreBrightness(self.flIntensity) + end +end + + function KoboPowerD:getCapacityHW() self.battCapacity = self:read_int_file(self.batt_capacity_file) return self.battCapacity diff --git a/koreader_kobo.sh b/koreader_kobo.sh index 4ad714742..84171f03f 100644 --- a/koreader_kobo.sh +++ b/koreader_kobo.sh @@ -20,6 +20,26 @@ killall -STOP nickel ./reader.lua /mnt/onboard 2> crash.log # continue with nickel -#cat .last_screen_content | /usr/local/Kobo/pickel showpic -#rm .last_screen_content killall -CONT nickel + +# return to home screen +cd /mnt/onboard/.kobo/koreader/Kobo +case `/bin/kobo_config.sh * 2>/dev/null` in + dragon) #DEVICE=AURAHD + #no binary file available + ;; + phoenix) #DEVICE=AURA + cat ./KoboAuraTapHomeIcon.bin > /dev/input/event1 + cat ./KoboAuraTapHomeIcon.bin > /dev/input/event1 + ;; + kraken) #DEVICE=GLO + #no binary file available + ;; + pixie) #DEVICE=MINI + cat ./KoboMiniTapHomeIcon.bin > /dev/input/event1 + cat ./KoboMiniTapHomeIcon.bin > /dev/input/event1 + ;; + trilogy|*) #DEVICE=TOUCH + cat ./KoboTouchHomeButton.bin > /dev/input/event0 + ;; +esac \ No newline at end of file diff --git a/reader.lua b/reader.lua index ccc405307..319f6d3b8 100755 --- a/reader.lua +++ b/reader.lua @@ -174,7 +174,8 @@ do if powerd and powerd.restore_settings then local intensity = G_reader_settings:readSetting("frontlight_intensity") intensity = intensity or powerd.flIntensity - powerd:setIntensity(intensity) + powerd:setIntensityWithoutHW(intensity) + -- powerd:setIntensity(intensity) end end