-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdisplay_low_battery_alert
executable file
·34 lines (27 loc) · 1.06 KB
/
display_low_battery_alert
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Abort on errors.
set -e
ASSETS=/usr/share/chromeos-assets
ASSETS_200="${ASSETS}/images_200_percent"
ASSETS_100="${ASSETS}/images_100_percent"
IMAGES_100="${ASSETS_100}/battery_alert*.png"
# IMAGES_100 and IMAGES_200 are globs so they shouldn't be quoted when
# dereferenced or the pattern will be returned rather than list of
# matching files.
SEQ_100="$(ls ${IMAGES_100} ; ls -r ${IMAGES_100})"
IMAGES_200="${ASSETS_200}/battery_alert*.png"
SEQ_200="$(ls ${IMAGES_200} ; ls -r ${IMAGES_200})"
BAT_IMAGES=""
for image in ${SEQ_200}; do
BAT_IMAGES="${BAT_IMAGES} --image-hires ${image}"
done
for image in ${SEQ_100}; do
BAT_IMAGES="${BAT_IMAGES} --image ${image}"
done
# Kill running frecon processes, continue if no frecon process found.
pkill -9 frecon || [ "$?" -eq "1" ]
/sbin/frecon --clear 0x000000 --loop-interval=100 --loop-count=3 \
--loop-start=0 --splash-only ${BAT_IMAGES}