Using hook_js_alter to change localsettings variable in the autologout module drupal I want to know how to use hook_js_alter to change the localSettings variable in autologout.js.

In autologout.module in line number ( 377 - 389)

$settings = array(
    'timeout' =&gt; $refresh_only ? ($timeout * 500) : ($timeout * 1000),
    'timeout_padding' =&gt; $timeout_padding * 1000,
    'message' =&gt; t('@msg', array('@msg' =&gt; $msg)),
    'redirect_url' =&gt; url($redirect_url, array('query' =&gt; $redirect_query)),
    'title' =&gt; t('@name Alert', array('@name' =&gt; variable_get('site_name', 'Drupal'))),
    'refresh_only' =&gt; $refresh_only,
    'no_dialog' =&gt; $no_dialog,
  );
drupal_add_js(array('autologout' =&gt; $settings), 'setting');
drupal_add_js(drupal_get_path('module', 'autologout') . "/autologout.js");


In this it passes the settings variable to the javascript file.

I want to change
" 'title' => t('@name Alert', array('@name' => variable_get('site_name', 'Drupal')))," attribute using "hook_js_alter" in my custom module so that javscript takes the new value.
The structure of the $javascript array passed to hook_js_alter() is similar to the following one. (I reported only the relevant part of the array.)

array(
  'settings' =&gt; array(
    'data' =&gt; array(
      0 =&gt; array('basePath' =&gt; '/'),
      1 =&gt; array ('pathPrefix' =&gt; ''),
      2 =&gt; array('ajaxPageState' =&gt; array ('theme' =&gt; 'bartik', 'theme_token' =&gt; 'oFpiDA70-NnnvSdIL6bFt1oLccvTT5SZeOp3G34cOfs')),
      3 =&gt; array ('overlay' =&gt; array('paths' =&gt; array('admin' =&gt; 'node/*/edit node/*/delete node/*/revisions node/*/revisions/*/revert node/*/revisions/*/delete node/add node/add/* overlay/dismiss-message user/*/shortcuts admin admin/* batch taxonomy/term/*/edit user/*/cancel user/*/edit user/*/edit/*', 'non_admin' =&gt; 'admin/structure/block/demo/* admin/reports/status/php'))),
      4 =&gt; array('overlay' =&gt; array('pathPrefixes' =&gt; array())),
      5 =&gt; array('overlay' =&gt; array('ajaxCallback' =&gt; 'overlay-ajax'))
    ),
    'type' =&gt; 'setting',
    'scope' =&gt; 'header',
    'group' =&gt; -100,
    'every_page' =&gt; true,
    'weight' =&gt; 0
  )
  // ...
);


I would use the following code for hook_js_alter(). 

if (isset($javascript['settings']['data']) &amp;&amp; is_array($javascript['settings']['data'])) {
  foreach ($javascript['settings']['data'] as $index =&gt; $settings) {
    if (isset($settings['autologout']['title']) &amp;&amp; is_array($settings['autologout'])) {
      $javascript['settings']['data'][$index]['autologout']['title'] = 'Your value';
      break;
    }
  }
}