55 lines
1.3 KiB
Plaintext
55 lines
1.3 KiB
Plaintext
|
#!/usr/bin/env bash
|
||
|
printf "%s\n" "Currently disabled"
|
||
|
|
||
|
{ [[ -z $1 ]] || [[ -z $2 ]]; } && {
|
||
|
printf "%s\n" "Usage: setwal /path/to/wallpaper mode"
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
[ ! -f "$1" ] && {
|
||
|
printf "File not found: %s\n" "$1"
|
||
|
exit 2
|
||
|
}
|
||
|
|
||
|
yes | ffmpeg -i "$1" ~/.config/hypr/wallpaper.png >/dev/null 2>&1 || {
|
||
|
printf "Failed to copy wallpaper from %s\n" "$1"
|
||
|
exit 3
|
||
|
}
|
||
|
|
||
|
{
|
||
|
hyprctl hyprpaper unload all >/dev/null
|
||
|
hyprctl hyprpaper preload ~/.config/hypr/wallpaper.png >/dev/null
|
||
|
hyprctl hyprpaper wallpaper ",~/.config/hypr/wallpaper.png" >/dev/null
|
||
|
} &
|
||
|
|
||
|
update() {
|
||
|
makoctl reload
|
||
|
}
|
||
|
|
||
|
dark() {
|
||
|
matugen image ~/.config/hypr/wallpaper.png -c ~/.config/hypr/matugen/config.toml -m dark
|
||
|
gsettings set org.gnome.desktop.interface gtk-theme "adw-gtk3-not-exist" >/dev/null
|
||
|
sleep 0.1
|
||
|
gsettings set org.gnome.desktop.interface gtk-theme "adw-gtk3-dark" >/dev/null
|
||
|
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
|
||
|
update
|
||
|
}
|
||
|
|
||
|
light() {
|
||
|
matugen image ~/.config/hypr/wallpaper.png -c ~/.config/hypr/matugen/config.toml -m light
|
||
|
gsettings set org.gnome.desktop.interface gtk-theme "adw-gtk3-not-exist" >/dev/null
|
||
|
sleep 0.1
|
||
|
gsettings set org.gnome.desktop.interface gtk-theme "adw-gtk3" >/dev/null
|
||
|
gsettings set org.gnome.desktop.interface color-scheme 'prefer-light'
|
||
|
update
|
||
|
}
|
||
|
|
||
|
case "$2" in
|
||
|
"light")
|
||
|
light
|
||
|
;;
|
||
|
*)
|
||
|
dark
|
||
|
;;
|
||
|
esac
|