aboutsummaryrefslogtreecommitdiff
path: root/system/betty/fix-slackware.patch
blob: b62fdd19a8159635040377b23fa62078d0b23d2e (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
diff -Naur betty-0.1.7a/lib/user.rb betty-0.1.7b/lib/user.rb
--- betty-0.1.7a/lib/user.rb	2014-09-21 20:23:43.000000000 -0600
+++ betty-0.1.7b/lib/user.rb	2017-03-12 16:20:56.147749890 -0600
@@ -1,19 +1,19 @@
-module User  
+module User
   def self.has_command?(command)
-    response = `which #{ command }`
+    response = `which #{ command } 2> /dev/null`
     response != ""
   end
 
   def self.interpret(command)
     responses = []
-    
+
     if command.match(/^who\s+am\si$/i) || command.match(/^what\'?s?(\s+is)?\s+my\s(user)?name\??$/i)
       responses << {
         :command => "whoami",
         :explanation => "Gets your system username."
       }
     end
-    
+
     if command.match(/^who\s+am\si$/i) || command.match(/^what\'?s?(\s+is)?\s+my\s((real|full|actual)\s+)?name\??$/i)
       responses << {
         :command => "finger $(whoami) | sed 's/.*: *//;q'",
@@ -23,7 +23,7 @@
 
     if command.match(/^what\'?s?(\s+is)?(\s+my)?\s?(public|external|internal|private|local)?(\s+ip)?\s?(address)?\??$/i)
       responses << {
-        :command => "ifconfig", 
+        :command => "/sbin/ifconfig",
         :explanation => "Gets your internal ip address."
         } if not command.match(/(public|external)/)
       responses << {
@@ -31,7 +31,7 @@
         :explanation => "Gets your external ip address."
       } if not command.match(/(internal|private|local)/)
     end
-  
+
     if command.match(/^who\'?s?(\s+else)?(\s+is)?\s(logged|signed|connected)\s+?in\??$/i)
       responses << {
         :command => "who | cut -f 1 -d ' ' | uniq",
@@ -45,11 +45,11 @@
         :explanation => "Shows you your current directory."
       }
     end
-    
-    
+
+
     if command.match(/^what\'?s?(?:\s+is)?(?:\s+(?:the|my))?\s+version(?:\s+of)?(\s[a-zA-Z\-_]+)+\??$/i)
       program = $1.strip
-    
+
       command_to_use = ""
       case program
       when "go"
@@ -61,7 +61,7 @@
       else
         command_to_use = "#{ program } --version"
       end
-      
+
       responses << {
         :command => command_to_use,
         :explanation => "Gets the version of #{ program }."
diff -Naur betty-0.1.7a/main.rb betty-0.1.7b/main.rb
--- betty-0.1.7a/main.rb	2014-09-21 20:23:43.000000000 -0600
+++ betty-0.1.7b/main.rb	2017-03-12 16:13:11.337693583 -0600
@@ -135,7 +135,7 @@
 
     if Internet.connection_enable?
 
-      if has_afplay || has_mpg123
+      if has_afplay
          require 'open-uri'
          text = sanitize(text)
          speech_path = '/tmp/betty_speech.mp3'
@@ -156,12 +156,12 @@
          end
       else
          if has_spd_say
-          system("spd-say -t female2 -m some -r 5 -p -25 -s #{text}")
+          system("spd-say -t female2 -m some -r 5 -p -25 -s \"#{text}\"")
          end
       end
       else
         if has_spd_say
-          system("spd-say -t female2 -m some -r 5 -p -25 -s #{text}")
+          system("spd-say -t female2 -m some -r 5 -p -25 -s \"#{text}\"")
         end
       end
   end