From: Grazvydas Ignotas Date: Mon, 20 Oct 2014 00:14:28 +0000 (+0300) Subject: pandora-scripts: make op_nubmode.py update nubs.state directly X-Git-Tag: sz_172rc~35 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=openpandora.oe.git;a=commitdiff_plain;h=9d99083c7c13e1b45c910c80ca00f43b14606434;ds=sidebyside pandora-scripts: make op_nubmode.py update nubs.state directly --- diff --git a/recipes/pandora-system/pandora-scripts.bb b/recipes/pandora-system/pandora-scripts.bb index 75ec856..9732249 100644 --- a/recipes/pandora-system/pandora-scripts.bb +++ b/recipes/pandora-system/pandora-scripts.bb @@ -5,7 +5,7 @@ COMPATIBLE_MACHINE = "omap3-pandora" RDEPENDS = "bash sed gawk grep zenity" -PR = "r162" +PR = "r163" SRC_URI = " \ file://op_bright.sh \ diff --git a/recipes/pandora-system/pandora-scripts/op_nubmode.py b/recipes/pandora-system/pandora-scripts/op_nubmode.py index 8183e8b..3086271 100755 --- a/recipes/pandora-system/pandora-scripts/op_nubmode.py +++ b/recipes/pandora-system/pandora-scripts/op_nubmode.py @@ -6,6 +6,7 @@ import sys import gtk import time import optparse +import shutil # ================================================================ @@ -289,6 +290,10 @@ class NubConfig(object): def on_WriteNubConfig_clicked(self, widget, *data): StoreProc(self.model.settings) + shutil.copyfile("/etc/pandora/conf/nubs.state", "/tmp/nubs.state"); + os.system("sed -i -e '1c\%s' /tmp/nubs.state" % self.model.settings['mode0']) + os.system("sed -i -e '7c\%s' /tmp/nubs.state" % self.model.settings['mode1']) + shutil.copyfile("/tmp/nubs.state", "/etc/pandora/conf/nubs.state"); self.Notify("Nub configuration updated.") def on_SaveProfile_clicked(self, widget, *data): diff --git a/recipes/pandora-system/pandora-state.bb b/recipes/pandora-system/pandora-state.bb index 7a38bf1..d989ad5 100755 --- a/recipes/pandora-system/pandora-state.bb +++ b/recipes/pandora-system/pandora-state.bb @@ -5,7 +5,7 @@ COMPATIBLE_MACHINE = "omap3-pandora" RDEPENDS = "pandora-scripts" -PR = "r23" +PR = "r24" inherit update-rc.d INITSCRIPT_NAME = "pandora-state" diff --git a/recipes/pandora-system/pandora-state/rc.pandora-state b/recipes/pandora-system/pandora-state/rc.pandora-state index 144f1ff..3e785e7 100644 --- a/recipes/pandora-system/pandora-state/rc.pandora-state +++ b/recipes/pandora-system/pandora-state/rc.pandora-state @@ -21,6 +21,8 @@ d_stop() { fi touch /etc/pandora/shutdown cat $SYSFS_GAMMA > /etc/pandora/conf/gamma.state + + # pnd_run.sh and nub configurator depend on nubs.state format cat -v /proc/pandora/nub0/mode | sed -n '1p' > /etc/pandora/conf/nubs.state cat -v /proc/pandora/nub0/mouse_sensitivity | sed -n '1p' >> /etc/pandora/conf/nubs.state cat -v /proc/pandora/nub0/scrollx_sensitivity | sed -n '1p' >> /etc/pandora/conf/nubs.state @@ -35,6 +37,9 @@ d_stop() { cat -v /proc/pandora/nub1/mbutton_threshold | sed -n '1p' >> /etc/pandora/conf/nubs.state cat -v /proc/pandora/nub0/mbutton_delay | sed -n '1p' >> /etc/pandora/conf/nubs.state cat -v /proc/pandora/nub1/mbutton_delay | sed -n '1p' >> /etc/pandora/conf/nubs.state + + # nub tools want to update this file + chmod a+w /etc/pandora/conf/nubs.state } d_start() {