std.lib.os

*native-compile*

dynamic

beep

added in 3.0

(beep)

initiates a beep sound

(beep)

clip

added in 3.0

(clip s)

clips a string to clipboard

(clip “hello”)

clip:nil

added in 4.0

(clip:nil s)

clips a string to clipboard with no return

native?

added in 3.0

(native?)

checks if execution is in graal

(native?) ;;false => boolean?

os

added in 3.0

(os)

returns the current os

(os) ;;“Mac OS X” => string?

os-arch

added in 4.0

(os-arch)

TODO

os-notify

added in 3.0

(os-notify title message)

notifies the os using `alerter``

os-run

added in 4.0

(os-run & commands)

runs a function with os resources

paste

added in 4.0

(paste)

pastes a string from clipboard

(paste) => “hello”

say

added in 3.0

(say & phrase)

enables audio debugging

(say “hello there”)

sh

added in 3.0

(sh m)(sh s & args)

creates a sh process

@(sh “ls”) => string?

@(sh {:args “ls”}) => string?

(sh {:args “ls” :wait false}) => Process

(sh {:args “ls” :wrap false}) => string?

sh-close

added in 4.0

(sh-close process)

closes the sh output

sh-error

added in 4.0

(sh-error process)

reads value from stderr

sh-exit

added in 4.0

(sh-exit process)

calls destroy on the process

sh-kill

added in 4.0

(sh-kill process)

calls destroyForcibly on the process

sh-kill-tree

added in 4.0

(sh-kill-tree process)

calls destroyForcibly on the process and all descendants.

Uses java.lang.ProcessHandle when available (Java 9+) so that child processes spawned by the root process are also terminated. Falls back to sh-kill on Java 8 or if ProcessHandle is unavailable.

sh-output

added in 3.0

(sh-output process)

returns the sh output

sh-read

added in 4.0

(sh-read process)

reads value from stdout

(sh-read (sh “ls” {:wait true :output false})) => string?

sh-wait

added in 3.0

(sh-wait process)

waits for sh process to complete

sh-write

added in 4.0

(sh-write process content)

writes string or bytes to the process

sys:wget-bulk

added in 4.0

(sys:wget-bulk root-url root-path files & [args])

download files using call to wget

tmux-with-args

added in 4.0

(tmux-with-args cmd {:keys [root env]})

creates tmux args

(tmux-with-args “tmux” {:root “.” :env {:hello “world”}}) => [“tmux” “-c” “.” “-e” “HELLO=world”]

tmux:has-session?

added in 4.0

(tmux:has-session? session)

checks if tmux session exists

tmux:has-window?

added in 4.0

(tmux:has-window? session key)

checks if window exists in a session

tmux:kill-server

added in 4.0

(tmux:kill-server)

kills the tmux server

tmux:kill-session

added in 4.0

(tmux:kill-session session)

kills a tmux session

tmux:kill-window

added in 4.0

(tmux:kill-window session key)

kills the tumx window

tmux:list-sessions

added in 4.0

(tmux:list-sessions)

lists all tmux sessions

tmux:list-windows

added in 4.0

(tmux:list-windows session)

lists all windows in a session

tmux:new-session

added in 4.0

(tmux:new-session session & [opts])

creates a new tmux session

tmux:new-window

added in 4.0

(tmux:new-window session key & [opts])

opens a new window in the session

tmux:run-command

added in 4.0

(tmux:run-command session key cmd)

runs a command in a window

url-decode

added in 4.0

(url-decode s)

decodes string from url

url-encode

added in 4.0

(url-encode s)

encodes string to url