Add install script

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-01-12 14:13:35 +00:00
parent 8e18ca20a9
commit e9a55eed52
17 changed files with 323 additions and 185 deletions

View File

@@ -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