This commit is contained in:
Stephan Raabe 2024-06-13 15:06:45 +02:00
parent 95ff240509
commit daf9683dc5
13 changed files with 170 additions and 47 deletions

View File

@ -0,0 +1,7 @@
# ------------------------------------------------------
# Modify existing files before restore starts
# ------------------------------------------------------
if [ -d ~/dotfiles ] ;then
echo ":: Modify existing files"
fi

View File

View File

@ -1 +1 @@
2.9.1.2 2.9.1.3

View File

@ -1 +1 @@
2912 2913

View File

@ -1,5 +1,11 @@
Version 2.9.1.3
https://gitlab.com/stephan-raabe/dotfiles/-/releases/2.9.1.3
--------------------------------------------------------
- Wallpaper cache to cache generated images. Will speed up the change between wallpapers if cached files exists. https://gitlab.com/stephan-raabe/dotfiles/-/wikis/Home/Wallpapers#wallpaper-cache
Version 2.9.1.2 Version 2.9.1.2
https://gitlab.com/stephan-raabe/dotfiles/-/releases/2.9.1.1 https://gitlab.com/stephan-raabe/dotfiles/-/releases/2.9.1.2
-------------------------------------------------------- --------------------------------------------------------
- Workspaces module in waybar updated to enable scroll to change the workspace https://gitlab.com/stephan-raabe/dotfiles/-/merge_requests/114 - Workspaces module in waybar updated to enable scroll to change the workspace https://gitlab.com/stephan-raabe/dotfiles/-/merge_requests/114
- More functions deactivated in Game Mode (SUPER+ALT+G) - More functions deactivated in Game Mode (SUPER+ALT+G)

View File

@ -1,4 +1,4 @@
# ML4W Dotfiles 2.9.1.2 # ML4W Dotfiles 2.9.1.3 BETA
An advanced configuration of Hyprland for Arch Linux based distributions. This package includes an installation script to install and setup the required components. An advanced configuration of Hyprland for Arch Linux based distributions. This package includes an installation script to install and setup the required components.

View File

