no more "/var/run" left now.
write(f, line, 17);
close(f);
}
- f = open("/var/run/alert/alarm", O_WRONLY | O_CREAT, 0600);
+ f = open("/run/alert/alarm", O_WRONLY | O_CREAT, 0600);
if (f) {
write(f, "new\n", 4);
close(f);
save_mirror(mfile, mirror)
if found_one:
try:
- f = open("/var/run/alert/sms", "w")
+ f = open("/run/alert/sms", "w")
f.write("new")
f.close()
suspend.abort_cycle()
# button will search for possible carriers
# while search, button show how long search has progressed
# on succcess, get one button per carrier valid for 2 minutes
-# When one is selected, write that to /var/run/gsm/request_carrier
+# When one is selected, write that to /run/gsm/request_carrier
#
# calls:
# display incoming phone number and when there is one, allows
import os.path, fcntl, time, gobject, re, gtk
def record(key, value):
- f = open('/var/run/gsm-state/.new.' + key, 'w')
+ f = open('/run/gsm-state/.new.' + key, 'w')
f.write(value)
f.close()
- os.rename('/var/run/gsm-state/.new.' + key,
- '/var/run/gsm-state/' + key)
+ os.rename('/run/gsm-state/.new.' + key,
+ '/run/gsm-state/' + key)
def recall(key):
try:
- fd = open("/var/run/gsm-state/" + key)
+ fd = open("/run/gsm-state/" + key)
l = fd.read(1000)
fd.close()
except IOError:
class carrier(file):
def __init__(self, name, owner):
- file.__init__(self, name, owner, "/var/run/gsm-state/carrier")
+ file.__init__(self, name, owner, "/run/gsm-state/carrier")
self.buttons = self.cbuttons
self.carriers = []
if self.carrier_buttons and time.time() - self.carrier_valid < 120:
return self.carrier_buttons
self.carrier_buttons = None
- if (os.path.exists('/var/run/gsm-state/request_carrier') and
- os.path.getsize('/var/run/gsm-state/request_carrier') > 1):
+ if (os.path.exists('/run/gsm-state/request_carrier') and
+ os.path.getsize('/run/gsm-state/request_carrier') > 1):
return ['Search Carriers','Cancel Request']
return ['Search Carriers']
# display (call logs)
# Buttons are "Received" "Dialled" "Dialer" "Contacts"
def __init__(self, name, owner):
- file.__init__(self, name, owner, '/var/run/gsm-state/status')
+ file.__init__(self, name, owner, '/run/gsm-state/status')
self.buttons = self.cbuttons
self.get_name = self.cgetname
self.status = ''
sigprocmask(SIG_UNBLOCK, &blocked, NULL);
}
-char *dir = "/var/run/sound";
+char *dir = "/run/sound";
int dfd;
struct dev dev;
int suspend_handle;
#
# Interaction with Modem:
# - request call-out
-# write number to /var/run/gsm-state/call
+# write number to /run/gsm-state/call
# - answer incoming
-# write 'answer' to /var/run/gsm-state/call
+# write 'answer' to /run/gsm-state/call
# - hang-up
-# write empty string to /var/run/gsm-state/call
+# write empty string to /run/gsm-state/call
# - determine status: on-call, incoming, idle
-# examine /var/run/gsm-state/status
+# examine /run/gsm-state/status
# - send request
# - recv reply
from contactdb import contacts
def record(key, value):
- f = open('/var/run/gsm-state/.new.' + key, 'w')
+ f = open('/run/gsm-state/.new.' + key, 'w')
f.write(value)
f.close()
- os.rename('/var/run/gsm-state/.new.' + key,
- '/var/run/gsm-state/' + key)
+ os.rename('/run/gsm-state/.new.' + key,
+ '/run/gsm-state/' + key)
def recall(key):
try:
- fd = open("/var/run/gsm-state/" + key)
+ fd = open("/run/gsm-state/" + key)
l = fd.read(1000)
fd.close()
except IOError:
self.outgoing = outgoing_list()
- d = dnotify.dir('/var/run/gsm-state')
+ d = dnotify.dir('/run/gsm-state')
self.status_watcher = d.watch('status', self.check_status)
self.incoming_watcher = d.watch('incoming', self.check_incoming)
self.show()
# is dark, suspend is allowed to progress.
#
# Also handle alerts. Alerts are signaled by files appearing in
-# /var/run/alert. We respond by:
+# /run/alert. We respond by:
# - disabling suspend
# - triggering a vibrator rumble
# - playing a suitable sound by linking a sound from /etc/alert/$name
-# to /var/run/sound. A separate program plays the sound.
+# to /run/sound. A separate program plays the sound.
# - restoring the display to "dim" if it is "off".
#
return False
def action(self, name):
- n = '/var/run/sound/10-alert'
+ n = '/run/sound/10-alert'
try:
os.symlink(os.path.join(self.actiondir, self.pref, name), n)
except:
screen = EvDev("/dev/input/touchscreen", wake_dim)
try:
- os.mkdir("/var/run/alert")
+ os.mkdir("/run/alert")
except:
pass
- alert = SetAlerts("/var/run/alert", "/etc/alert")
+ alert = SetAlerts("/run/alert", "/etc/alert")
#setfile('/sys/bus/spi/devices/spi3.1/threshold', '500')
#setfile('/sys/bus/spi/devices/spi3.1/sample_rate','0')
#setfile('/sys/bus/spi/devices/spi3.1/taps', '7000 5')