✨ hypr(env,scripts,autostart, hyprlock): add new notification system, add media to hyprlock, organize scripts, add xdg env vars, use less blur size
This commit is contained in:
@@ -1,58 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script is made by retrozinndev (João Dias), It is licensed under
|
||||
# the MIT License as in retrozinndev/Hyprland-Dots repository.
|
||||
# GitHub: https://github.com/retrozinndev
|
||||
# Dotfiles: https://github.com/retrozinndev/Hyprland-Dots
|
||||
|
||||
# The script prompts the user with anyrun or wofi to choose an image file inside
|
||||
# Prompts the user with anyrun or wofi to choose an image file inside
|
||||
# the defined $WALLPAPERS_DIR. If the user selects an entry, it automatically
|
||||
# writes changes to the hyprpaper.conf file and hot-reloads wallpaper if hyprpaper
|
||||
# is running.
|
||||
# --------------
|
||||
# Licensed under the MIT License
|
||||
# Made by retrozinndev (João Dias)
|
||||
# From https://github.com/retrozinndev/Hyprland-Dots
|
||||
|
||||
HYPRPAPER_FILE="$HOME/.config/hypr/hyprpaper.conf"
|
||||
COLORSCHEME_STYLE="darken" # lighten / darken
|
||||
|
||||
if [[ $WALLPAPERS_DIR == "" ]]; then
|
||||
WALLPAPERS_DIR="$HOME/wallpapers"
|
||||
fi
|
||||
|
||||
HYPRPAPER_FILE="$HOME/.config/hypr/hyprpaper.conf"
|
||||
|
||||
if [[ -f /bin/anyrun ]]; then
|
||||
WALLPAPER_SELECT_CMD="anyrun --plugins libstdin.so"
|
||||
elif [[ -f /bin/wofi ]]; then
|
||||
WALLPAPER_SELECT_CMD="wofi --dmenu"
|
||||
else
|
||||
notify-send -u normal "Hyprpaper script" "Couldn't find anyrun or wofi for dmenu! Try installing one of these two before selecting wallpaper!"
|
||||
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
|
||||
notify-send -u normal "Hyprpaper script" "Couldn't find any wallpaper inside \`~/wallpapers\`, try putting an image you like in there to choose it!"
|
||||
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
|
||||
|
||||
Update_wallpaper_settings() {
|
||||
echo "Writing to hyprpaper config file"
|
||||
function Write_changes() {
|
||||
echo "Writing to hyprpaper config file..."
|
||||
|
||||
echo "" > $HYPRPAPER_FILE # Cleans Hyprpaper conf
|
||||
echo \
|
||||
'$wallpaper'" = $SET_WALLPAPER_FULL
|
||||
|
||||
echo "\$wallpaper = $SET_WALLPAPER_FULL" >> $HYPRPAPER_FILE
|
||||
echo "" >> $HYPRPAPER_FILE
|
||||
echo "splash = true" >> $HYPRPAPER_FILE
|
||||
echo "preload = \$wallpaper" >> $HYPRPAPER_FILE
|
||||
echo "wallpaper = , \$wallpaper" >> $HYPRPAPER_FILE
|
||||
splash = true
|
||||
preload = "'$wallpaper'"
|
||||
wallpaper = , "'$wallpaper'"" | sed -e "s/^(\\[n])//g" > $HYPRPAPER_FILE
|
||||
}
|
||||
|
||||
Hot_reload_wallpaper() {
|
||||
echo "Hot-reloading wallpaper"
|
||||
Reload_wallpaper() {
|
||||
echo "Hot-reloading wallpaper..."
|
||||
hyprctl hyprpaper unload all
|
||||
hyprctl hyprpaper preload "$SET_WALLPAPER_FULL"
|
||||
hyprctl hyprpaper wallpaper ", $SET_WALLPAPER_FULL"
|
||||
}
|
||||
|
||||
Reload_pywal() {
|
||||
echo "Reloading pywal colorscheme"
|
||||
wal -q -t --cols16 darken -i "$SET_WALLPAPER_FULL"
|
||||
echo "Reloading pywal colorscheme..."
|
||||
wal -q -t --cols16 $COLORSCHEME_STYLE -i "$SET_WALLPAPER_FULL"
|
||||
}
|
||||
|
||||
Reload_eww() {
|
||||
@@ -64,7 +64,7 @@ Reload_eww() {
|
||||
SET_WALLPAPER_NAME="$(ls $WALLPAPERS_DIR | $WALLPAPER_SELECT_CMD)"
|
||||
SET_WALLPAPER_FULL="$WALLPAPERS_DIR/$SET_WALLPAPER_NAME"
|
||||
|
||||
echo "Wallpaper: $SET_WALLPAPER_NAME"
|
||||
echo "Selected wallpaper: $SET_WALLPAPER_NAME"
|
||||
|
||||
# Check if input wallpaper is empty
|
||||
if [[ $SET_WALLPAPER_NAME == "" ]] || [[ $SET_WALLPAPER_NAME == " " ]]
|
||||
@@ -82,9 +82,9 @@ then
|
||||
fi
|
||||
fi
|
||||
|
||||
Hot_reload_wallpaper
|
||||
Reload_pywal
|
||||
Reload_wallpaper
|
||||
Reload_eww
|
||||
Update_wallpaper_settings
|
||||
Write_changes
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user