Jump to content
  • 0

Chromebook kiosk mode battery status


ronaldrosing

Question

8 answers to this question

Recommended Posts

  • 0

Hi Ronald - I'm not aware that this currently exists. I know this doesn't really help and I'm sure you're already aware but battery life can be observed by hitting CTRL+ALT+S at startup of the device.  

 

It's worth noting that one of the positive things about Chrome OS is that it's an open source operating system, and allows anyone to read about bugs, make feature requests and even influence the prioritization of those features. It looks like this feature you mention was opened in 2016 -- I recommend that you hit the star button in the top left hand corner which signifies interest in the issue for the dev team: https://bugs.chromium.org/p/chromium/issues/detail?id=591133&q=battery display in kiosk mode&sort=-modified&colspec=ID Pri M Stars ReleaseBlock Component Status Owner Summary OS Modified

 

Cheers.

 

Edited by nfuchs15
Removed accidental copy+pasted image.
Link to comment
  • 0

I modified my storefront for this exact case. Add this custom code to Script.js on Storefront 3.x. 

 

This displays clock and battery life for Workspace on chromeos. Note: Battery isn’t supported for Windows client, but clock will work. 
 

 

(function () {

    var div2 = document.createElement("div");

    document.getElementsByTagName('body')[0].appendChild(div2);

    div2.outerHTML = "<div id='txt' style='height: 50px; width: 150px; color: white; top: 0; left: 60%; border-left: 2px solid white; border-right: 2px solid white; border-bottom: 2px solid white;  background-color: #1378a6; font-size: 18px; font-family: Segoe UI, sans-serif; position:fixed; cursor: pointer;text-align:center'></div>"; 

    startTime();

function startTime() {

  var today = new Date();

  var h = today.getHours();

  var m = today.getMinutes();

  var s = today.getSeconds();

  m = checkTime(m);

  s = checkTime(s);

    

  document.getElementById('txt').innerHTML = "<b>The Time is Now <br>" + h + ":" + m + ":" + s +"</b>";

  var t = setTimeout(startTime, 500);

}

function checkTime(i) {

  if (i < 10) {i = "0" + i};  // add zero in front of numbers < 10

  return i;

}

}());

 

 

 

 

var div3 = document.createElement("div");

    document.getElementsByTagName('body')[0].appendChild(div3);

    div3.outerHTML = "<div id='batt' style='height: 50px; width: 150px; color: white; top: 0; left: 75%; border-left: 2px solid white; border-right: 2px solid white; border-bottom: 2px solid white; background-color: #1378a6; font-size: 18px; font-family: Segoe UI, sans-serif; position:fixed; cursor: pointer;text-align:center'></div>";

 

 

navigator.getBattery().then(function(battery) {

  var battDiv = document.getElementById('batt');

  var battL = battery.level;

  battL= battL.toFixed(2);

  document.getElementById('batt').innerHTML = "<b>Battery <br>" + battL*100 +"%</b>";

  if (battery.level > .75){

    battDiv.style.backgroundColor='green';

        battDiv.style.color='white'; 

  }

  else if (battery.level > .5){

      battDiv.style.backgroundColor='yellow';

      battDiv.style.color='black';

  }

  else if (battery.level > .25){

    battDiv.style.backgroundColor='orange';

    battDiv.style.color='white'; 

  }

  else {

    battDiv.style.backgroundColor='red';

    battDiv.style.color='white'; 

}

 

  battery.addEventListener('levelchange', function() {

    var battDiv = document.getElementById('batt');

    var battL = this.level;

    battL= battL.toFixed(2);

    document.getElementById('batt').innerHTML = "<b>Battery <br>" + battL*100 +"%</b>";

    if (this.level > .75){

    battDiv.style.backgroundColor='green';

        battDiv.style.color='white';

    }

    else if (this.level > .5){

      battDiv.style.backgroundColor='yellow';

      battDiv.style.color='black';       

    }

    else if (this.level > .25){

    battDiv.style.backgroundColor='orange';

    battDiv.style.color='white';

    }

    else {

    this.style.backgroundColor='red';

    battDiv.style.color='white';

    }

 

    

  });

});

 

Link to comment
  • 0
On 10/2/2019 at 6:12 AM, Brian Korrow said:

I modified my storefront for this exact case. Add this custom code to Script.js on Storefront 3.x. 

 

This displays clock and battery life for Workspace on chromeos. Note: Battery isn’t supported for Windows client, but clock will work. 
 

 

(function () {

    var div2 = document.createElement("div");

    document.getElementsByTagName('body')[0].appendChild(div2);

    div2.outerHTML = "<div id='txt' style='height: 50px; width: 150px; color: white; top: 0; left: 60%; border-left: 2px solid white; border-right: 2px solid white; border-bottom: 2px solid white;  background-color: #1378a6; font-size: 18px; font-family: Segoe UI, sans-serif; position:fixed; cursor: pointer;text-align:center'></div>"; 

    startTime();

function startTime() {

  var today = new Date();

  var h = today.getHours();

  var m = today.getMinutes();

  var s = today.getSeconds();

  m = checkTime(m);

  s = checkTime(s);

    

  document.getElementById('txt').innerHTML = "<b>The Time is Now <br>" + h + ":" + m + ":" + s +"</b>";

  var t = setTimeout(startTime, 500);

}

function checkTime(i) {

  if (i < 10) {i = "0" + i};  // add zero in front of numbers < 10

  return i;

}

}());

 

 

 

 

var div3 = document.createElement("div");

    document.getElementsByTagName('body')[0].appendChild(div3);

    div3.outerHTML = "<div id='batt' style='height: 50px; width: 150px; color: white; top: 0; left: 75%; border-left: 2px solid white; border-right: 2px solid white; border-bottom: 2px solid white; background-color: #1378a6; font-size: 18px; font-family: Segoe UI, sans-serif; position:fixed; cursor: pointer;text-align:center'></div>";

 

 

navigator.getBattery().then(function(battery) {

  var battDiv = document.getElementById('batt');

  var battL = battery.level;

  battL= battL.toFixed(2);

  document.getElementById('batt').innerHTML = "<b>Battery <br>" + battL*100 +"%</b>";

  if (battery.level > .75){

    battDiv.style.backgroundColor='green';

        battDiv.style.color='white'; 

  }

  else if (battery.level > .5){

      battDiv.style.backgroundColor='yellow';

      battDiv.style.color='black';

  }

  else if (battery.level > .25){

    battDiv.style.backgroundColor='orange';

    battDiv.style.color='white'; 

  }

  else {

    battDiv.style.backgroundColor='red';

    battDiv.style.color='white'; 

}

 

  battery.addEventListener('levelchange', function() {

    var battDiv = document.getElementById('batt');

    var battL = this.level;

    battL= battL.toFixed(2);

    document.getElementById('batt').innerHTML = "<b>Battery <br>" + battL*100 +"%</b>";

    if (this.level > .75){

    battDiv.style.backgroundColor='green';

        battDiv.style.color='white';

    }

    else if (this.level > .5){

      battDiv.style.backgroundColor='yellow';

      battDiv.style.color='black';       

    }

    else if (this.level > .25){

    battDiv.style.backgroundColor='orange';

    battDiv.style.color='white';

    }

    else {

    this.style.backgroundColor='red';

    battDiv.style.color='white';

    }

 

    

  });

});

 


thank you but what if i already logged in my citrix session? We are using server shared deskyops in our environment. This is only when logging in right?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...