Накидал простенький скрипт, при отключении от сети сигналит#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
import pygame
from pygame import *
def f():
try:
socket.gethostbyaddr('www.yandex.ru')
except socket.gaierror:
return False
return True
timer = pygame.time.Clock()
pygame.init()
pygame.mixer.music.load('/home/alsoijw/Музыка/ubuntu touch/Ubuntu.ogg')
while 1:
timer.tick(0.1)
try:
f()
except:
pygame.mixer.music.play()