Add backup script

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-01-12 13:20:31 +00:00
parent fca554dbd4
commit 8e18ca20a9
12 changed files with 160 additions and 51 deletions

View File

@@ -533,6 +533,6 @@ in
}
);
programs.zsh.initExtra = builtins.readFile ./theme.completion.sh;
programs.zsh.initExtra = builtins.readFile ./theme.completion.zsh;
};
}

View File

@@ -1,4 +1,4 @@
_theme-completion() {
_theme_completion() {
local options=(
'-m[set mode: light, dark, or toggle]:mode:(light dark toggle)'
'-w[set wallpaper: specify file path]:file:_files'
@@ -8,4 +8,4 @@ _theme-completion() {
_arguments -s $options
}
compdef _theme-completion theme
compdef _theme_completion theme

View File

@@ -18,8 +18,9 @@ toggle_mode() {
fi
}
show_usage() {
usage() {
echo "Usage: theme [-m {light|dark|toggle}] [-w <file>]"
exit 1
}
finish() {
@@ -42,8 +43,7 @@ while getopts "m:w:" opt; do
toggle_mode
;;
*)
show_usage
exit 1
usage
;;
esac
;;
@@ -51,8 +51,7 @@ while getopts "m:w:" opt; do
set_wallpaper "$OPTARG"
;;
*)
show_usage
exit 1
usage
;;
esac
done