@ -9,15 +9,39 @@
# by Stephan Raabe (2024) # by Stephan Raabe (2024)
# ----------------------------------------------------- # -----------------------------------------------------
# Cache file for holding the current wallpaper # -----------------------------------------------------
# Get wallpaper folder
# -----------------------------------------------------
wallpaper_folder="$HOME/wallpaper" wallpaper_folder="$HOME/wallpaper"
if [ -f ~/dotfiles/.settings/wallpaper-folder.sh ] ;then if [ -f ~/dotfiles/.settings/wallpaper-folder.sh ] ;then
source ~/dotfiles/.settings/wallpaper-folder.sh source ~/dotfiles/.settings/wallpaper-folder.sh
fi fi
used_wallpaper="$HOME/.cache/used_wallpaper"
# -----------------------------------------------------
# Check to use wallpaper cache
# -----------------------------------------------------
use_cache=0
if [ -f $HOME/dotfiles/.settings/wallpaper_cache ] ;then
use_cache=1
fi
if [ "$use_cache" == "1" ] ;then
echo ":: Using Wallpaper Cache"
else
echo ":: Wallpaper Cache disabled"
fi
# -----------------------------------------------------
# File and folder names
# -----------------------------------------------------
force_generate=0
generated_versions="$HOME/.cache/ml4w-wallpaper-generated"
cache_file="$HOME/.cache/current_wallpaper" cache_file="$HOME/.cache/current_wallpaper"
blurred="$HOME/.cache/blurred_wallpaper.png" used_wallpaper="$HOME/.cache/used_wallpaper"
square="$HOME/.cache/square_wallpaper.png" blurred_wallpaper="$HOME/.cache/blurred_wallpaper.png"
square_wallpaper="$HOME/.cache/square_wallpaper.png"
rasi_file="$HOME/.cache/current_wallpaper.rasi" rasi_file="$HOME/.cache/current_wallpaper.rasi"
blur_file="$HOME/dotfiles/.settings/blur.sh" blur_file="$HOME/dotfiles/.settings/blur.sh"
@ -36,10 +60,38 @@ if [ ! -f $rasi_file ] ;then
echo "* { current-image: url(\"$wallpaper_folder/default.jpg\", height); }" > "$rasi_file" echo "* { current-image: url(\"$wallpaper_folder/default.jpg\", height); }" > "$rasi_file"
fi fi
current_wallpaper=$(cat "$cache_file") # Create folder with generated versions of wallpaper if not exists
if [ ! -d $generated_versions ] ;then
mkdir $generated_versions
fi
# -----------------------------------------------------
# Current wallpaper
# -----------------------------------------------------
current_wallpaper=$(cat "$cache_file")
current_wallpaper_filename=$(echo $current_wallpaper | sed "s|$wallpaper_folder/||g")
# -----------------------------------------------------
# Select Wallpaper
# -----------------------------------------------------
case $1 in case $1 in
# Remove current wallpaper cached files for regeneration
"regenerate")
sleep 1
force_generate=1
echo ":: Cached files for current wallpaper $current_wallpaper_filename will be regenerated"
notify-send "Cached files for current wallpaper $current_wallpaper_filename will be regenerated"
;;
# Empty the cache folder completely
"clearcache")
sleep 1
rm $generated_versions/*
echo ":: Wallpaper cache cleared"
notify-send "Wallpaper cache cleared"
;;
# Load wallpaper from .cache of last session # Load wallpaper from .cache of last session
"init") "init")
sleep 1 sleep 1
@ -55,7 +107,11 @@ case $1 in
sleep 0.2 sleep 0.2
selected=$( find "$wallpaper_folder" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) -exec basename {} \; | sort -R | while read rfile selected=$( find "$wallpaper_folder" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) -exec basename {} \; | sort -R | while read rfile
do do
echo -en "$rfile\x00icon\x1f$wallpaper_folder/${rfile}\n" if [ -f $generated_versions/square-${rfile}.png ] ;then
echo -en "$rfile\x00icon\x1f$generated_versions/square-${rfile}.png\n"
else
echo -en "$rfile\x00icon\x1f$wallpaper_folder/${rfile}\n"
fi
done | rofi -dmenu -i -replace -config ~/dotfiles/rofi/config-wallpaper.rasi) done | rofi -dmenu -i -replace -config ~/dotfiles/rofi/config-wallpaper.rasi)
if [ ! "$selected" ]; then if [ ! "$selected" ]; then
echo "No wallpaper selected" echo "No wallpaper selected"
@ -72,43 +128,72 @@ case $1 in
esac esac
# ----------------------------------------------------- # -----------------------------------------------------
# Load current pywal color scheme # Execute pywal
# ----------------------------------------------------- # -----------------------------------------------------
source "$HOME/.cache/wal/colors.sh" source "$HOME/.cache/wal/colors.sh"
# ----------------------------------------------------- # -----------------------------------------------------
# get wallpaper image name # Selected Wallpaper
# ----------------------------------------------------- # -----------------------------------------------------
echo ":: Setting up wallpaper with $wallpaper"
# -----------------------------------------------------
# Get selected wallpaper image name
# -----------------------------------------------------
newwall=$(echo $wallpaper | sed "s|$wallpaper_folder/||g") newwall=$(echo $wallpaper | sed "s|$wallpaper_folder/||g")
# -----------------------------------------------------
# Copy selected wallpaper to .cache
# -----------------------------------------------------
echo ":: Copy $wallpaper to .cache"
cp $wallpaper $HOME/.cache/
mv $HOME/.cache/$newwall $used_wallpaper
# ----------------------------------------------------- # -----------------------------------------------------
# Reload waybar with new colors # Reload waybar with new colors
# ----------------------------------------------------- # -----------------------------------------------------
~/dotfiles/waybar/launch.sh ~/dotfiles/waybar/launch.sh
# ----------------------------------------------------- # -----------------------------------------------------
# Set the new wallpaper # swww transition type
# ----------------------------------------------------- # -----------------------------------------------------
transition_type="wipe" transition_type="wipe"
# transition_type="outer" # transition_type="outer"
# transition_type="random" # transition_type="random"
cp $wallpaper $HOME/.cache/ # -----------------------------------------------------
mv $HOME/.cache/$newwall $used_wallpaper # Wallpaper Effects
# -----------------------------------------------------
# Load Wallpaper Effect
if [ -f $HOME/dotfiles/.settings/wallpaper-effect.sh ] ;then if [ -f $HOME/dotfiles/.settings/wallpaper-effect.sh ] ;then
effect=$(cat $HOME/dotfiles/.settings/wallpaper-effect.sh) effect=$(cat $HOME/dotfiles/.settings/wallpaper-effect.sh)
if [ ! "$effect" == "off" ] ;then if [ ! "$effect" == "off" ] ;then
if [ "$1" == "init" ] ;then if [ -f $generated_versions/$effect-$newwall ] && [ "$force_generate" == "0" ] && [ "$use_cache" == "1" ] ;then
echo ":: Init" echo ":: Use cached wallpaper $effect_$newwall"
else else
dunstify "Using wallpaper effect $effect..." "with image $newwall" -h int:value:10 -h string:x-dunst-stack-tag:wallpaper echo ":: Generate new cached wallpaper $effect-$newwall with effect $effect"
if [ "$1" == "init" ] ;then
echo ":: Init"
else
dunstify "Using wallpaper effect $effect..." "with image $newwall" -h int:value:10 -h string:x-dunst-stack-tag:wallpaper
fi
source $HOME/dotfiles/hypr/effects/wallpaper/$effect
cp $used_wallpaper $generated_versions/$effect-$newwall
fi fi
source $HOME/dotfiles/hypr/effects/wallpaper/$effect cp $generated_versions/$effect-$newwall $used_wallpaper
else
echo ":: Wallpaper effect is set to off"
fi fi
fi fi
# -----------------------------------------------------
# Set new wallpaper with defined wallpaper engine
# -----------------------------------------------------
wallpaper_engine=$(cat $HOME/dotfiles/.settings/wallpaper-engine.sh) wallpaper_engine=$(cat $HOME/dotfiles/.settings/wallpaper-engine.sh)
if [ "$wallpaper_engine" == "swww" ] ;then if [ "$wallpaper_engine" == "swww" ] ;then
# swww # swww
@ -126,11 +211,12 @@ elif [ "$wallpaper_engine" == "hyprpaper" ] ;then
wal_tpl=$(cat $HOME/dotfiles/.settings/hyprpaper.tpl) wal_tpl=$(cat $HOME/dotfiles/.settings/hyprpaper.tpl)
output=${wal_tpl//WALLPAPER/$used_wallpaper} output=${wal_tpl//WALLPAPER/$used_wallpaper}
echo "$output" > $HOME/dotfiles/hypr/hyprpaper.conf echo "$output" > $HOME/dotfiles/hypr/hyprpaper.conf
hyprpaper & hyprpaper & > /dev/null 2>&1
else else
echo ":: Wallpaper Engine disabled" echo ":: Wallpaper Engine disabled"
fi fi
# Notify that the wallpaper will changed
if [ "$1" == "init" ] ;then if [ "$1" == "init" ] ;then
echo ":: Init" echo ":: Init"
else else
@ -146,38 +232,54 @@ fi
# ----------------------------------------------------- # -----------------------------------------------------
# Created blurred wallpaper # Created blurred wallpaper
# ----------------------------------------------------- # -----------------------------------------------------
if [ "$1" == "init" ] ;then
echo ":: Init"
else
dunstify "Creating blurred version ..." "with image $newwall" -h int:value:50 -h string:x-dunst-stack-tag:wallpaper
fi
magick $used_wallpaper -resize 75% $blurred if [ -f $generated_versions/blur-$blur-$newwall.png ] && [ "$force_generate" == "0" ] && [ "$use_cache" == "1" ] ;then
echo ":: Resized to 75%" echo ":: Use cached wallpaper blur-$blur-$newwall.png"
if [ ! "$blur" == "0x0" ] ;then else
magick $blurred -blur $blur $blurred echo ":: Generate new cached wallpaper blur-$blur-$newwall with blur $blur"
echo ":: Blurred" if [ "$1" == "init" ] ;then
echo ":: Init"
else
dunstify "Creating blurred version ..." "with image $newwall" -h int:value:50 -h string:x-dunst-stack-tag:wallpaper
fi
magick $used_wallpaper -resize 75% $blurred_wallpaper
echo ":: Resized to 75%"
if [ ! "$blur" == "0x0" ] ;then
magick $blurred_wallpaper -blur $blur $blurred_wallpaper
cp $blurred_wallpaper $generated_versions/blur-$blur-$newwall.png
echo ":: Blurred"
fi
cp $generated_versions/blur-$blur-$newwall.png $blurred_wallpaper
fi fi
cp $generated_versions/blur-$blur-$newwall.png $blurred_wallpaper
# ----------------------------------------------------- # -----------------------------------------------------
# Created quare wallpaper # Created square wallpaper
# ----------------------------------------------------- # -----------------------------------------------------
if [ "$1" == "init" ] ;then
echo ":: Init" if [ -f $generated_versions/square-$newwall.png ] && [ "$force_generate" == "0" ] && [ "$use_cache" == "1" ] ;then
echo ":: Use cached wallpaper square-$newwall.png"
else else
dunstify "Creating square version ..." "with image $newwall" -h int:value:75 -h string:x-dunst-stack-tag:wallpaper echo ":: Generate new cached wallpaper square-$newwall"
if [ "$1" == "init" ] ;then
echo ":: Init"
else
dunstify "Creating square version ..." "with image $newwall" -h int:value:75 -h string:x-dunst-stack-tag:wallpaper
fi
magick $wallpaper -gravity Center -extent 1:1 $square_wallpaper
cp $square_wallpaper $generated_versions/square-$newwall.png
fi fi
magick $wallpaper -gravity Center -extent 1:1 $square cp $generated_versions/square-$newwall.png $square_wallpaper
echo ":: Square version created"
# ----------------------------------------------------- # -----------------------------------------------------
# Write selected wallpaper into .cache files # Write selected wallpaper into .cache files
# ----------------------------------------------------- # -----------------------------------------------------
echo "$wallpaper" > "$cache_file" echo "$wallpaper" > "$cache_file"
echo "* { current-image: url(\"$blurred\", height); }" > "$rasi_file" echo "* { current-image: url(\"$blurred_wallpaper\", height); }" > "$rasi_file"
# ----------------------------------------------------- # -----------------------------------------------------
# Send notification # Send complete notification
# ----------------------------------------------------- # -----------------------------------------------------
if [ "$1" == "init" ] ;then if [ "$1" == "init" ] ;then
@ -186,4 +288,4 @@ else
dunstify "Wallpaper procedure complete!" "with image $newwall" -h int:value:100 -h string:x-dunst-stack-tag:wallpaper dunstify "Wallpaper procedure complete!" "with image $newwall" -h int:value:100 -h string:x-dunst-stack-tag:wallpaper
fi fi
echo "DONE!" echo "DONE!"

View File

@ -34,7 +34,7 @@ else
fi fi
echo "" echo ""
source .install/required.sh source .install/required.sh
source .install/confirm-start.sh source .install/confirm_start.sh
source .install/paralleldownloads.sh source .install/paralleldownloads.sh
source .install/yay.sh source .install/yay.sh
source .install/updatesystem.sh source .install/updatesystem.sh
@ -44,37 +44,45 @@ source .install/installer.sh
source .install/remove.sh source .install/remove.sh
source .install/general.sh source .install/general.sh
source .install/packages/general-packages.sh source .install/packages/general-packages.sh
source .install/install-packages.sh source .install/install_packages.sh
source .install/profile.sh source .install/profile.sh
if [[ $profile == *"Hyprland"* ]]; then if [[ $profile == *"Hyprland"* ]]; then
echo -e "${GREEN}" echo -e "${GREEN}"
figlet "Hyprland" figlet "Hyprland"
echo -e "${NONE}" echo -e "${NONE}"
source .install/packages/hyprland-packages.sh source .install/packages/hyprland-packages.sh
source .install/install-packages.sh source .install/install_packages.sh
fi fi
if [[ $profile == *"Qtile"* ]]; then if [[ $profile == *"Qtile"* ]]; then
echo -e "${GREEN}" echo -e "${GREEN}"
figlet "Qtile" figlet "Qtile"
echo -e "${NONE}" echo -e "${NONE}"
source .install/packages/qtile-packages.sh source .install/packages/qtile-packages.sh
source .install/install-packages.sh source .install/install_packages.sh
fi fi
source .install/wallpaper.sh source .install/wallpaper.sh
source .install/displaymanager.sh source .install/displaymanager.sh
source .install/issue.sh source .install/issue.sh
# Modify existing files before restore starts
source .install/before_restore.sh
# Restore configuration and settings
source .install/restore.sh source .install/restore.sh
# Setup the input devices
source .install/keyboard.sh source .install/keyboard.sh
source .install/neovim.sh source .install/neovim.sh
source .install/hook.sh source .install/hook.sh
source .install/vm.sh source .install/vm.sh
source .install/copy.sh source .install/copy.sh
source .install/init-pywal.sh source .install/init-pywal.sh
if [[ $profile == *"Hyprland"* ]]; then if [[ $profile == *"Hyprland"* ]]; then
source .install/hyprland-dotfiles.sh source .install/hyprland_dotfiles.sh
fi fi
if [[ $profile == *"Qtile"* ]]; then if [[ $profile == *"Qtile"* ]]; then
source .install/qtile-dotfiles.sh source .install/qtile_dotfiles.sh
fi fi
source .install/settings.sh source .install/settings.sh
source .install/apps.sh source .install/apps.sh

View File

@ -38,7 +38,7 @@ else
fi fi
IFS=';' read -ra arrThemes <<< "$themestyle" IFS=';' read -ra arrThemes <<< "$themestyle"
echo "Theme: ${arrThemes[0]}" echo ":: Theme: ${arrThemes[0]}"
if [ ! -f ~/dotfiles/waybar/themes${arrThemes[1]}/style.css ]; then if [ ! -f ~/dotfiles/waybar/themes${arrThemes[1]}/style.css ]; then
themestyle="/ml4w;/ml4w/light" themestyle="/ml4w;/ml4w/light"