Add install script
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
_theme_completion() {
|
||||
local options=(
|
||||
'-m[set mode: light, dark, or toggle]:mode:(light dark toggle)'
|
||||
'-w[set wallpaper: specify file path]:file:_files'
|
||||
'-m[Set mode: 'light', 'dark', or 'toggle']:mode:(light dark toggle)'
|
||||
'-w[Set wallpaper file]:file:_files'
|
||||
)
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
@@ -1,9 +1,9 @@
|
||||
WALLPAPER=""
|
||||
MODE=""
|
||||
wallpaper=""
|
||||
mode=""
|
||||
|
||||
set_wallpaper() {
|
||||
if [[ -f "$1" ]]; then
|
||||
WALLPAPER="$1"
|
||||
wallpaper="$1"
|
||||
else
|
||||
echo "Invalid wallpaper path: $1"
|
||||
exit 1
|
||||
@@ -12,9 +12,9 @@ set_wallpaper() {
|
||||
|
||||
toggle_mode() {
|
||||
if [[ "$(cat "${CONFIG}"/mode)" = "light" ]]; then
|
||||
MODE="dark"
|
||||
mode="dark"
|
||||
else
|
||||
MODE="light"
|
||||
mode="light"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ usage() {
|
||||
}
|
||||
|
||||
finish() {
|
||||
[[ -n "${WALLPAPER}" ]] && ln -sf "${WALLPAPER}" "${CONFIG}"/wallpaper
|
||||
[[ -n "${MODE}" ]] && echo "${MODE}" > "${CONFIG}"/mode
|
||||
[[ -n "${wallpaper}" ]] && ln -sf "${wallpaper}" "${CONFIG}"/wallpaper
|
||||
[[ -n "${mode}" ]] && echo "${mode}" > "${CONFIG}"/mode
|
||||
|
||||
"${INIT}" > /dev/null
|
||||
"${RELOAD}" > /dev/null
|
||||
@@ -37,7 +37,7 @@ while getopts "m:w:" opt; do
|
||||
m)
|
||||
case "$OPTARG" in
|
||||
light|dark)
|
||||
MODE="$OPTARG"
|
||||
mode="$OPTARG"
|
||||
;;
|
||||
toggle)
|
||||
toggle_mode
|
||||
|
Reference in New Issue
Block a user