Skip to content

Commit

Permalink
Clipboard integration
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed May 15, 2024
1 parent 2097381 commit 69b9800
Showing 1 changed file with 56 additions and 13 deletions.
69 changes: 56 additions & 13 deletions transporter/psyche/psyche.self
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,10 @@ otherwise:
startX = ( |
|
os command: 'daemon /usr/local/bin/Xvnc :1 -geometry ', config current systemDesktopSize, ' -depth 24 -SecurityTypes None,TLSNone'.
"Pause until Xvnc has started "
[ 0 = (os command: 'ls /tmp/.X11-unix/X1')] whileFalse.
os command: 'daemon /usr/local/bin/vncconfig -display :1 -nowin'.
os command: 'daemon autocutsel'.
process this sleep: 2000.
os command: 'DISPLAY=:1 daemon /usr/local/bin/ratpoison'.
self).
Expand Down Expand Up @@ -861,7 +865,7 @@ otherwise:
h.
|
h: '%IP% {\n'.
h: h replace: '%IP%' With: sys local_ip4.
h: h replace: '%IP%' With: sys caddy hostname.
h).
} | )

Expand Down Expand Up @@ -1064,6 +1068,24 @@ otherwise:
| sys stdoutOfCommand: 'curl -GET --unix-socket ', configSocket, ' http://127.0.0.1/config/', path).
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'psyche' -> 'sys' -> 'caddy' -> () From: ( | {
'Category: hostname\x7fComment: This should be one of three types:
- localhost, ie 127.0.0.1 (assuming ip4)
- local ip, eg 192.168.1.114
- global domain name set in psyche.conf\x7fModuleInfo: Module: psyche InitialContents: FollowSlot'

hostname = ( |
|
localhost = rawHostname ifTrue: [rawHostname: sys local_ip4]. rawHostname).
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'psyche' -> 'sys' -> 'caddy' -> () From: ( | {
'Category: hostname\x7fModuleInfo: Module: psyche InitialContents: FollowSlot'

hostname: hn = ( |
| rawHostname: hn. self).
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'psyche' -> 'sys' -> 'caddy' -> () From: ( | {
'ModuleInfo: Module: psyche InitialContents: FollowSlot'

Expand All @@ -1075,6 +1097,12 @@ otherwise:
r shrinkwrapped != 'caddy is not running.').
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'psyche' -> 'sys' -> 'caddy' -> () From: ( | {
'Category: hostname\x7fModuleInfo: Module: psyche InitialContents: FollowSlot'

localhost = '127.0.0.1'.
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'psyche' -> 'sys' -> 'caddy' -> () From: ( | {
'ModuleInfo: Module: psyche InitialContents: FollowSlot'

Expand All @@ -1098,6 +1126,12 @@ otherwise:
cc).
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'psyche' -> 'sys' -> 'caddy' -> () From: ( | {
'Category: hostname\x7fModuleInfo: Module: psyche InitialContents: InitializeToExpression: (psyche sys caddy localhost)'

rawHostname <- psyche sys caddy localhost.
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'psyche' -> 'sys' -> 'caddy' -> () From: ( | {
'ModuleInfo: Module: psyche InitialContents: FollowSlot'

Expand Down Expand Up @@ -1893,6 +1927,20 @@ after process has finished.\x7fModuleInfo: Module: psyche InitialContents: Follo
| rawConsoleSocket ifNil: raiseError).
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'psyche' -> 'worlds' -> 'worldRecord' -> () From: ( | {
'Category: URLs\x7fModuleInfo: Module: psyche InitialContents: FollowSlot'

consoleURL = ( |
| 'https://', sys caddy hostname, '/', id, '/console').
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'psyche' -> 'worlds' -> 'worldRecord' -> () From: ( | {
'Category: URLs\x7fModuleInfo: Module: psyche InitialContents: FollowSlot'

copyConsoleURLToClipboard = ( |
| ui2_textBuffer contents: consoleURL. self).
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'psyche' -> 'worlds' -> 'worldRecord' -> () From: ( | {
'ModuleInfo: Module: psyche InitialContents: FollowSlot'

Expand Down Expand Up @@ -2159,10 +2207,10 @@ after process has finished.\x7fModuleInfo: Module: psyche InitialContents: Follo
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'psyche' -> 'worlds' -> 'worldRecord' -> 'runner' -> () From: ( | {
'ModuleInfo: Module: psyche InitialContents: FollowSlot'
'Category: settings\x7fComment: In jail\x7fModuleInfo: Module: psyche InitialContents: FollowSlot'

dtachSocket = ( |
| selfSock).
| sockDirectory, '/', id, '.sock').
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'psyche' -> 'worlds' -> 'worldRecord' -> 'runner' -> () From: ( | {
Expand Down Expand Up @@ -2244,13 +2292,6 @@ after process has finished.\x7fModuleInfo: Module: psyche InitialContents: Follo
self).
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'psyche' -> 'worlds' -> 'worldRecord' -> 'runner' -> () From: ( | {
'Category: settings\x7fComment: In jail\x7fModuleInfo: Module: psyche InitialContents: FollowSlot'

selfSock = ( |
| sockDirectory, '/', id, '.sock').
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'psyche' -> 'worlds' -> 'worldRecord' -> 'runner' -> () From: ( | {
'Category: jail\x7fModuleInfo: Module: psyche InitialContents: FollowSlot'

Expand Down Expand Up @@ -2278,8 +2319,10 @@ after process has finished.\x7fModuleInfo: Module: psyche InitialContents: Follo

sleep = ( |
|
stopJail. destroyJail.
stopTtyd. deregisterTtydWithCaddy.
stopJail.
destroyJail.
stopTtyd.
deregisterTtydWithCaddy.
self).
} | )

Expand All @@ -2306,7 +2349,7 @@ after process has finished.\x7fModuleInfo: Module: psyche InitialContents: Follo
|
n: hostName.
d: baseDirectory.
s: selfSock.
s: dtachSocket.
sys sh: 'jail -cmr path=\'', d, '\' name=\'', n, '\' mount.devfs devfs_ruleset=5 host.hostname=\'', n, '\' command=/bin/dtach -n \'', s, '\' /vm/Self -s /objects/snapshot'.
self).
} | )
Expand Down

0 comments on commit 69b9800

Please sign in to comment.