upstream-main 2.9.2 #6

Open
wyj wants to merge 34 commits from upstream-main into upstream-custom
7 changed files with 149 additions and 6 deletions
Showing only changes of commit 9bd6342ba8 - Show all commits

View File

@ -16,4 +16,5 @@ packagesYay=(
"nwg-look" "nwg-look"
"eww" "eww"
"hyprshade" "hyprshade"
"waypaper"
); );

View File

@ -20,15 +20,18 @@ exec-once = hypridle
# Load cliphist history # Load cliphist history
exec-once = wl-paste --watch cliphist store exec-once = wl-paste --watch cliphist store
# Initialize Wallpaper Engine
exec-once = ~/dotfiles/hypr/scripts/init-wallpaper-engine.sh
# Autostart ML4W App # Autostart ML4W App
exec-once = ~/dotfiles/hypr/scripts/ml4w-welcome-autostart.sh exec-once = ~/dotfiles/hypr/scripts/ml4w-welcome-autostart.sh
# Start ewww daemon # Start ewww daemon
exec-once = ~/dotfiles/hypr/scripts/eww.sh exec-once = ~/dotfiles/hypr/scripts/eww.sh
# Initialize waypaper
exec-once = waypaper --restore
# Launch Waybar
exec-once = ~/dotfiles/waybar/launch.sh
# Start autostart cleanup # Start autostart cleanup
exec-once = ~/dotfiles/hypr/scripts/cleanup.sh exec-once = ~/dotfiles/hypr/scripts/cleanup.sh

View File

@ -33,8 +33,8 @@ bind = $mainMod, G, togglegroup # Toggle window group
bind = $mainMod SHIFT, A, exec, ~/dotfiles/hypr/scripts/toggle-animations.sh # Toggle animations bind = $mainMod SHIFT, A, exec, ~/dotfiles/hypr/scripts/toggle-animations.sh # Toggle animations
bind = $mainMod, PRINT, exec, ~/dotfiles/hypr/scripts/screenshot.sh # Take a screenshot bind = $mainMod, PRINT, exec, ~/dotfiles/hypr/scripts/screenshot.sh # Take a screenshot
bind = $mainMod CTRL, Q, exec, wlogout # Start wlogout bind = $mainMod CTRL, Q, exec, wlogout # Start wlogout
bind = $mainMod SHIFT, W, exec, ~/dotfiles/hypr/scripts/wallpaper.sh # Change the wallpaper bind = $mainMod SHIFT, W, exec, waypaper --random # Change the wallpaper
bind = $mainMod CTRL, W, exec, ~/dotfiles/hypr/scripts/wallpaper.sh select # Open wallpaper selector bind = $mainMod CTRL, W, exec, waypaper # Open wallpaper selector
bind = $mainMod CTRL, RETURN, exec, rofi -show drun -replace -i # Open application launcher bind = $mainMod CTRL, RETURN, exec, rofi -show drun -replace -i # Open application launcher
bind = $mainMod CTRL, H, exec, ~/dotfiles/hypr/scripts/keybindings.sh # Show keybindings bind = $mainMod CTRL, H, exec, ~/dotfiles/hypr/scripts/keybindings.sh # Show keybindings
bind = $mainMod SHIFT, B, exec, ~/dotfiles/waybar/launch.sh # Reload waybar bind = $mainMod SHIFT, B, exec, ~/dotfiles/waybar/launch.sh # Reload waybar

View File

@ -7,6 +7,11 @@ windowrulev2 = float,class:(.*chat.openai.com.*)
windowrulev2 = size 500 50%,class:(.*chat.openai.com.*) windowrulev2 = size 500 50%,class:(.*chat.openai.com.*)
windowrulev2 = move 20 70,class:(.*chat.openai.com.*) windowrulev2 = move 20 70,class:(.*chat.openai.com.*)
# ML4W Welcome App floating
windowrulev2 = float,class:(.*waypaper.*)
windowrulev2 = size 800 700,class:(.*waypaper.*)
windowrulev2 = center,class:(.*waypaper.*)
# ML4W Welcome App floating # ML4W Welcome App floating
windowrulev2 = float,class:(com.ml4w.welcome) windowrulev2 = float,class:(com.ml4w.welcome)
windowrulev2 = size 700 600,class:(com.ml4w.welcome) windowrulev2 = size 700 600,class:(com.ml4w.welcome)

