# This is a simple pulsing script for Plymouth daemon.
Window.SetBackgroundTopColor (0.16, 0.00, 0.12);
Window.SetBackgroundBottomColor (0.16, 0.00, 0.12);
logo.image = Image("ubuntu_logo.png");
logo.sprite = Sprite (logo.image);
logo.width = logo.image.GetWidth ();
logo.height = logo.image.GetHeight ();
logo.x = Window.GetX () + Window.GetWidth () / 2 - logo.width / 2;
logo.y = Window.GetY () + Window.GetHeight () / 2 - logo.height / 2;
logo.z = 1000;
logo.sprite.SetX (logo.x);
logo.sprite.SetY (logo.y);
logo.sprite.SetZ (logo.z);
logo.sprite.SetOpacity (1);
light.image = Image ("light.png");
light.sprite = Sprite (light.image);
light.width = light.image.GetWidth ();
light.height = light.image.GetHeight ();
light.x = Window.GetX () + Window.GetWidth () / 2 - light.width / 2;
light.y = Window.GetY () + Window.GetHeight () / 2 - light.height / 2;
light.z = 100;
light.sprite.SetX (light.x);
light.sprite.SetY (light.y);
light.sprite.SetZ (light.z);
#light.sprite.SetOpacity (1);
flag = 0;
counter = 1;
fun pulse ()
{
if (counter < 0.05)
flag = 1;
if (counter > 0.95)
flag = 0;
if (flag == 0) {
counter = counter - 0.02;
light.sprite.SetOpacity (counter);
}
if (flag == 1) {
counter = counter + 0.02;
light.sprite.SetOpacity (counter);
}
}
Plymouth.SetRefreshFunction (pulse);
if on_ac_power; then
notify-send "Система электропитания" "Питание подключено" -i gtk-info
/usr/bin/canberra-gtk-play --id="service-login" --volume=7
else
notify-send "Система электропитания" "Питание отключено" -i gtk-info
/usr/bin/canberra-gtk-play --id="service-logout" --volume=7
fi
sudo gedit /etc/acpi/power.sh
if on_ac_power; then
notify-send "Система электропитания" "Питание подключено" -i gtk-info
else
notify-send "Система электропитания" "Питание отключено" -i gtk-info
fi
sudo chmod +x /etc/acpi/power.sh