-
Notifications
You must be signed in to change notification settings - Fork 0
/
gchezmoi
executable file
·76 lines (71 loc) · 3.35 KB
/
gchezmoi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/bash
# Author: zenobit
# Description: Uses gum to provide a simple TUI
# License MIT
echo "#TODO add git"
# color
c="#295340"
export GUM_FILTER_INDICATOR_FOREGROUND=${c}
export GUM_FILTER_SELECTED_PREFIX_FOREGROUND=${c}
export GUM_FILTER_HEADER_FOREGROUND=${c}
export GUM_FILTER_CURSOR_TEXT_FOREGROUND=${c}
export GUM_STYLE_FOREGROUND="212"
export GUM_STYLE_BORDER_FOREGROUND="212"
export GUM_STYLE_BORDER="rounded"
# filter height
h=41
header() {
gum style \
--padding '0 1' \
--align center \
--border rounded
--border-foreground $c \
"TUI for chezmoi $(chezmoi --version | cut -d' ' -f3 | cut -d',' -f1'')
Manage your dotfiles across multiple diverse machines, securely"
}
header
choice=$(echo "\
add Add an existing file, directory, or symlink to the source state
age Interact with age
apply Update the destination directory to match the target state
archive Generate a tar archive of the target state
cat Print the target contents of a file, script, or symlink
cat-config Print the configuration file
cd Launch a shell in the source directory
chattr Change the attributes of a target in the source state
completion Generate shell completion code
data Print the template data
decrypt Decrypt file or standard input
diff Print the diff between the target state and the destination state
doctor Check your system for potential problems
dump Generate a dump of the target state
dump-config Dump the configuration values
edit Edit the source state of a target
edit-config Edit the configuration file
edit-config-template Edit the configuration file template
encrypt Encrypt file or standard input
execute-template Execute the given template(s)
forget Remove a target from the source state
generate Generate a file for use with chezmoi
git Run git in the source directory
help Print help about a command
ignored Print ignored targets
import Import an archive into the source state
init Setup the source directory and update the destination directory to match the target state
license Print license
managed List the managed entries in the destination directory
merge Perform a three-way merge between the destination state, the source state, and the target state
merge-all Perform a three-way merge for each modified file
purge Purge chezmoi's configuration and data
re-add Re-add modified files
remove Remove a target from the source state and the destination directory
secret Interact with a secret manager
source-path Print the source path of a target
state Manipulate the persistent state
status Show the status of targets
target-path Print the target path of a source path
unmanaged List the unmanaged files in the destination directory
update Pull and apply any changes
verify Exit with success if the destination state matches the target state, fail otherwise\
" | gum filter --header "Action..." --height $h)
chezmoi $(echo ${choice} | cut -d' ' -f1)