aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaKooLit <ejhay.games@gmail.com>2024-06-03 17:23:26 +0900
committerJaKooLit <ejhay.games@gmail.com>2024-06-03 17:23:26 +0900
commitc2578231edeb0cb812bcd038d11d295132872141 (patch)
treed384084a1caadfa09220219777e190a8ef055710
parentd62b220ebc2c60c2f11e47f35616d9e803c07dd4 (diff)
Wallpaper-Effects (Super Shift W)
-rw-r--r--config/hypr/UserConfigs/ENVariables.conf1
-rw-r--r--config/hypr/UserConfigs/UserSettings.conf2
-rwxr-xr-xconfig/hypr/UserScripts/WallpaperEffects.sh96
-rw-r--r--config/hypr/configs/Keybinds.conf1
-rw-r--r--config/hypr/hyprlock.conf12
-rwxr-xr-xconfig/hypr/scripts/WallustSwww.sh4
-rw-r--r--config/hypr/wallpaper_effects/.wallpaper_currentbin0 -> 13754390 bytes
-rw-r--r--config/hypr/wallpaper_effects/.wallpaper_modifiedbin0 -> 4498624 bytes
-rw-r--r--config/rofi/config-wallpaper-effect.rasi27
9 files changed, 135 insertions, 8 deletions
diff --git a/config/hypr/UserConfigs/ENVariables.conf b/config/hypr/UserConfigs/ENVariables.conf
index c6bea01b..ea4af035 100644
--- a/config/hypr/UserConfigs/ENVariables.conf
+++ b/config/hypr/UserConfigs/ENVariables.conf
@@ -38,6 +38,7 @@ env = ELECTRON_OZONE_PLATFORM_HINT,auto
#env = NVD_BACKEND,direct
# FOR VM and POSSIBLY NVIDIA
+#env = WLR_NO_HARDWARE_CURSORS,1
#env = WLR_RENDERER_ALLOW_SOFTWARE,1
# nvidia firefox (for hardware acceleration on FF)?
diff --git a/config/hypr/UserConfigs/UserSettings.conf b/config/hypr/UserConfigs/UserSettings.conf
index be8e4845..8d137cc8 100644
--- a/config/hypr/UserConfigs/UserSettings.conf
+++ b/config/hypr/UserConfigs/UserSettings.conf
@@ -150,4 +150,4 @@ xwayland {
# cursor section for Hyprland v0.41.0 or newer
#cursor {
# enable_hyprcursor = true
-#} \ No newline at end of file
+#}
diff --git a/config/hypr/UserScripts/WallpaperEffects.sh b/config/hypr/UserScripts/WallpaperEffects.sh
new file mode 100755
index 00000000..de4470d2
--- /dev/null
+++ b/config/hypr/UserScripts/WallpaperEffects.sh
@@ -0,0 +1,96 @@
+#!/bin/bash
+# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
+# Wallpaper Effects using imagemagick
+# Inspiration from ML4W - Stephan Raabe https://gitlab.com/stephan-raabe/dotfiles
+
+# variables
+current_wallpaper="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current"
+wallpaper_output="$HOME/.config/hypr/wallpaper_effects/.wallpaper_modified"
+SCRIPTSDIR="$HOME/.config/hypr/scripts"
+focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}')
+
+# Directory for swaync
+iDIR="$HOME/.config/swaync/images"
+
+# swww transition config
+FPS=60
+TYPE="wipe"
+DURATION=2
+BEZIER=".43,1.19,1,.4"
+SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION"
+
+# Define ImageMagick effects
+# https://imagemagick.org/script/magick.php
+
+declare -A effects=(
+["Black and White"]="magick $current_wallpaper -set colorspace Gray -separate -average $wallpaper_output"
+["Blurred"]="magick $current_wallpaper -blur "20x30" $wallpaper_output"
+["Solarize"]="magick $current_wallpaper -solarize 80% $wallpaper_output"
+["Sepia-Tone"]="magick $current_wallpaper -sepia-tone 65% $wallpaper_output"
+["Negate"]="magick $current_wallpaper -negate $wallpaper_output"
+["Charcoal"]="magick $current_wallpaper -charcoal "10x90" $wallpaper_output"
+["No Effects"]="no-effects"
+)
+
+# Function to apply no effects
+no_effects() {
+ swww img -o "$focused_monitor" "$current_wallpaper" $SWWW_PARAMS &
+ # Wait for swww command to complete
+ wait $!
+ # Run other commands after swww
+ wallust run "$current_wallpaper" -s &
+ # Wait to complete
+ wait $!
+ # Refresh rofi, waybar, wallust palettes
+ "${SCRIPTSDIR}/Refresh.sh"
+ notify-send -u low -i "$iDIR/bell.png" "No wallpaper effects"
+}
+
+# Function to run rofi menu
+main() {
+ # Populate rofi menu options
+ options="No Effects\n"
+ for effect in "${!effects[@]}"; do
+ if [ "$effect" != "No Effects" ]; then
+ options+="$effect\n"
+ fi
+ done
+
+ # rofi
+ choice=$(echo -e "$options" | rofi -i -dmenu -config ~/.config/rofi/config-wallpaper-effect.rasi)
+ if [ ! -z "$choice" ]; then
+ # Check if the choice exists in the array
+ if [[ "${effects[$choice]+exists}" ]]; then
+ if [ "$choice" == "No Effects" ]; then
+ no_effects
+ else
+ # Apply selected effect
+ notify-send -i "$iDIR/bell.png" "Applying $choice effects"
+ eval "${effects[$choice]}"
+ # Wait for effects to be applied
+ sleep 1
+ # Execute swww command after image conversion
+ swww img -o "$focused_monitor" "$wallpaper_output" $SWWW_PARAMS &
+ # Wait for swww command to complete
+ wait $!
+ # Run other commands after swww
+ wallust run "$wallpaper_output" -s &
+ # Wait for other commands to finish
+ wait $!
+ # Refresh rofi, waybar, wallust palettes
+ "${SCRIPTSDIR}/Refresh.sh"
+ notify-send -u low -i "$iDIR/bell.png" "$choice effects applied"
+ fi
+ else
+ echo "Effects not recognized."
+ fi
+ fi
+}
+
+# Check if rofi is already running
+if pidof rofi > /dev/null; then
+ pkill rofi
+ exit 0
+fi
+
+main
diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf
index a270ab6f..dbec4d10 100644
--- a/config/hypr/configs/Keybinds.conf
+++ b/config/hypr/configs/Keybinds.conf
@@ -34,6 +34,7 @@ bind = $mainMod SHIFT, N, exec, swaync-client -t -sw # swayNC panel
bind = $mainMod, E, exec, $UserScripts/QuickEdit.sh # Quick Edit Hyprland Settings
bind = $mainMod SHIFT, M, exec, $UserScripts/RofiBeats.sh # online music
bind = $mainMod, W, exec, $UserScripts/WallpaperSelect.sh # Select wallpaper to apply
+bind = $mainMod SHIFT, W, exec, $UserScripts/WallpaperEffects.sh # Wallpaper Effects by imagemagickWW
bind = CTRL ALT, W, exec, $UserScripts/WallpaperRandom.sh # Random wallpapers
# Waybar / Bar related
diff --git a/config/hypr/hyprlock.conf b/config/hypr/hyprlock.conf
index c763bc90..94dc6375 100644
--- a/config/hypr/hyprlock.conf
+++ b/config/hypr/hyprlock.conf
@@ -12,13 +12,13 @@ general {
background {
monitor =
- path = screenshot # screenshot of your desktop
- # path = $HOME/.config/rofi/.current_wallpaper # NOTE only png supported for now
- color = $color7
+ #path = screenshot # screenshot of your desktop
+ path = $HOME/.config/hypr/wallpaper_effects/.wallpaper_modified # NOTE only png supported for now
+ #color = $color7
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
- blur_size = 6
- blur_passes = 2 # 0 disables blurring
+ blur_size = 5
+ blur_passes = 1 # 0 disables blurring
noise = 0.0117
contrast = 1.3000 # Vibrant!!!
brightness = 0.8000
@@ -124,7 +124,7 @@ label {
# Put a picture of choice here. Default is the current wallpaper
image {
monitor =
- path = $HOME/.config/rofi/.current_wallpaper
+ path = $HOME/.config/hypr/wallpaper_effects/.wallpaper_current
size = 230
rounding = -1
border_size = 2
diff --git a/config/hypr/scripts/WallustSwww.sh b/config/hypr/scripts/WallustSwww.sh
index 2a711028..dbf5c32f 100755
--- a/config/hypr/scripts/WallustSwww.sh
+++ b/config/hypr/scripts/WallustSwww.sh
@@ -22,10 +22,12 @@ if [ -f "$cache_file" ]; then
# Get the wallpaper path from the cache file
wallpaper_path=$(cat "$cache_file")
echo $wallpaper_path
- # Copy the wallpaper to the location Rofi can access
+ # symlink the wallpaper to the location Rofi can access
if ln -sf "$wallpaper_path" "$HOME/.config/rofi/.current_wallpaper"; then
ln_success=true # Set the flag to true upon successful execution
fi
+ # copy the wallpaper for wallpaper effects
+ cp -r "$wallpaper_path" "$HOME/.config/hypr/wallpaper_effects/.wallpaper_current"
fi
# Check the flag before executing further commands
diff --git a/config/hypr/wallpaper_effects/.wallpaper_current b/config/hypr/wallpaper_effects/.wallpaper_current
new file mode 100644
index 00000000..42dc718f
--- /dev/null
+++ b/config/hypr/wallpaper_effects/.wallpaper_current
Binary files differ
diff --git a/config/hypr/wallpaper_effects/.wallpaper_modified b/config/hypr/wallpaper_effects/.wallpaper_modified
new file mode 100644
index 00000000..6ee56617
--- /dev/null
+++ b/config/hypr/wallpaper_effects/.wallpaper_modified
Binary files differ
diff --git a/config/rofi/config-wallpaper-effect.rasi b/config/rofi/config-wallpaper-effect.rasi
new file mode 100644
index 00000000..0a91915c
--- /dev/null
+++ b/config/rofi/config-wallpaper-effect.rasi
@@ -0,0 +1,27 @@
+/* ---- 💫 https://github.com/JaKooLit 💫 ---- */
+/* Wallpaper Effects */
+
+@import "~/.config/rofi/config-compact.rasi"
+
+/* ---- Entry ---- */
+entry {
+ width: 20%;
+ placeholder: "🏙️ Choose desired wallpaper effect";
+}
+
+/* ---- Window ---- */
+window {
+ width: 24%;
+}
+
+/* ---- Listview ---- */
+listview {
+ fixed-columns: false;
+ colums: 1;
+ lines: 5;
+}
+
+/* ---- Inputbar ---- */
+inputbar {
+ background-image: url("~/.config/hypr/wallpaper_effects/.wallpaper_modified", width);
+} \ No newline at end of file
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage