mirror of
https://github.com/jarun/nnn.git
synced 2024-12-01 02:49:44 +00:00
fb6ca79197
- rename `wall` to `wallpaper` - remove `upgrade` - packaging is on OBS now - remove `treeview` - needs minor preview-tui tweak - remove `picker` - `nnn -p -` does the same
27 lines
770 B
Bash
Executable file
27 lines
770 B
Bash
Executable file
#!/usr/bin/env sh
|
|
|
|
# Description: Set the selected image as wallpaper using nitrogen or pywal.
|
|
#
|
|
# Usage: Hover on an image and run the script to set it as wallpaper.
|
|
#
|
|
# Shell: POSIX compliant
|
|
# Author: juacq97
|
|
|
|
if [ -n "$1" ]; then
|
|
if [ "$(file --mime-type "$1" | awk '{print $NF}' | awk -F '/' '{print $1}')" = "image" ]; then
|
|
if type nitrogen >/dev/null 2>&1; then
|
|
nitrogen --set-zoom-fill --save "$1"
|
|
elif type wal >/dev/null 2>&1; then
|
|
wal -i "$1"
|
|
else
|
|
printf "nitrogen ir pywal missing"
|
|
read -r _
|
|
fi
|
|
|
|
# If you want a system notification, uncomment the next 3 lines.
|
|
# notify-send -a "nnn" "Wallpaper changed!"
|
|
# else
|
|
# notify-send -a "nnn" "No image selected"
|
|
fi
|
|
fi
|