homes/update-homes-secrets-example.fish

81 lines
2.8 KiB
Fish
Raw Normal View History

2023-09-04 16:14:08 +02:00
#!/usr/bin/env fish
# Template for update-homes-secrets
# To place in ~/homes-private/common/.config/fish/functions
#
# This example assumes this folder exists:
# - ~/homes-private
#
# Note: you can change path with env variables
# HOMES_PATH and HOMES_PRIVATE_PATH
#
# Please create your own private repository for secrets
function update-homes-secrets -d "Update secrets for configuration of homes"
argparse 'h/help' 'd/desktop' 'r/root' -- $argv
if set -q _flag_help
echo "Update home's configuration"
echo
echo "You need to have homes and homes-private in your home directory."
echo "This function launch the two scripts to update your conf."
echo
echo " -d --desktop"
echo " Update desktop part"
echo
echo " -r --root"
echo " Update root part"
echo
echo " -h --help"
echo " Show this screen"
return
end
if set --query _flag_desktop
2023-09-06 02:22:26 +02:00
echo
echo
echo (set_color 81b29a)"*** Set secrets ***"(set_color normal)
echo
echo
echo (set_color 719cd6)"*** Set poezio ***"(set_color normal)
echo
2023-09-04 16:14:08 +02:00
sed -i "s/REPLACE_DEVICE_HOSTNAME/`hostname`/g" ~/.config/poezio/poezio.cfg
sed -i "s/REPLACE_FINGERPRINT/cert_fingerprint/g" ~/.config/poezio/poezio.cfg
sed -i "s/REPLACE_JID/template@example.com/g" ~/.config/poezio/poezio.cfg
2024-01-23 02:59:56 +01:00
sed -i "s/BITWARDENPASS/xmpp:template@example.com/g" ~/.config/poezio/poezio.cfg
2023-09-08 15:52:05 +02:00
sed -i "s/REPLACEDATADIR/.local\/share\/poezio/g" ~/.config/poezio/poezio.cfg
sed -i "s/REPLACECONFDIR/.config\/poezio/g" ~/.config/poezio/poezio.cfg
sed -i "s/REPLACECACHEDIR/.cache\/poezio/g" ~/.config/poezio/poezio.cfg
2023-09-04 16:14:08 +02:00
2023-09-06 02:22:26 +02:00
echo
echo
echo (set_color 719cd6)"*** Set newsboat ***"(set_color normal)
echo
2023-09-04 16:14:08 +02:00
sed -i "s/FRESHRSSLOGIN/example_user/g" ~/.config/newsboat/config
2024-01-23 02:59:56 +01:00
sed -i "s/FRESHRSSBITWARDEN/rss:freshrss.example.com/g" ~/.config/newsboat/config
2023-09-04 16:14:08 +02:00
sed -i "s/FRESHRSSURL/https:\/\/freshrss.example.com\/api\/greader.php/g" ~/.config/newsboat/config
2023-10-18 00:45:39 +02:00
echo
echo
echo (set_color 719cd6)"*** Set notmuch ***"(set_color normal)
echo
sed -i "s:REPLACE_HOME_USER:$HOME:g" ~/.local/share/systemd/user/notmuch.service
echo
echo
echo (set_color 719cd6)"*** Set git ***"(set_color normal)
echo
sed -i "s/REPLACEUSER/example (@$(hostname))/g" ~/.config/git/config
sed -i "s/REPLACEMAIL/test@example.com/g" ~/.config/git/config
sed -i "s/REPLACEKEY/HEX/g" ~/.config/git/config
2023-12-23 02:25:04 +01:00
echo
echo
echo (set_color 719cd6)"*** Set neomutt ***"(set_color normal)
echo
sed -i "s/REPLACE_WITH_TAG_TRANSFORMS//g" ~/.config/neomutt/neomuttrc
2023-09-04 16:14:08 +02:00
end
end