Simon34545 / lginputhook

Allows for remapping remote buttons on LG WebOS TVs.
BSD 3-Clause "New" or "Revised" License
55 stars 2 forks source link

hooks do not persist on "true" reboot (eg Quick Start+ is off or power is lost) #13

Open reticivis-net opened 1 year ago

reticivis-net commented 1 year ago

when the TV truly reboots (either through losing power, crashing, or Quick Start+ being disabled), the keybinds are lost until the app is opened again. the homebrew channel has a way to run scripts on boot https://github.com/webosbrew/webos-homebrew-channel/issues/2

ssorgatem commented 6 months ago

So, how should we make it auto start?

Pottu221 commented 6 months ago

Heres what i did...

  1. Download and install filezilla
  2. Open it and click the "File" at the left top corner
  3. Then click "site manager"
  4. Click "Protocol" and change it to "SFTP"
  5. Then add your TV´s ip address and port 22 and login info
  6. After that click "connect" and ok
  7. Then move to the "/media/developer/apps/usr/palm/services/org.webosbrew.hbchannel.service" directory and find "startup.sh" file
  8. After move it to your desktop or whatever you prefer to do.
  9. Open the file with notepad++

10.After that i modified the last lines to look like this

    # Automatically elevate Homebrew Channel service
    if [[ -x /media/developer/apps/usr/palm/services/org.webosbrew.hbchannel.service/elevate-service ]]; then
        /media/developer/apps/usr/palm/services/org.webosbrew.hbchannel.service/elevate-service
    fi

    # Run user startup hooks
    if [[ -d /var/lib/webosbrew/init.d ]]; then
        run-parts /var/lib/webosbrew/init.d
    fi
    # Reset failsafe flag after a while
    sleep 10
    rm /var/luna/preferences/webosbrew_failsafe
fi
  1. After that i replaced the file in filezilla and its done.
ssorgatem commented 6 months ago

Or, if you're confortable with the CLI:

  1. ssh into your TV
  2. vi /media/developer/apps/usr/palm/services/org.webosbrew.hbchannel.service/startup.sh

I'll try that now.

Pottu221 commented 6 months ago

Tell me if it worked!

ssorgatem commented 6 months ago

Without modification, mine looks like this:

    # Automatically elevate Homebrew Channel service                                                                                                                                                                    
    if [[ -x /media/developer/apps/usr/palm/services/org.webosbrew.hbchannel.service/elevate-service ]]; then                                                                                                           
        /media/developer/apps/usr/palm/services/org.webosbrew.hbchannel.service/elevate-service                                                                                                                         
    fi                                                                                                                                                                                                                  

    # Run user startup hooks                                                                                                                                                                                            
    mkdir -p /var/lib/webosbrew/init.d                                                                                                                                                                                  
    run-parts /var/lib/webosbrew/init.d 200>&-                                                                                                                                                                          

    # Reset failsafe flag after a while                                                                                                                                                                                 
    sleep 10                                                                                                                                                                                                            
    rm /var/luna/preferences/webosbrew_failsafe                                                                                                                                                                         
fi

So I don't see anything to change there. But it may be working already? It seems sometimes it works and sometimes it doesn't, after a reboot.

Pottu221 commented 6 months ago

Yea it surely is very unstable

lsahnicne commented 3 months ago

Adding webos service activity using this command worked for me - a few seconds after TV is turned on the keybinds are enabled.

FPSUsername commented 1 week ago

@isahnicne Do you need to modify the command in any way?

lsahnicne commented 1 week ago

@isahnicne Do you need to modify the command in any way?

No, I did not modify it.