🔧 chore: add default wallpaper + default config, remove drun apps support

fixes a lot of issues related to color generation, since now there's a default wallpaper
This commit is contained in:
retrozinndev
2025-08-23 12:21:57 -03:00
parent 48ee49d867
commit 8ed04b6fed
13 changed files with 50 additions and 79 deletions
+11 -18
View File
@@ -1,7 +1,7 @@
#!usr/bin/env bash
# Prompts the user with dmenu(or dmenu-like app, see hypr/scripts/get-dmenu.sh)
# to choose an image file inside defined $WALLPAPERS_DIR. If the user selects
# to choose an image file inside defined $WALLPAPERS. If the user selects
# an entry, it automatically writes changes to the hyprpaper.conf file and
# hot-reloads if hyprpaper is running.
# --------------
@@ -10,11 +10,7 @@
# From https://github.com/retrozinndev/colorshell
style="lighten" # lighten / darken
dmenu=$(sh "$XDG_CONFIG_HOME/hypr/scripts/get-dmenu.sh")
if [[ -z "$WALLPAPERS_DIR" ]]; then
WALLPAPERS_DIR="$HOME/wallpapers"
fi
WALLPAPERS=`[[ -z "$WALLPAPERS" ]] && echo -n "$HOME/wallpapers" || echo -n "$WALLPAPERS"`
function Write_changes() {
echo "[LOG] Writing to hyprpaper config file"
@@ -39,33 +35,30 @@ function Reload_pywal() {
wal -t --cols16 $style -i "$wall"
}
if [[ -z "$dmenu" ]]; then
notify-send -u normal -a "Wallpaper" "Dmenu not found" "Couldn't find anyrun or wofi for dmenu! Try installing one of these two before selecting wallpaper!"
exit 1
fi
if [[ -z $(ls -A $WALLPAPERS_DIR) ]]; then
if [[ -z $(ls -A -w1 $WALLPAPERS) ]]; then
notify-send -u normal -a "Wallpaper" "Wallpapers not found" "Couldn't find any wallpaper inside \`~/wallpapers\`, try putting an image you like in there to choose it!"
exit 1
fi
if [[ -z $1 ]]; then
if [[ -z $@ ]]; then
# Prompt wallpaper list
wall="$WALLPAPERS_DIR/$(ls $WALLPAPERS_DIR | $dmenu)"
selection=`ls -w1 "$WALLPAPERS" | wofi --show drun`
# Check if input wallpaper is empty
if [[ $wall == "$WALLPAPERS_DIR/" ]]; then
if [[ -z $selection ]]; then
echo "No wallpaper has been selected by user!"
if [[ $RANDOM_WALLPAPER_WHEN_EMPTY == true ]]; then
wall="$WALLPAPERS_DIR/$(ls $WALLPAPERS_DIR | shuf -n 1)"
echo "Selected random from $WALLPAPERS_DIR: $wall"
wall="$WALLPAPERS/$(ls $WALLPAPERS | shuf -n 1)"
echo "Selected random from $WALLPAPERS: $wall"
else
echo "Skipping hyprpaper changes and exiting."
exit 0
fi
else
wall="$WALLPAPERS/$selection" # wofi if no wallpaper specified
fi
else
wall=$1
wall=$@
fi
Reload_pywal
-7
View File
@@ -1,7 +0,0 @@
#!/usr/bin/env bash
selection=$(cliphist list | anyrun --plugins libstdin.so | cliphist decode)
if [[ ! -z "$selection" ]]; then
printf "%s" "$selection" | sed -e 's/\\[n]$//g' | wl-copy
fi
+2 -1
View File
@@ -1,7 +1,8 @@
#!/usr/bin/env bash
function send_notification() {
notify-send -u normal -a "color-picker" "$1" "$2"
(notify-send -u normal -a "color-picker" "$1" "$2" > /dev/null 2>&1) || \
(echo "$1: $2")
}
# Check if hyprpicker is installed
+4 -8
View File
@@ -7,15 +7,11 @@
# Made by retrozinndev (João Dias)
# From https://github.com/retrozinndev/colorshell
if ! [[ -f "$HOME/.config/hypr/hyprpaper.conf" ]]; then
notify-send -a "Wallpaper" "Couldn't load" "Wallpaper file not found! Please check for the wallpaper: $wallpaper."
if ! [[ -f "$XDG_CONFIG_HOME/hypr/hyprpaper.conf" ]]; then
echo "[error] wallpaper file not found!"
exit 1
fi
wallpaper="$(cat $HOME'/.config/hypr/hyprpaper.conf' | grep '$wallpaper =' | sed -e 's/^$wallpaper = //')"
wallpaper=`cat "$XDG_CONFIG_HOME/hypr/hyprpaper.conf" | grep '$wallpaper =' | sed -e 's/^$wallpaper = //'`
[[ -d "$XDG_CACHE_HOME/wal" ]] && wal -R || wal -q -t --cols16 darken -i "$wallpaper"
if [[ -d "$HOME/.cache/wal" ]]; then
wal -R
else
wal -q -t --cols16 darken -i "$wallpaper"
fi
-26
View File
@@ -1,26 +0,0 @@
#!/usr/bin/env bash
# Checks environment for dmenu or dmenu-like apps
# and prints out a command to pipe of.
# -----------
# Licensed under the MIT License
# Made by retrozinndev (João Dias)
# From: https://github.com/retrozinndev/colorshell
DMENUS=(
"anyrun:--plugins:libstdin.so"
"rofi:-dmenu"
"wofi:--show:dmenu"
"dmenu"
)
for dmenu in ${DMENUS[@]}; do
name=$(printf "$dmenu" | awk -F: '{ print $1 }')
cmd=$(env "$name" -h > /dev/null)
code=$?
if [[ ! $code == 127 ]]; then
echo "$dmenu" | sed 's/:/ /g'
break;
fi
done