From 853ada54447e427ff3d0ae958f73b63a816c0f60 Mon Sep 17 00:00:00 2001 From: "kujiu (@uberwald)" Date: Sun, 3 Sep 2023 00:36:15 +0200 Subject: [PATCH] Newsboat in Nightfox theme, update script --- .../.config/fish/functions/update-homes.fish | 64 +++++++++++++++++++ desktop/.config/newsboat/colors.conf | 16 +++++ .../.config/newsboat/config | 8 +-- update-home.fish | 7 +- update-private-example.fish | 40 ++++++++++++ 5 files changed, 127 insertions(+), 8 deletions(-) create mode 100644 common/.config/fish/functions/update-homes.fish create mode 100644 desktop/.config/newsboat/colors.conf rename {templates => desktop}/.config/newsboat/config (99%) create mode 100755 update-private-example.fish diff --git a/common/.config/fish/functions/update-homes.fish b/common/.config/fish/functions/update-homes.fish new file mode 100644 index 0000000..e3a155d --- /dev/null +++ b/common/.config/fish/functions/update-homes.fish @@ -0,0 +1,64 @@ +#!/usr/bin/env fish + +function update-homes + argparse 'h/help' 'g/git' 'd/desktop' 'p/private' 'r/root' 'R/remove' -- $argv + + if set --query _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 " -g --git" + echo " Pull-rebase before launch script" + echo + echo " -d --desktop" + echo " Update desktop part" + echo + echo " -p --private" + echo " Update private part" + echo + echo " -r --root" + echo " Update root part" + echo + echo " -R --remove" + echo " Remove old configuration" + echo + echo " -h --help" + echo " Show this screen" + return + end + + pushd ~/homes + if set --query _flag_git + gitpr + end + + set -f options "" + if set --query _flag_desktop + set -f options "--desktop" + end + if set --query _flag_remove + set -f options "$options --remove" + end + if set --query _flag_root + set -f options "$options --root" + end + ./update-home.fish $options + popd + + pushd ~/homes-private + if set --query _flag_git + gitpr + end + + set -f options "" + if set --query _flag_private + set -f options "--private" + end + if set --query _flag_root + set -f options "$options --root" + end + ./update-private.fish $options + popd +end diff --git a/desktop/.config/newsboat/colors.conf b/desktop/.config/newsboat/colors.conf new file mode 100644 index 0000000..0dded9f --- /dev/null +++ b/desktop/.config/newsboat/colors.conf @@ -0,0 +1,16 @@ +# Theme : nightfox +# Upstream : https://github.com/EdenEast/nightfox.nvim/ + +color background color145 default +color listnormal color145 default +color listfocus color80 color59 bold +color listnormal_unread color108 default +color listfocus_unread color215 color59 bold +color info color39 color237 bold +color article color145 default +color end-of-text-marker color140 default +color title color39 color237 bold +color hint-key color180 color237 +color hint-keys-delimiter color39 color237 +color hint-separator color39 color237 +color hint-description color39 color237 diff --git a/templates/.config/newsboat/config b/desktop/.config/newsboat/config similarity index 99% rename from templates/.config/newsboat/config rename to desktop/.config/newsboat/config index fbf4f8b..75ada52 100644 --- a/templates/.config/newsboat/config +++ b/desktop/.config/newsboat/config @@ -535,7 +535,7 @@ freshrss-flag-star "b" # # Default value: "" # -freshrss-login "example_user" +freshrss-login "FRESHRSSLOGIN" #### freshrss-min-items # @@ -569,7 +569,7 @@ freshrss-min-items 200 # # Default value: "" # -freshrss-passwordeval "keyring get 'rss:freshrss.example.com' example_user" +freshrss-passwordeval "keyring get 'FRESHRSSKEEPASSXC' FRESHRSSLOGIN" #### freshrss-passwordfile # @@ -602,7 +602,7 @@ freshrss-passwordeval "keyring get 'rss:freshrss.example.com' example_user" # # Default value: "" # -freshrss-url "https://freshrss.example.com/api/greader.php" +freshrss-url "FRESHRSSURL" #### goto-first-unread # @@ -745,7 +745,7 @@ freshrss-url "https://freshrss.example.com/api/greader.php" # # Default value: n/a # -# include "~/.newsboat/colors" +include "~/.config/newsboat/colors.conf" #### inoreader-app-id # diff --git a/update-home.fish b/update-home.fish index 56af469..c5b96a6 100755 --- a/update-home.fish +++ b/update-home.fish @@ -19,9 +19,8 @@ end if set --query _flag_desktop # Copy the desktop part echo "**** Copying desktop part" - rsync -av ./desktop/ ~/ + rsync --exclude=".*.swp" -av ./desktop/ ~/ pip install --user --break-system-packages -U poezio-omemo epr-reader - sed -i "s/REPLACEDEVICEHOSTNAME/`hostname`/g" ~/.config/poezio/poezio.cfg end if set --query _flag_remove @@ -39,7 +38,7 @@ end if set --query _flag_root echo "**** Copying root part" - rsync -av ./root/ ~/ + rsync --exclude=".*.swp" -av ./root/ ~/ end go install github.com/jesseduffield/lazydocker@latest @@ -54,4 +53,4 @@ popd rm -rf ~/.cache/nvimpager-git # Copy the common part -rsync -av ./common/ ~/ +rsync --exclude=".*.swp" -av ./common/ ~/ diff --git a/update-private-example.fish b/update-private-example.fish new file mode 100755 index 0000000..66a8315 --- /dev/null +++ b/update-private-example.fish @@ -0,0 +1,40 @@ +#!/usr/bin/env fish + +# Template for update-private.fish +# To place in ~/homes-private +# +# This example assumes these folders exist: +# - ~/homes-private/private +# - ~/homes-private/root +# +# Please create your own private repository for secrets + +argparse 'r/root' 'p/private' 'h/help' -- $argv + +if set --query _flag_help + echo "Update home with config files" + echo "WARNING: ERASE YOUR ACTUAL CONFIG" + echo + echo "Usage:" + echo "-p : private files" + echo "-r : copy root files" + echo "-h : this help" + echo + exit +end + +if set --query _flag_private + # Copy the private part + echo "**** Copying private part" + rsync --exclude=".*.swp" -av ./private/ ~/ + + sed -i "s/REPLACEDEVICEHOSTNAME/`hostname`/g" ~/.config/poezio/poezio.cfg + + sed -i "s/FRESHRSSLOGIN/example_user/g" ~/.config/newsboat/config + sed -i "s/FRESHRSSKEEPASSXC/rss:freshrss.example.com/g" ~/.config/newsboat/config + sed -i "s/FRESHRSSURL/https:\/\/freshrss.example.com\/api\/greader.php/g" ~/.config/newsboat/config +end + +if set --query _flag_root + rsync --exclude=".*.swp" -av ./root/ ~/ +end