mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Changed again.
This commit is contained in:
parent
b10716bcdd
commit
7b8cfad22b
@ -1,16 +1,15 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Sets the background.
|
# Sets the background.
|
||||||
# If given an argument with -u flag, will download file from given url and set the file as background.
|
# If given an argument with -u flag, will check the file from given url whether it is an image or not. If the file is an image then it sets the file as background.
|
||||||
# Without -u flag, will set local file as backgound.
|
# Without -u flag, will set local file as backgound.
|
||||||
|
|
||||||
if [ "$1" == "-u" ]; then
|
if [ "$1" == "-u" ]; then
|
||||||
curl -o ~/.config/wall-temp.png "$2"
|
type="$(curl -sI $2 | sed -En 's/^Content-Type: (.*)\/(.*)/\1/p')"
|
||||||
type="$(file -b ~/.config/wall-temp.png --mime-type | sed s/[/].*$//)"
|
|
||||||
if [ "$type" == "image" ]; then
|
if [ "$type" == "image" ]; then
|
||||||
mv ~/.config/wall-temp.png ~/.config/wall.png
|
curl -o ~/.config/wall.png "$2"
|
||||||
xwallpaper --maximize ~/.config/wall.png
|
xwallpaper --maximize ~/.config/wall.png
|
||||||
else
|
else
|
||||||
rm ~/.config/wall-temp.png
|
echo "Not an image!"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
[ ! -z "$1" ] && cp "$1" ~/.config/wall.png && notify-send -i "$HOME/.config/wall.png" "Wallpaper changed."
|
[ ! -z "$1" ] && cp "$1" ~/.config/wall.png && notify-send -i "$HOME/.config/wall.png" "Wallpaper changed."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user