Skip to content

Commit cc686b7

Browse files
authored
Merge pull request #3127 from rbnpi/dev
Add compton to daemon (rebased)
2 parents 6efe57e + beffb71 commit cc686b7

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

app/server/ruby/bin/daemon.rb

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ def initialize(opts={})
157157
@scsynth_booter = nil
158158
@tau_booter = nil
159159
@spider_booter = nil
160-
160+
@compton_booter = nil
161+
161162
# use a value within the valid range for a 32 bit signed complement integer
162163
@daemon_token = rand(-2147483647..2147483647)
163164

@@ -167,6 +168,9 @@ def initialize(opts={})
167168
Util.log "SuperCollider inputs enabled by GUI"
168169
end
169170

171+
#start compton to handle transparency (needs to be after Util.open_log)
172+
@compton_booter = ComptonBooter.new if Util.os == :raspberry
173+
170174
# Get a map of port numbers to use
171175
#
172176
# Note that the program will safe_exit here
@@ -568,7 +572,7 @@ def restart_tau!
568572
end
569573

570574
def cleanup_any_running_processes
571-
[@spider_booter, @scsynth_booter, @tau_booter].map do |p|
575+
[@spider_booter, @scsynth_booter, @tau_booter, @compton_booter].map do |p|
572576
Thread.new do
573577
begin
574578
p.kill if p
@@ -1029,6 +1033,14 @@ def initialize
10291033
end
10301034
end
10311035

1036+
class ComptonBooter < ProcessBooter
1037+
def initialize
1038+
cmd = "compton"
1039+
args = []
1040+
log_file = nil
1041+
super(cmd, args, log_file)
1042+
end
1043+
end
10321044

10331045
class ScsynthBooter < ProcessBooter
10341046

0 commit comments

Comments
 (0)