nirish

config files for niri window manager
Log | Files | Refs | README | LICENSE

commit 484dcc01c26d2567048d5d279dfce25399d7a6be
parent 457a1eb0b6d1e835d04388b6ecea718817df1f62
Author: ryukamish <[email protected]>
Date:   Sun, 19 Apr 2026 19:26:28 +0530

add: path fix for niriwall and idling toggle for swayidle

Diffstat:
Ascripts/niriwall | 32++++++++++++++++++++++++++++++++
Mscripts/rofi-menu | 2+-
Ascripts/toggle-idle | 12++++++++++++
3 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/scripts/niriwall b/scripts/niriwall @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +WALLDIR="$HOME/Pictures/Wallpapers" +CACHE="$HOME/.cache/rofi-wallpaper" +mkdir -p "$CACHE" + +# Generate thumbnails (only missing ones) +find "$WALLDIR" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" -o -iname "*.webp" \) | while read -r img; do + name="$(basename "$img")" + thumb="$CACHE/$name.png" + [ ! -f "$thumb" ] && magick "$img" -resize 500x500^ -gravity center -extent 500x500 "$thumb" +done + +# This is the key: use -show-icons and tell rofi where the icons are +chosen=$(find "$WALLDIR" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" -o -iname "*.webp" \) | sort | + while read -r img; do + name="$(basename "$img")" + echo -e "$name\0icon\x1f$CACHE/$name.png" + done | + rofi -dmenu \ + -p "Wallpaper" \ + -i \ + -show-icons \ + -theme-str 'window { width: 90%; height: 80%; }' \ + -theme-str 'listview { columns: 5; lines: 3; spacing: 20px; }' \ + -theme-str 'element-icon { size: 200px; horizontal-align: 0.5; }' \ + -theme-str 'element-text { enabled: false; }') + +[ -z "$chosen" ] && exit + +fullpath="$WALLDIR/$chosen" +awww img "$fullpath" --transition-type wipe --transition-fps 60 --transition-angle 45 --transition-step 30 diff --git a/scripts/rofi-menu b/scripts/rofi-menu @@ -38,7 +38,7 @@ case "$menu_args" in theme_args=$(printf '%b' '󰸉 Change Wallpaper\n Colorscheme' | rofi -dmenu -p '' -i) case "$theme_args" in *Change\ Wallpaper) - ~/.local/bin/hyprwall + ~/.local/bin/niriwall ;; *Colorscheme) theme_args=$(printf '%b' 'Black Lotus\nCatppuccin Mocha\nDracula\nGruvbox Dark\nKanagawa\nRose Pine\nTokyonight' | rofi -dmenu -p 'Colorscheme: ' -i) diff --git a/scripts/toggle-idle b/scripts/toggle-idle @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +chk_idle=$(pgrep swayidle) +if [ -n "$chk_idle" ]; then + pkill swayidle && notify-send "SWAYIDLE" "Idling stopped" +else + setsid -f swayidle -w \ + timeout 600 'swaylock -f' \ + timeout 630 'niri msg action power-off-monitors' \ + resume 'niri msg action power-on-monitors' \ + before-sleep 'swaylock -f' && \ + notify-send "SWAYIDLE" "Idling started" +fi