Skip to content

Commit df9e9e5

Browse files
committed
So -- not ringing seems to been caused by two problems:
1) we need to run in writable directory. 2) we need to pass /dev/null to aplay. Solve both. Should solve the writable directory better.
1 parent f639450 commit df9e9e5

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

desktop/ofone.desktop

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ Encoding=UTF-8
33
Version=1.0
44
Name=Ofone
55
Comment=Phone application
6-
Exec=/usr/share/unicsy/ofone/ofone
6+
#Exec=/usr/share/unicsy/ofone/ofone -p | tee /tmp/delme.ofone.log
7+
Exec=/usr/share/unicsy/startup/leste_startup.sh
78
Icon=call_button
89
Terminal=true
910
Type=Application

desktop/test.desktop

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Desktop Entry]
2+
Encoding=UTF-8
3+
Version=1.0
4+
Name=Development test
5+
Comment=foo
6+
Exec=/usr/share/unicsy/ofone/notify.py
7+
Icon=system-run
8+
Terminal=true
9+
Type=Application
10+
Categories=System;Demo;
11+
X-Osso-Type=application/x-executable

ofone/notify.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(m):
2424
m.audio = "/usr/share/sounds/"
2525
m.ring = "ui-wake_up_tune.wav"
2626

27-
m.play_cmd = [ 'aplay' ]
27+
m.play_cmd = [ '/usr/bin/aplay' ]
2828
if hardware.hw.d4:
2929
m.play_cmd += [ '-D', 'plughw:CARD=Audio,DEV=0' ]
3030

@@ -38,7 +38,8 @@ def playback_finished(m):
3838
def mediaPlay(m, file):
3939
if not m.playback_finished():
4040
m.player.send_signal(signal.SIGTERM)
41-
m.player = subprocess.Popen(m.play_cmd + [ file ], stdin=subprocess.PIPE)
41+
null = open('/dev/null', 'r+')
42+
m.player = subprocess.Popen(m.play_cmd + [ file ], stdin=subprocess.PIPE, stdout=null, stderr=null, shell=False, cwd=None, env=None)
4243

4344
def mediaPlayPause(m):
4445
if m.player:

ofone/ofone

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/python2
22
# -*- python -*-
33
# Not to be ran as root.
4+
# Will write to events.json (etc) in current directory. Run from home.
45

56
from __future__ import print_function
67

startup/leste_startup.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
cd /home/user
3+
4+
( for i in `seq 100`; do
5+
echo $i
6+
sleep .2
7+
done
8+
) | yad --progress --auto-close
9+
10+
/usr/share/unicsy/ofone/ofone -p -s < /dev/null > /tmp/delme.ofono.log 2>&1

0 commit comments

Comments
 (0)