update background logic
backgrounds saved for light/dark modes are now stored as the absolute path, so config keys chore.bg_dark and chore.bg_light now contain the string of absolute path to image files. in addition to this update, swww_single chore now copies the current background image to the location of chore.current_bg, which can be used to directly access the image of the current background.
This commit is contained in:
parent
02fcdf794b
commit
0602eb1bf7
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# reve desktop environment framework
|
# reve desktop environment framework
|
||||||
# Yigid BALABAN <fyb@fybx.dev> 2024
|
# Yigid BALABAN <fyb@fybx.dev> 2024
|
||||||
@ -23,7 +23,8 @@ ltypes=${#types[@]}
|
|||||||
rindex=$((RANDOM % ltypes))
|
rindex=$((RANDOM % ltypes))
|
||||||
rtype=${types[rindex]}
|
rtype=${types[rindex]}
|
||||||
|
|
||||||
bg="$(util_where_config chore."bg_$RV_CURRENT_MODE")"
|
bg="$(util_read_config chore."bg_$RV_CURRENT_MODE")"
|
||||||
swww img --transition-type "$rtype" --transition-pos 1,1 --transition-step 90 "$bg"
|
swww img --transition-type "$rtype" --transition-pos 1,1 --transition-step 90 "$bg"
|
||||||
notify-send --urgency=low --expire-time=1450 --icon="$bg" --app-name="reve: swww_single" "Wallpaper changed" "Wallpaper changed and saved on light mode."
|
notify-send --urgency=low --expire-time=1450 --icon="$bg" --app-name="reve: swww_single" "Wallpaper changed" "Wallpaper changed and saved on $RV_CURRENT_MODE mode."
|
||||||
|
cp "$bg" "$(util_where_config chore.current_bg)"
|
||||||
reload misc/asus_kbd_light.sh
|
reload misc/asus_kbd_light.sh
|
||||||
|
@ -6,13 +6,10 @@
|
|||||||
# cp utility/nemo/set_wallpaper.sh ~/.local/share/nemo/scripts
|
# cp utility/nemo/set_wallpaper.sh ~/.local/share/nemo/scripts
|
||||||
# chmod +x ~/.local/share/nemo/scripts/set_wallpaper.sh
|
# chmod +x ~/.local/share/nemo/scripts/set_wallpaper.sh
|
||||||
|
|
||||||
|
# shellcheck source=../../_reve.sh
|
||||||
source "$(reve where)/_reve"
|
source "$(reve where)/_reve"
|
||||||
reve_folder="$HOME/.config/reve"
|
|
||||||
reve_desktop_mode="$reve_folder/desktop_mode"
|
|
||||||
|
|
||||||
mode=$(util_readf "$reve_desktop_mode")
|
mode=$(util_read_config base.desktop_mode)
|
||||||
bgl="$reve_folder/chore/bg_light"
|
|
||||||
bgd="$reve_folder/chore/bg_dark"
|
|
||||||
|
|
||||||
if [ "$NEMO_SCRIPT_SELECTED_FILE_PATHS" = "" ]; then
|
if [ "$NEMO_SCRIPT_SELECTED_FILE_PATHS" = "" ]; then
|
||||||
first=$1
|
first=$1
|
||||||
@ -20,10 +17,5 @@ else
|
|||||||
first=$(echo "$NEMO_SCRIPT_SELECTED_FILE_PATHS" | head -n 1)
|
first=$(echo "$NEMO_SCRIPT_SELECTED_FILE_PATHS" | head -n 1)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$mode" = "dark" ]; then
|
util_write_config "chore.bg_$mode" "$first"
|
||||||
cp -T "$first" "$bgd"
|
reload mode/swww_single "$mode"
|
||||||
else
|
|
||||||
cp -T "$first" "$bgl"
|
|
||||||
fi
|
|
||||||
|
|
||||||
reload mode/swww_single $mode
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user