Next: (heks-linux rmpc), Previous: (heks-linux palette), Up: API
Translate msg using the current text domain.
(G_ "Hello")
Create dir and every missing parent directory leading to it.
Unlike a bare mkdir, this also works for nested targets such as
~/.config/systemd/user on a machine where
~/.config/systemd does not exist yet.
(ensure-directory-tree! "~/.config/systemd/user")
Recursively flatten a nested list structure xs into a single flat list.
(flatten-list '(1 (2 (3 4)) 5)) ⇒ (1 2 3 4 5)
Write contents to a file named name inside directory
dir. If dir (or any of its parents) does not exist, it is
created automatically. perms is applied to the written file with
chmod; the default #o644 is readable by everyone, while
executable scripts pass #o755 (493).
(install-config-file! #:name "config.toml"
#:dir "/etc/myapp"
#:contents "[settings]
port = 8080")
Dynamically load a machine-specific configuration file within a target module.
Look for an optional configuration file at the path
$XDG_CONFIG_HOME/heks-linux/profile-name.scm, defaulting to
~/.config/heks-linux/profile-name.scm if
XDG_CONFIG_HOME is not set or empty. If the file exists,
temporarily switch the active module context to module-name using
save-module-excursion before executing load.
This ensures that the localized configuration script evaluates within the namespace where the module’s parameters and internal definitions are bound, preventing unbound variable errors.
(load-local-overrides '(heks-linux waybar) 'waybar-settings)
Format an association list of pairs into a CSS ruleset string.
(mk-css-conf-lines '((body (color . "black") (margin . 0))))
⇒ "body {
color: black;
margin: 0;
}
"
Format an association list of pairs into configuration lines using template.
(mk-kv-conf-lines '((host . "localhost") (port . 80))) ⇒ "host=localhost port=80 "
Join a list of items into a single string, appending a newline to each item.
(mk-lines '("foo" "bar"))
⇒ "foo
bar
"
Recursively format nested configuration pairs into a string using template. This handles both top-level key-values and nested blocks as INI-style sections.
(mk-rec-kv-conf-lines '((settings (port . 8080))) #:template "~a=~a ") ⇒ " [settings] port=8080 "
Install the Nix package specified by the attribute path x via system call.
(nix-profile-install "nixpkgs.tmux")
Serialize a single configuration item using template to the current output port. If the item’s value is a list, it formats the key as an INI-style section header.
(with-output-to-string (lambda () (serialize-rec-conf-item "~a=~a " '(port . 80)))) ⇒ "port=80 "
Initialize internationalization (i18n) locales and text domains for the application. Safely catches and logs errors if initialization fails.
Execute the system command cmd via an input pipe and return its stdout. If silent? is true, the output is also printed to the current output port.
(syscall "echo 'hello'") ⇒ "hello "
Next: (heks-linux rmpc), Previous: (heks-linux palette), Up: API