From 85509d556c15a110ffdff9476e4478e4bfa73451 Mon Sep 17 00:00:00 2001 From: Yigid BALABAN Date: Mon, 23 Dec 2024 17:35:13 +0300 Subject: [PATCH] wip: hyprpaper_single.sh --- chores/mode/hyprpaper_single.sh | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 chores/mode/hyprpaper_single.sh diff --git a/chores/mode/hyprpaper_single.sh b/chores/mode/hyprpaper_single.sh new file mode 100644 index 0000000..21cb5b9 --- /dev/null +++ b/chores/mode/hyprpaper_single.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +# reve desktop environment framework +# Yigid BALABAN 2024 + +# chore script +# type mode +# name hyprpaper_single.sh +# desc changes the background depending on the desktop_mode +# vars bg_dark, bg_light +# reload none + +if ! command -v hyprpaper &>/dev/null; then + echo "hyprpaper is not installed. Please install it and try again." + exit 1 +fi + +# shellcheck source=../../_reve.sh +source "$(reve where)/_reve" + +bg="$(util_read_config chore."bg_$RV_CURRENT_MODE")" +current_bg="$(util_where_config chore.current_bg)" + +# Only change if different from current +if [ "$bg" != "$(readlink -f "$current_bg")" ]; then + hyprctl hyprpaper preload "$bg" + hyprctl hyprpaper wallpaper ",${bg}" + hyprctl hyprpaper unload unused + cp "$bg" "$current_bg" + + notify-send --urgency=low --expire-time=1450 --icon="$bg" \ + --app-name="reve: hyprpaper_single" \ + "Wallpaper changed" \ + "Wallpaper changed and saved on $RV_CURRENT_MODE mode." +fi