mirror of
https://github.com/GRFreire/scripts.git
synced 2026-01-08 04:19:39 +00:00
add wallset script
This commit is contained in:
parent
a41f894790
commit
9cf7146e3f
1
bin/wallset
Symbolic link
1
bin/wallset
Symbolic link
@ -0,0 +1 @@
|
||||
../wallset/wallset.sh
|
||||
12
wallset/README.md
Normal file
12
wallset/README.md
Normal file
@ -0,0 +1,12 @@
|
||||
# wallset
|
||||
|
||||
## About
|
||||
Set the wallpaper and generate a lockscreen image with betterlockscreen.
|
||||
|
||||
The new wallpaper will be copied and converted to ``~/.config/wall.png``
|
||||
|
||||
## Requirements
|
||||
- [imagemagick](https://imagemagick.org/)
|
||||
- [feh](https://feh.finalrewind.org/)
|
||||
- [betterlockscreen](https://github.com/betterlockscreen/betterlockscreen)
|
||||
- [notify-send](https://gitlab.gnome.org/GNOME/libnotify) (optional)
|
||||
28
wallset/wallset.sh
Executable file
28
wallset/wallset.sh
Executable file
@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
notify() {
|
||||
if [ "$(command -v notify-send)" ]; then
|
||||
notify-send "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
IMAGE="$1"
|
||||
WALLPAPER="$HOME/.config/wall.png"
|
||||
|
||||
echo "Converting image..."
|
||||
convert "$IMAGE" "$WALLPAPER" > /dev/null
|
||||
|
||||
echo "Setting wallpaper..."
|
||||
feh --bg-scale "$WALLPAPER" > /dev/null
|
||||
|
||||
generate_lockscreen() {
|
||||
if betterlockscreen -u "$WALLPAPER" > /dev/null; then
|
||||
notify "wallset" "Lockscreen generated!"
|
||||
else
|
||||
notify --urgency critical "wallset" "Error while generating lockscreen"
|
||||
fi
|
||||
}
|
||||
echo "Generating lockscreen in the background..."
|
||||
generate_lockscreen &
|
||||
|
||||
echo "Done!"
|
||||
Loading…
Reference in New Issue
Block a user