1 USING: arrays command-line fry io.launcher kernel math namespaces
2 sequences system unix.ffi ;
5 : apple-script-elevate ( x x -- ) 2drop ;
7 HOOK: elevate os ( win-console? posix-graphical? -- )
9 M: windows elevate 2drop ;
12 [ ! graphical (through applescript)
13 t apple-script-elevate
15 f linux os [ elevate ] with-variable
20 2drop ! we are already root: do nothing
22 ! graphical on linuxes
23 nip [ { "gksudo" "kdesudo" } ] [ { } ] if
24 "sudo" suffix (command-line) '[ 1array _ append ] map
30 HOOK: lower os ( relaunch? -- )