niri: automatically blur background
This commit is contained in:
@@ -67,7 +67,7 @@ elif [ "$XDG_CURRENT_DESKTOP" = "niri" ]; then
|
|||||||
notify-send "Blurred Wallpaper set" "Selected wallpaper has been successfully applied for overview"
|
notify-send "Blurred Wallpaper set" "Selected wallpaper has been successfully applied for overview"
|
||||||
) &
|
) &
|
||||||
|
|
||||||
nohup swww img "$image_copied" --transition-type fade --transition-duration 2 > /dev/null 2> /dev/null &
|
swww img "$image_copied" --transition-type fade --transition-duration 2 > /dev/null 2> /dev/null
|
||||||
|
|
||||||
notify-send "Wallpaper Changed" "$image"
|
notify-send "Wallpaper Changed" "$image"
|
||||||
else
|
else
|
||||||
|
|||||||
23
.scripts/niri-autoblur
Executable file
23
.scripts/niri-autoblur
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
normal=$(find ~/.config/wallpaper-chooser/current -type f | head -n 1)
|
||||||
|
blurred=$(find ~/.local/share/swaybg -type f | head -n 1)
|
||||||
|
|
||||||
|
[ -n "$normal" ] || exit 1
|
||||||
|
[ -n "$blurred" ] || exit 1
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
last=$target
|
||||||
|
|
||||||
|
mapfile -t focused_lines < <(niri msg focused-window 2>/dev/null)
|
||||||
|
|
||||||
|
if [ "${#focused_lines[@]}" -gt 1 ]; then
|
||||||
|
target="$blurred"
|
||||||
|
else
|
||||||
|
target="$normal"
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ "$target" = "$last" ] || swww img "$target" --transition-type fade --transition-duration 0.5 > /dev/null 2> /dev/null
|
||||||
|
|
||||||
|
sleep 0.5
|
||||||
|
done
|
||||||
@@ -123,7 +123,8 @@ spawn-at-startup "waybar"
|
|||||||
|
|
||||||
// Wallpaper
|
// Wallpaper
|
||||||
spawn-sh-at-startup "swaybg -i $(find $HOME/.local/share/swaybg -type f) -m fill"
|
spawn-sh-at-startup "swaybg -i $(find $HOME/.local/share/swaybg -type f) -m fill"
|
||||||
spawn-sh-at-startup "swww-daemon"
|
spawn-at-startup "swww-daemon"
|
||||||
|
spawn-at-startup "niri-autoblur"
|
||||||
|
|
||||||
// Not necessary maybe ...
|
// Not necessary maybe ...
|
||||||
spawn-at-startup "fcitx5"
|
spawn-at-startup "fcitx5"
|
||||||
|
|||||||
@@ -75,7 +75,8 @@
|
|||||||
"today-format": "<b>{}</b>",
|
"today-format": "<b>{}</b>",
|
||||||
"on-click": "niri msg action center-column",
|
"on-click": "niri msg action center-column",
|
||||||
"on-scroll-up": "niri msg action set-column-width +10%",
|
"on-scroll-up": "niri msg action set-column-width +10%",
|
||||||
"on-scroll-down": "niri msg action set-column-width -10%"
|
"on-scroll-down": "niri msg action set-column-width -10%",
|
||||||
|
"on-click-middle": "niri msg action close-window"
|
||||||
},
|
},
|
||||||
|
|
||||||
// System monitors
|
// System monitors
|
||||||
@@ -197,7 +198,6 @@
|
|||||||
"format": "",
|
"format": "",
|
||||||
"separate-outputs": true,
|
"separate-outputs": true,
|
||||||
"icon": true,
|
"icon": true,
|
||||||
"on-click-middle": "niri msg action close-window",
|
|
||||||
"icon-size": 14
|
"icon-size": 14
|
||||||
},
|
},
|
||||||
"custom/mediaplayer": {
|
"custom/mediaplayer": {
|
||||||
|
|||||||
Reference in New Issue
Block a user