Skip to content

Commit e18c656

Browse files
authored
configs_install.sh: Add a run_with_prefix function draft TODO
1 parent 94d0ef9 commit e18c656

File tree

1 file changed

+24
-35
lines changed

1 file changed

+24
-35
lines changed

Ubuntu_22.04/configs_install.sh

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,46 +13,35 @@
1313
# see: https://askubuntu.com/questions/984205/how-to-save-gnome-settings-in-a-file
1414

1515

16-
# TODO - use sth like this:
17-
# apply_gsettings() {
18-
# local schema="$1"
19-
# while IFS= read -r line; do
20-
# [[ -z "$line" || "$line" =~ ^# ]] && continue
21-
# gsettings set "$schema" "$line"
22-
# done
23-
# }
24-
#
25-
# apply_gsettings "test" <<EOF
26-
# ano
27-
# nie #blabla
28-
# mozno
29-
#
30-
# # lala
31-
# sjsjdj
32-
#
33-
# EOF
34-
35-
# resp
36-
# mapfile -t my_list <<'EOF'
37-
# simpleitem
38-
# item with spaces
39-
# item with a 'single quote'
40-
# item with a "double quote"
41-
# item with both 'single' and "double" quotes
42-
# EOF
43-
44-
# Print each item
45-
# for item in "${my_list[@]}"; do
46-
# echo "$item"
47-
# done
48-
49-
# resp
50-
# xargs -d '\n' -I{} echo "Processing: {}" <<'EOF'
16+
# TODO - simplify repeated prefixes as follows:
17+
18+
# run_with_prefix() {
19+
# local cmd="$1"
20+
# if [[ -z "$cmd" ]]; then
21+
# echo TODO add explanation what the command does.
22+
# echo TODO add help/man page
23+
# echo "Missing command to prefix the lines."
24+
# echo "Usage: process_items <command>"
25+
# echo "Items are passed to stdin (usually as heredocument)"
26+
# return 1
27+
# fi
28+
# grep -vE '^[[:space:]]*(#|$)' | xargs -r -d '\n' -I{} $1 "Processing: {}"
29+
# }
30+
31+
# run_with_prefix 'echo' <<'EOF'
32+
# # This is a comment
5133
# first item
34+
5235
# second item with spaces
36+
# # another comment
5337
# third item with "quotes" and 'single quotes'
38+
5439
# EOF
5540

41+
# Add the helper function to prelude?
42+
# TODO - try to use lists where possible...
43+
44+
5645
# TODO pohrat sa s tymi nastaveniami, ci vlastne su vsetky potrebne a robia to co chcem
5746

5847
. ../prelude.sh

0 commit comments

Comments
 (0)