115
hypr/scripts/wallpaper-post.sh Executable file
View File

@ -0,0 +1,115 @@
#!/bin/bash
# _ _
# __ ____ _| | |_ __ __ _ _ __ ___ _ __
# \ \ /\ / / _` | | | '_ \ / _` | '_ \ / _ \ '__|
# \ V V / (_| | | | |_) | (_| | |_) | __/ |
# \_/\_/ \__,_|_|_| .__/ \__,_| .__/ \___|_|
# |_| |_|
#
# by Stephan Raabe (2024)
# -----------------------------------------------------
# -----------------------------------------------------
# Get selected wallpaper
# -----------------------------------------------------
echo ":: Using wallpaper $1"
wallpaper=$1
# -----------------------------------------------------
# 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"
used_wallpaper="$HOME/.cache/used_wallpaper"
blurred_wallpaper="$HOME/.cache/blurred_wallpaper.png"
square_wallpaper="$HOME/.cache/square_wallpaper.png"
rasi_file="$HOME/.cache/current_wallpaper.rasi"
blur_file="$HOME/dotfiles/.settings/blur.sh"
blur="50x30"
blur=$(cat $blur_file)
# Create rasi file if not exists
if [ ! -f $rasi_file ] ;then
touch $rasi_file
echo "* { current-image: url(\"$wallpaper_folder/default.jpg\", height); }" > "$rasi_file"
fi
# Create folder with generated versions of wallpaper if not exists
if [ ! -d $generated_versions ] ;then
mkdir $generated_versions
fi
# -----------------------------------------------------
# Current wallpaper
# -----------------------------------------------------
current_wallpaper=$wallpaper
current_wallpaper_filename=$(basename $current_wallpaper)
echo ":: Current Wallpaper: $current_wallpaper"
echo ":: Current Wallpaper Filename: $current_wallpaper_filename"
used_wallpaper=$wallpaper
newwall=$current_wallpaper_filename
# -----------------------------------------------------
# Execute pywal
# -----------------------------------------------------
echo ":: Execute wallpaper"
wal -q -i $wallpaper
source "$HOME/.cache/wal/colors.sh"
# -----------------------------------------------------
# Created blurred wallpaper
# -----------------------------------------------------
if [ -f $generated_versions/blur-$blur-$newwall.png ] && [ "$force_generate" == "0" ] && [ "$use_cache" == "1" ] ;then
echo ":: Use cached wallpaper blur-$blur-$newwall.png"
else
echo ":: Generate new cached wallpaper blur-$blur-$newwall with blur $blur"
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
cp $generated_versions/blur-$blur-$newwall.png $blurred_wallpaper
# -----------------------------------------------------
# Created square wallpaper
# -----------------------------------------------------
if [ -f $generated_versions/square-$newwall.png ] && [ "$force_generate" == "0" ] && [ "$use_cache" == "1" ] ;then
echo ":: Use cached wallpaper square-$newwall.png"
else
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
cp $generated_versions/square-$newwall.png $square_wallpaper

View File

@ -110,7 +110,7 @@
// Wallpaper // Wallpaper
"custom/wallpaper": { "custom/wallpaper": {
"format": "", "format": "",
"on-click": "~/dotfiles/hypr/scripts/wallpaper.sh select", "on-click": "waypaper",
"on-click-right": "~/dotfiles/hypr/scripts/wallpaper-effects.sh", "on-click-right": "~/dotfiles/hypr/scripts/wallpaper-effects.sh",
"tooltip-format": "Left: Select a wallpaper\nRight: Select wallpaper effect" "tooltip-format": "Left: Select a wallpaper\nRight: Select wallpaper effect"
}, },

19
waypaper/config.ini Normal file
View File

@ -0,0 +1,19 @@
[Settings]
language = en
folder = ~/wallpaper
wallpaper = ~/wallpaper/3d-tech.jpg
backend = hyprpaper
monitors = All
fill = fill
sort = name
color = #ffffff
subfolders = False
show_hidden = False
show_gifs_only = False
post_command = ~/dotfiles/hypr/scripts/wallpaper-post.sh $wallpaper
number_of_columns = 3
swww_transition_type = any
swww_transition_step = 90
swww_transition_angle = 0
swww_transition_duration = 2