galaaz 2.1.10.pre.6 → 2.1.10.pre.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/galaaz/cli.rb +31 -0
- data/script/omarchy/galaaz-add.sh +108 -4
- data/script/omarchy/galaaz-gknit.sh +108 -51
- data/script/omarchy/install-galaaz.sh +20 -0
- data/script/omarchy/nautilus-scripts/gknit-choose-format +61 -0
- data/script/omarchy/nautilus-scripts/gknit-html +39 -0
- data/script/omarchy/nautilus-scripts/gknit-pdf +39 -0
- data/version.rb +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: da2cad42b34d1068661e204caaa43efea89bda6e81ca2e4dda99c07f75f2ea22
|
|
4
|
+
data.tar.gz: c6d3a26d4439d89c45187192d6ff75ce285664a9f134ce947d4eeb11494eaaf6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fc202447c62b7636446195299178b165933ed490f1f71f55b09e7528aa528697051b73b47d7e7b40084c337eb772b6263242723a8048e77ca3c95856db0e6098
|
|
7
|
+
data.tar.gz: 15452e1e64b207e1b5e85cd41495e42974a76da11266e7467b2ed75de1455c0869322c067ce381b502d86dfb18699fc7e285b1507c20822a8e6752d1e8f2a51a
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 2.1.10.pre.7
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Omarchy: Nautilus Scripts under **Scripts → Galaaz** (Gknit HTML / PDF /
|
|
10
|
+
Choose Format) installed by `galaaz omarchy` and core configure.
|
|
11
|
+
- Omarchy `galaaz-add` for arrow/ledger/demo: install Arch `arrow` and build
|
|
12
|
+
matching Arrow GLib into `/usr/local` so `red-arrow` can compile.
|
|
13
|
+
|
|
5
14
|
## 2.1.10.pre.6
|
|
6
15
|
|
|
7
16
|
### Changed
|
data/lib/galaaz/cli.rb
CHANGED
|
@@ -29,6 +29,12 @@ module Galaaz
|
|
|
29
29
|
['galaaz-gknit.sh', 'omarchy-galaaz-gknit', true],
|
|
30
30
|
['debug-galaaz.sh', 'omarchy-galaaz-debug', true]
|
|
31
31
|
].freeze
|
|
32
|
+
# Installed under ~/.local/share/nautilus/scripts/Galaaz/ (Scripts → Galaaz).
|
|
33
|
+
OMARCHY_NAUTILUS_SCRIPTS = [
|
|
34
|
+
['gknit-html', 'Gknit HTML'],
|
|
35
|
+
['gknit-pdf', 'Gknit PDF'],
|
|
36
|
+
['gknit-choose-format', 'Gknit Choose Format']
|
|
37
|
+
].freeze
|
|
32
38
|
OMARCHY_MENU_FILE = 'omarchy-menu.jsonc'
|
|
33
39
|
# Standalone family "galaaz" (debug). Menu uses the merged Omarchy brand font.
|
|
34
40
|
OMARCHY_FONT_REL = File.join('fonts', 'galaaz.ttf')
|
|
@@ -181,6 +187,7 @@ module Galaaz
|
|
|
181
187
|
Writes:
|
|
182
188
|
~/.local/bin/omarchy-install-galaaz (and add/remove/guide/gknit/debug)
|
|
183
189
|
~/.config/omarchy/extensions/omarchy-menu.jsonc
|
|
190
|
+
~/.local/share/nautilus/scripts/Galaaz/ (right-click → Scripts → Galaaz)
|
|
184
191
|
~/.local/share/fonts/galaaz/galaaz.ttf
|
|
185
192
|
~/.local/share/fonts/omarchy-with-galaaz.ttf (family omarchy + U+E90E)
|
|
186
193
|
|
|
@@ -232,6 +239,13 @@ module Galaaz
|
|
|
232
239
|
puts " font galaaz: #{File.file?(font) ? font : 'MISSING'}"
|
|
233
240
|
merged = File.expand_path('~/.local/share/fonts/omarchy-with-galaaz.ttf')
|
|
234
241
|
puts " font omarchy+galaaz: #{File.file?(merged) ? merged : 'MISSING'}"
|
|
242
|
+
nautilus = File.expand_path('~/.local/share/nautilus/scripts/Galaaz')
|
|
243
|
+
if Dir.exist?(nautilus)
|
|
244
|
+
entries = Dir.children(nautilus).reject { |n| n.start_with?('.') }.sort
|
|
245
|
+
puts " nautilus Scripts/Galaaz: #{entries.empty? ? 'empty' : entries.join(', ')}"
|
|
246
|
+
else
|
|
247
|
+
puts ' nautilus Scripts/Galaaz: MISSING'
|
|
248
|
+
end
|
|
235
249
|
bundled = File.join(root, 'script', 'omarchy')
|
|
236
250
|
puts " gem overlay: #{File.directory?(bundled) ? bundled : 'MISSING (reinstall gem)'}"
|
|
237
251
|
0
|
|
@@ -256,6 +270,7 @@ module Galaaz
|
|
|
256
270
|
base = "https://raw.githubusercontent.com/#{OMARCHY_GITHUB_REPO}/#{ref}/script/omarchy"
|
|
257
271
|
puts "galaaz omarchy: fetching #{base}/…"
|
|
258
272
|
names = OMARCHY_BIN_FILES.map(&:first) + [OMARCHY_MENU_FILE, OMARCHY_FONT_REL, OMARCHY_MERGED_FONT_REL]
|
|
273
|
+
names += OMARCHY_NAUTILUS_SCRIPTS.map { |src, _| File.join('nautilus-scripts', src) }
|
|
259
274
|
names.uniq.each do |name|
|
|
260
275
|
url = "#{base}/#{name}"
|
|
261
276
|
dest = File.join(tmp, name)
|
|
@@ -291,9 +306,25 @@ module Galaaz
|
|
|
291
306
|
FileUtils.cp(menu_src, menu_dest)
|
|
292
307
|
puts "galaaz omarchy: #{menu_dest}"
|
|
293
308
|
|
|
309
|
+
install_omarchy_nautilus_scripts_from!(src_dir)
|
|
294
310
|
install_omarchy_font_from!(src_dir)
|
|
295
311
|
end
|
|
296
312
|
|
|
313
|
+
def install_omarchy_nautilus_scripts_from!(src_dir)
|
|
314
|
+
src_root = File.join(src_dir, 'nautilus-scripts')
|
|
315
|
+
dest_root = File.expand_path('~/.local/share/nautilus/scripts/Galaaz')
|
|
316
|
+
FileUtils.mkdir_p(dest_root)
|
|
317
|
+
OMARCHY_NAUTILUS_SCRIPTS.each do |src_name, dest_name|
|
|
318
|
+
src = File.join(src_root, src_name)
|
|
319
|
+
abort_unless(File.file?(src), "missing #{src}")
|
|
320
|
+
dest = File.join(dest_root, dest_name)
|
|
321
|
+
FileUtils.cp(src, dest)
|
|
322
|
+
FileUtils.chmod(0o755, dest)
|
|
323
|
+
puts "galaaz omarchy: #{dest}"
|
|
324
|
+
end
|
|
325
|
+
puts 'galaaz omarchy: Nautilus → right-click .Rmd → Scripts → Galaaz'
|
|
326
|
+
end
|
|
327
|
+
|
|
297
328
|
def install_omarchy_font_from!(src_dir)
|
|
298
329
|
# 1) Standalone galaaz.ttf (family galaaz) — debugging / fc-list checks.
|
|
299
330
|
src = File.join(src_dir, OMARCHY_FONT_REL)
|
|
@@ -108,6 +108,108 @@ ensure_pandoc() {
|
|
|
108
108
|
return 0
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
pkg_add() {
|
|
112
|
+
if command -v omarchy-pkg-add >/dev/null 2>&1; then
|
|
113
|
+
omarchy-pkg-add "$@"
|
|
114
|
+
elif command -v pacman >/dev/null 2>&1; then
|
|
115
|
+
sudo pacman -S --noconfirm --needed "$@"
|
|
116
|
+
else
|
|
117
|
+
echo "ERROR: need omarchy-pkg-add or pacman to install: $*" >&2
|
|
118
|
+
return 1
|
|
119
|
+
fi
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
# red-arrow needs pkg-config "arrow" + "arrow-glib" at the same version.
|
|
123
|
+
# Arch ships C++ Arrow (extra/arrow) but not Arrow GLib — build GLib from the
|
|
124
|
+
# matching Apache tarball. Keep ARROW_USE_PKG_CONFIG=false for CRAN R arrow
|
|
125
|
+
# (LIBARROW_BINARY); pacman arrow is only for the Ruby gem.
|
|
126
|
+
ensure_arrow_for_red_arrow() {
|
|
127
|
+
local major ver tmp tarball url build_dir
|
|
128
|
+
major=25
|
|
129
|
+
|
|
130
|
+
echo "==> system: Apache Arrow C++ + GLib (for red-arrow)"
|
|
131
|
+
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
|
|
132
|
+
|
|
133
|
+
if ! command -v pkg-config >/dev/null 2>&1; then
|
|
134
|
+
pkg_add pkgconf || return 1
|
|
135
|
+
fi
|
|
136
|
+
|
|
137
|
+
if ! pkg-config --exists "arrow >= ${major}" 2>/dev/null; then
|
|
138
|
+
echo "==> install Arch package: arrow"
|
|
139
|
+
if ! pkg_add arrow; then
|
|
140
|
+
echo "ERROR: failed to install Arch arrow (Apache Arrow C++)" >&2
|
|
141
|
+
return 1
|
|
142
|
+
fi
|
|
143
|
+
fi
|
|
144
|
+
|
|
145
|
+
if ! pkg-config --exists "arrow >= ${major}" 2>/dev/null; then
|
|
146
|
+
echo "ERROR: Apache Arrow C++ >= ${major} still missing after pacman install" >&2
|
|
147
|
+
echo " pkg-config --modversion arrow: $(pkg-config --modversion arrow 2>/dev/null || echo none)" >&2
|
|
148
|
+
return 1
|
|
149
|
+
fi
|
|
150
|
+
ver="$(pkg-config --modversion arrow)"
|
|
151
|
+
echo "arrow (C++): ${ver}"
|
|
152
|
+
|
|
153
|
+
if pkg-config --exists "arrow-glib = ${ver}" 2>/dev/null; then
|
|
154
|
+
echo "arrow-glib: $(pkg-config --modversion arrow-glib) (already installed)"
|
|
155
|
+
return 0
|
|
156
|
+
fi
|
|
157
|
+
|
|
158
|
+
echo "==> Arrow GLib ${ver} missing — building from Apache source (Arch has no matching package)"
|
|
159
|
+
pkg_add meson ninja gobject-introspection glib2 || return 1
|
|
160
|
+
|
|
161
|
+
tarball="apache-arrow-${ver}.tar.gz"
|
|
162
|
+
url="https://dlcdn.apache.org/arrow/arrow-${ver}/${tarball}"
|
|
163
|
+
tmp="$(mktemp -d)"
|
|
164
|
+
build_dir="${tmp}/apache-arrow-${ver}"
|
|
165
|
+
echo "==> download: ${url}"
|
|
166
|
+
if ! curl -fsSL -o "${tmp}/${tarball}" "${url}"; then
|
|
167
|
+
url="https://archive.apache.org/dist/arrow/arrow-${ver}/${tarball}"
|
|
168
|
+
echo "==> fallback: ${url}"
|
|
169
|
+
if ! curl -fsSL -o "${tmp}/${tarball}" "${url}"; then
|
|
170
|
+
echo "ERROR: failed to download Apache Arrow ${ver} sources" >&2
|
|
171
|
+
rm -rf "${tmp}"
|
|
172
|
+
return 1
|
|
173
|
+
fi
|
|
174
|
+
fi
|
|
175
|
+
tar -xzf "${tmp}/${tarball}" -C "${tmp}"
|
|
176
|
+
if [[ ! -d "${build_dir}/c_glib" ]]; then
|
|
177
|
+
echo "ERROR: c_glib missing from ${tarball}" >&2
|
|
178
|
+
rm -rf "${tmp}"
|
|
179
|
+
return 1
|
|
180
|
+
fi
|
|
181
|
+
|
|
182
|
+
echo "==> meson setup / compile / install arrow-glib ${ver}"
|
|
183
|
+
if ! meson setup "${build_dir}/c_glib.build" "${build_dir}/c_glib" \
|
|
184
|
+
--buildtype=release \
|
|
185
|
+
--prefix=/usr/local \
|
|
186
|
+
-Dgtk_doc=false; then
|
|
187
|
+
echo "ERROR: meson setup for arrow-glib failed" >&2
|
|
188
|
+
rm -rf "${tmp}"
|
|
189
|
+
return 1
|
|
190
|
+
fi
|
|
191
|
+
if ! meson compile -C "${build_dir}/c_glib.build"; then
|
|
192
|
+
echo "ERROR: meson compile for arrow-glib failed" >&2
|
|
193
|
+
rm -rf "${tmp}"
|
|
194
|
+
return 1
|
|
195
|
+
fi
|
|
196
|
+
if ! sudo meson install -C "${build_dir}/c_glib.build"; then
|
|
197
|
+
echo "ERROR: meson install for arrow-glib failed" >&2
|
|
198
|
+
rm -rf "${tmp}"
|
|
199
|
+
return 1
|
|
200
|
+
fi
|
|
201
|
+
sudo ldconfig 2>/dev/null || true
|
|
202
|
+
rm -rf "${tmp}"
|
|
203
|
+
|
|
204
|
+
if ! pkg-config --exists "arrow-glib = ${ver}" 2>/dev/null; then
|
|
205
|
+
echo "ERROR: arrow-glib ${ver} still missing after build" >&2
|
|
206
|
+
echo " pkg-config --modversion arrow-glib: $(pkg-config --modversion arrow-glib 2>/dev/null || echo none)" >&2
|
|
207
|
+
return 1
|
|
208
|
+
fi
|
|
209
|
+
echo "arrow-glib: $(pkg-config --modversion arrow-glib) (built from Apache ${ver})"
|
|
210
|
+
return 0
|
|
211
|
+
}
|
|
212
|
+
|
|
111
213
|
pause() {
|
|
112
214
|
local st=$1
|
|
113
215
|
echo
|
|
@@ -138,15 +240,17 @@ case "${PROFILE}" in
|
|
|
138
240
|
fi
|
|
139
241
|
;;
|
|
140
242
|
arrow|ledger|demo)
|
|
141
|
-
# R package arrow: do NOT
|
|
142
|
-
#
|
|
143
|
-
#
|
|
144
|
-
# if the user only refreshed this wrapper.
|
|
243
|
+
# R package arrow: do NOT link pacman arrow (version skew vs CRAN) —
|
|
244
|
+
# LIBARROW_BINARY uses Apache's version-matched prebuilt. pacman arrow +
|
|
245
|
+
# built arrow-glib are only for CRuby red-arrow (Stage B).
|
|
145
246
|
export LIBARROW_BINARY=true
|
|
146
247
|
export NOT_CRAN=true
|
|
147
248
|
export LIBARROW_BUILD=false
|
|
148
249
|
export ARROW_USE_PKG_CONFIG=false
|
|
149
250
|
echo "==> arrow env: LIBARROW_BINARY=true LIBARROW_BUILD=false ARROW_USE_PKG_CONFIG=false"
|
|
251
|
+
if ! ensure_arrow_for_red_arrow; then
|
|
252
|
+
pause 1
|
|
253
|
+
fi
|
|
150
254
|
;;
|
|
151
255
|
bio|examples) ;;
|
|
152
256
|
*)
|
|
@@ -1,73 +1,130 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# Safe/debug gknit for Omarchy:
|
|
2
|
+
# Safe/debug gknit for Omarchy: log everything, keep the window open.
|
|
3
3
|
#
|
|
4
4
|
# Usage:
|
|
5
|
-
# omarchy-galaaz-gknit [path/to/file.Rmd]
|
|
6
|
-
# omarchy-galaaz-gknit
|
|
5
|
+
# omarchy-galaaz-gknit [path/to/file.Rmd ...]
|
|
6
|
+
# omarchy-galaaz-gknit --output_format pdf_document path.Rmd
|
|
7
|
+
# omarchy-galaaz-gknit path.Rmd pdf_document # positional format (Nautilus)
|
|
7
8
|
#
|
|
8
|
-
# Many shipped blogs list pdf_document before
|
|
9
|
-
# `gknit file.Rmd` then tries PDF first
|
|
10
|
-
# a small VM. This wrapper always requests html_document and tees a log.
|
|
9
|
+
# Default format is html_document. Many shipped blogs list pdf_document before
|
|
10
|
+
# html_document in YAML; a bare `gknit file.Rmd` then tries PDF first.
|
|
11
11
|
set -uo pipefail
|
|
12
12
|
|
|
13
13
|
LOG_DIR="${HOME}/.local/share/galaaz"
|
|
14
14
|
LOG="${LOG_DIR}/gknit-debug.log"
|
|
15
15
|
mkdir -p "${LOG_DIR}"
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
FMT="html_document"
|
|
18
|
+
FILES=()
|
|
19
|
+
|
|
20
|
+
while [[ $# -gt 0 ]]; do
|
|
21
|
+
case "$1" in
|
|
22
|
+
--output_format|-o)
|
|
23
|
+
if [[ $# -lt 2 ]]; then
|
|
24
|
+
echo "Missing value for $1"
|
|
25
|
+
echo "Press Enter to close..."
|
|
26
|
+
read -r _ || true
|
|
27
|
+
exit 1
|
|
28
|
+
fi
|
|
29
|
+
FMT="$2"
|
|
30
|
+
shift 2
|
|
31
|
+
;;
|
|
32
|
+
--)
|
|
33
|
+
shift
|
|
34
|
+
FILES+=("$@")
|
|
35
|
+
break
|
|
36
|
+
;;
|
|
37
|
+
-*)
|
|
38
|
+
echo "Unknown option: $1"
|
|
39
|
+
echo "Press Enter to close..."
|
|
40
|
+
read -r _ || true
|
|
41
|
+
exit 1
|
|
42
|
+
;;
|
|
43
|
+
*)
|
|
44
|
+
# Positional: first non-option that is not an existing .Rmd and looks like
|
|
45
|
+
# an rmarkdown format name can be treated as format when FILES already set,
|
|
46
|
+
# or as format when it does not end in .Rmd/.Rmarkdown.
|
|
47
|
+
lower="${1,,}"
|
|
48
|
+
if [[ "${lower}" == *.rmd || "${lower}" == *.rmarkdown ]]; then
|
|
49
|
+
FILES+=("$1")
|
|
50
|
+
elif [[ ${#FILES[@]} -eq 0 && -f "$1" ]]; then
|
|
51
|
+
FILES+=("$1")
|
|
52
|
+
elif [[ "$1" =~ ^(html_document|pdf_document|all|[a-zA-Z0-9_]+)$ ]]; then
|
|
53
|
+
FMT="$1"
|
|
54
|
+
else
|
|
55
|
+
FILES+=("$1")
|
|
56
|
+
fi
|
|
57
|
+
shift
|
|
58
|
+
;;
|
|
59
|
+
esac
|
|
60
|
+
done
|
|
24
61
|
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
echo "cwd: $(pwd)"
|
|
29
|
-
echo "forcing: --output_format html_document"
|
|
30
|
-
echo "log: ${LOG}"
|
|
31
|
-
command -v pandoc >/dev/null && pandoc --version | head -1 || echo "pandoc: MISSING"
|
|
32
|
-
command -v gknit >/dev/null && echo "gknit: $(command -v gknit)" || echo "gknit: via mise/wrapper"
|
|
33
|
-
free -h 2>/dev/null | head -2 || true
|
|
34
|
-
echo
|
|
35
|
-
} | tee "${LOG}"
|
|
62
|
+
if [[ ${#FILES[@]} -eq 0 ]]; then
|
|
63
|
+
FILES=("${HOME}/galaaz-blogs/oh_my/oh_my.Rmd")
|
|
64
|
+
fi
|
|
36
65
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
mise x ruby -- gknit --output_format html_document --no_clean "${base}"
|
|
44
|
-
else
|
|
45
|
-
gknit --output_format html_document --no_clean "${base}"
|
|
66
|
+
overall=0
|
|
67
|
+
for RMD in "${FILES[@]}"; do
|
|
68
|
+
if [[ ! -f "${RMD}" ]]; then
|
|
69
|
+
echo "Missing Rmd: ${RMD}"
|
|
70
|
+
overall=1
|
|
71
|
+
continue
|
|
46
72
|
fi
|
|
47
|
-
) 2>&1 | tee -a "${LOG}"
|
|
48
|
-
st=${PIPESTATUS[0]}
|
|
49
|
-
set -e
|
|
50
73
|
|
|
51
|
-
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
echo "
|
|
59
|
-
|
|
60
|
-
echo
|
|
74
|
+
{
|
|
75
|
+
echo "=== gknit debug $(date -Iseconds) ==="
|
|
76
|
+
echo "rmd: ${RMD}"
|
|
77
|
+
echo "cwd: $(pwd)"
|
|
78
|
+
echo "forcing: --output_format ${FMT}"
|
|
79
|
+
echo "log: ${LOG}"
|
|
80
|
+
command -v pandoc >/dev/null && pandoc --version | head -1 || echo "pandoc: MISSING"
|
|
81
|
+
command -v gknit >/dev/null && echo "gknit: $(command -v gknit)" || echo "gknit: via mise/wrapper"
|
|
82
|
+
free -h 2>/dev/null | head -2 || true
|
|
83
|
+
echo
|
|
84
|
+
} | tee -a "${LOG}"
|
|
85
|
+
|
|
86
|
+
set +e
|
|
87
|
+
(
|
|
88
|
+
cd "$(dirname "${RMD}")" || exit 1
|
|
89
|
+
base="$(basename "${RMD}")"
|
|
90
|
+
if command -v mise >/dev/null 2>&1; then
|
|
91
|
+
mise x ruby -- gknit --output_format "${FMT}" --no_clean "${base}"
|
|
92
|
+
else
|
|
93
|
+
gknit --output_format "${FMT}" --no_clean "${base}"
|
|
94
|
+
fi
|
|
95
|
+
) 2>&1 | tee -a "${LOG}"
|
|
96
|
+
st=${PIPESTATUS[0]}
|
|
97
|
+
set +e
|
|
98
|
+
|
|
99
|
+
{
|
|
100
|
+
echo
|
|
101
|
+
echo "exit: ${st}"
|
|
102
|
+
echo "--- recent kernel/OOM hints (if any) ---"
|
|
103
|
+
dmesg -T 2>/dev/null | grep -iE 'oom|killed process|out of memory' | tail -5 || echo "(no dmesg access or no OOM lines)"
|
|
104
|
+
stem="${RMD%.*}"
|
|
105
|
+
case "${FMT}" in
|
|
106
|
+
pdf_document) out="${stem}.pdf" ;;
|
|
107
|
+
html_document|*) out="${stem}.html" ;;
|
|
108
|
+
esac
|
|
109
|
+
if [[ -f "${out}" ]]; then
|
|
110
|
+
echo "output: ${out}"
|
|
111
|
+
else
|
|
112
|
+
echo "output: not found for format ${FMT} (knit likely failed before write)"
|
|
113
|
+
fi
|
|
114
|
+
echo "FULL LOG: ${LOG}"
|
|
115
|
+
} | tee -a "${LOG}"
|
|
116
|
+
|
|
117
|
+
if [[ "${st}" -ne 0 ]]; then
|
|
118
|
+
overall="${st}"
|
|
61
119
|
fi
|
|
62
|
-
|
|
63
|
-
} | tee -a "${LOG}"
|
|
120
|
+
done
|
|
64
121
|
|
|
65
122
|
echo
|
|
66
|
-
if [[ "${
|
|
67
|
-
echo "FAILED (exit ${
|
|
123
|
+
if [[ "${overall}" -ne 0 ]]; then
|
|
124
|
+
echo "FAILED (exit ${overall}). Scroll up or: less ${LOG}"
|
|
68
125
|
else
|
|
69
126
|
echo "OK."
|
|
70
127
|
fi
|
|
71
128
|
echo "Press Enter to close (so a crash mid-run still leaves this log on disk)..."
|
|
72
129
|
read -r _ || true
|
|
73
|
-
exit "${
|
|
130
|
+
exit "${overall}"
|
|
@@ -317,6 +317,26 @@ if [[ -f "${SCRIPT_DIR}/galaaz-gknit.sh" ]]; then
|
|
|
317
317
|
log "gknit helper: ${HOME}/.local/bin/omarchy-galaaz-gknit"
|
|
318
318
|
fi
|
|
319
319
|
|
|
320
|
+
# Nautilus right-click → Scripts → Galaaz → gknit
|
|
321
|
+
NAUTILUS_SCRIPTS_SRC="${SCRIPT_DIR}/nautilus-scripts"
|
|
322
|
+
NAUTILUS_SCRIPTS_DEST="${HOME}/.local/share/nautilus/scripts/Galaaz"
|
|
323
|
+
if [[ -d "${NAUTILUS_SCRIPTS_SRC}" ]]; then
|
|
324
|
+
mkdir -p "${NAUTILUS_SCRIPTS_DEST}"
|
|
325
|
+
if [[ -f "${NAUTILUS_SCRIPTS_SRC}/gknit-html" ]]; then
|
|
326
|
+
cp "${NAUTILUS_SCRIPTS_SRC}/gknit-html" "${NAUTILUS_SCRIPTS_DEST}/Gknit HTML"
|
|
327
|
+
chmod +x "${NAUTILUS_SCRIPTS_DEST}/Gknit HTML"
|
|
328
|
+
fi
|
|
329
|
+
if [[ -f "${NAUTILUS_SCRIPTS_SRC}/gknit-pdf" ]]; then
|
|
330
|
+
cp "${NAUTILUS_SCRIPTS_SRC}/gknit-pdf" "${NAUTILUS_SCRIPTS_DEST}/Gknit PDF"
|
|
331
|
+
chmod +x "${NAUTILUS_SCRIPTS_DEST}/Gknit PDF"
|
|
332
|
+
fi
|
|
333
|
+
if [[ -f "${NAUTILUS_SCRIPTS_SRC}/gknit-choose-format" ]]; then
|
|
334
|
+
cp "${NAUTILUS_SCRIPTS_SRC}/gknit-choose-format" "${NAUTILUS_SCRIPTS_DEST}/Gknit Choose Format"
|
|
335
|
+
chmod +x "${NAUTILUS_SCRIPTS_DEST}/Gknit Choose Format"
|
|
336
|
+
fi
|
|
337
|
+
log "nautilus Scripts/Galaaz: ${NAUTILUS_SCRIPTS_DEST}"
|
|
338
|
+
fi
|
|
339
|
+
|
|
320
340
|
mkdir -p "${HOME}/.config/galaaz/profiles"
|
|
321
341
|
date -Iseconds >"${HOME}/.config/galaaz/profiles/core"
|
|
322
342
|
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Nautilus Scripts → Galaaz → Gknit Choose Format
|
|
3
|
+
# Uses NAUTILUS_SCRIPT_SELECTED_FILE_PATHS (newline-separated).
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
GK="${HOME}/.local/bin/omarchy-galaaz-gknit"
|
|
7
|
+
FILES=()
|
|
8
|
+
|
|
9
|
+
while IFS= read -r f; do
|
|
10
|
+
[[ -z "${f}" ]] && continue
|
|
11
|
+
case "${f,,}" in
|
|
12
|
+
*.rmd|*.rmarkdown) FILES+=("${f}") ;;
|
|
13
|
+
esac
|
|
14
|
+
done <<< "${NAUTILUS_SCRIPT_SELECTED_FILE_PATHS:-}"
|
|
15
|
+
|
|
16
|
+
if [[ ${#FILES[@]} -eq 0 ]]; then
|
|
17
|
+
notify-send "Galaaz" "Select one or more .Rmd files to gknit." 2>/dev/null || true
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
if [[ ! -x "${GK}" ]]; then
|
|
22
|
+
notify-send "Galaaz" "Missing ${GK}. Run: galaaz omarchy install" 2>/dev/null || true
|
|
23
|
+
exit 1
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
FMT=""
|
|
27
|
+
if command -v zenity >/dev/null 2>&1; then
|
|
28
|
+
FMT="$(
|
|
29
|
+
zenity --list \
|
|
30
|
+
--title="Galaaz gknit" \
|
|
31
|
+
--text="Output format for ${#FILES[@]} Rmd file(s):" \
|
|
32
|
+
--column="Format" \
|
|
33
|
+
html_document \
|
|
34
|
+
pdf_document \
|
|
35
|
+
all \
|
|
36
|
+
--height=280 \
|
|
37
|
+
--width=360 \
|
|
38
|
+
2>/dev/null || true
|
|
39
|
+
)"
|
|
40
|
+
elif command -v kdialog >/dev/null 2>&1; then
|
|
41
|
+
FMT="$(
|
|
42
|
+
kdialog --title "Galaaz gknit" --combobox "Output format:" \
|
|
43
|
+
html_document pdf_document all \
|
|
44
|
+
--default html_document 2>/dev/null || true
|
|
45
|
+
)"
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
if [[ -z "${FMT}" ]]; then
|
|
49
|
+
notify-send "Galaaz" "Format picker cancelled (or install zenity)." 2>/dev/null || true
|
|
50
|
+
exit 0
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
if command -v omarchy-launch-tui >/dev/null 2>&1; then
|
|
54
|
+
omarchy-launch-tui "${GK}" --output_format "${FMT}" -- "${FILES[@]}"
|
|
55
|
+
elif command -v xdg-terminal-exec >/dev/null 2>&1; then
|
|
56
|
+
xdg-terminal-exec "${GK}" --output_format "${FMT}" -- "${FILES[@]}"
|
|
57
|
+
elif command -v alacritty >/dev/null 2>&1; then
|
|
58
|
+
alacritty -e "${GK}" --output_format "${FMT}" -- "${FILES[@]}"
|
|
59
|
+
else
|
|
60
|
+
"${GK}" --output_format "${FMT}" -- "${FILES[@]}"
|
|
61
|
+
fi
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Nautilus Scripts → Galaaz → Gknit HTML
|
|
3
|
+
# Uses NAUTILUS_SCRIPT_SELECTED_FILE_PATHS (newline-separated).
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
GK="${HOME}/.local/bin/omarchy-galaaz-gknit"
|
|
7
|
+
FMT="html_document"
|
|
8
|
+
FILES=()
|
|
9
|
+
|
|
10
|
+
while IFS= read -r f; do
|
|
11
|
+
[[ -z "${f}" ]] && continue
|
|
12
|
+
case "${f,,}" in
|
|
13
|
+
*.rmd|*.rmarkdown) FILES+=("${f}") ;;
|
|
14
|
+
esac
|
|
15
|
+
done <<< "${NAUTILUS_SCRIPT_SELECTED_FILE_PATHS:-}"
|
|
16
|
+
|
|
17
|
+
if [[ ${#FILES[@]} -eq 0 ]]; then
|
|
18
|
+
notify-send "Galaaz" "Select one or more .Rmd files to gknit (HTML)." 2>/dev/null || true
|
|
19
|
+
exit 1
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
if [[ ! -x "${GK}" ]]; then
|
|
23
|
+
notify-send "Galaaz" "Missing ${GK}. Run: galaaz omarchy install" 2>/dev/null || true
|
|
24
|
+
exit 1
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
launch() {
|
|
28
|
+
if command -v omarchy-launch-tui >/dev/null 2>&1; then
|
|
29
|
+
omarchy-launch-tui "${GK}" --output_format "${FMT}" -- "${FILES[@]}"
|
|
30
|
+
elif command -v xdg-terminal-exec >/dev/null 2>&1; then
|
|
31
|
+
xdg-terminal-exec "${GK}" --output_format "${FMT}" -- "${FILES[@]}"
|
|
32
|
+
elif command -v alacritty >/dev/null 2>&1; then
|
|
33
|
+
alacritty -e "${GK}" --output_format "${FMT}" -- "${FILES[@]}"
|
|
34
|
+
else
|
|
35
|
+
"${GK}" --output_format "${FMT}" -- "${FILES[@]}"
|
|
36
|
+
fi
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
launch
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Nautilus Scripts → Galaaz → Gknit PDF
|
|
3
|
+
# Uses NAUTILUS_SCRIPT_SELECTED_FILE_PATHS (newline-separated).
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
GK="${HOME}/.local/bin/omarchy-galaaz-gknit"
|
|
7
|
+
FMT="pdf_document"
|
|
8
|
+
FILES=()
|
|
9
|
+
|
|
10
|
+
while IFS= read -r f; do
|
|
11
|
+
[[ -z "${f}" ]] && continue
|
|
12
|
+
case "${f,,}" in
|
|
13
|
+
*.rmd|*.rmarkdown) FILES+=("${f}") ;;
|
|
14
|
+
esac
|
|
15
|
+
done <<< "${NAUTILUS_SCRIPT_SELECTED_FILE_PATHS:-}"
|
|
16
|
+
|
|
17
|
+
if [[ ${#FILES[@]} -eq 0 ]]; then
|
|
18
|
+
notify-send "Galaaz" "Select one or more .Rmd files to gknit (PDF)." 2>/dev/null || true
|
|
19
|
+
exit 1
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
if [[ ! -x "${GK}" ]]; then
|
|
23
|
+
notify-send "Galaaz" "Missing ${GK}. Run: galaaz omarchy install" 2>/dev/null || true
|
|
24
|
+
exit 1
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
launch() {
|
|
28
|
+
if command -v omarchy-launch-tui >/dev/null 2>&1; then
|
|
29
|
+
omarchy-launch-tui "${GK}" --output_format "${FMT}" -- "${FILES[@]}"
|
|
30
|
+
elif command -v xdg-terminal-exec >/dev/null 2>&1; then
|
|
31
|
+
xdg-terminal-exec "${GK}" --output_format "${FMT}" -- "${FILES[@]}"
|
|
32
|
+
elif command -v alacritty >/dev/null 2>&1; then
|
|
33
|
+
alacritty -e "${GK}" --output_format "${FMT}" -- "${FILES[@]}"
|
|
34
|
+
else
|
|
35
|
+
"${GK}" --output_format "${FMT}" -- "${FILES[@]}"
|
|
36
|
+
fi
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
launch
|
data/version.rb
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
$gem_name = "galaaz"
|
|
2
|
-
$version="2.1.10.pre.
|
|
2
|
+
$version="2.1.10.pre.7"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: galaaz
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.10.pre.
|
|
4
|
+
version: 2.1.10.pre.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rodrigo Botafogo
|
|
@@ -449,6 +449,9 @@ files:
|
|
|
449
449
|
- script/omarchy/galaaz-gknit.sh
|
|
450
450
|
- script/omarchy/galaaz-guide.sh
|
|
451
451
|
- script/omarchy/install-galaaz.sh
|
|
452
|
+
- script/omarchy/nautilus-scripts/gknit-choose-format
|
|
453
|
+
- script/omarchy/nautilus-scripts/gknit-html
|
|
454
|
+
- script/omarchy/nautilus-scripts/gknit-pdf
|
|
452
455
|
- script/omarchy/omarchy-menu.jsonc
|
|
453
456
|
- script/omarchy/remove-galaaz.sh
|
|
454
457
|
- specs/all.rb
|