-
Notifications
You must be signed in to change notification settings - Fork 1
/
wallpaper_ubt.sh
37 lines (33 loc) · 864 Bytes
/
wallpaper_ubt.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
sudo tee /usr/local/bin/autowallpaper <<-'EOF'
#!/bin/bash
Size=1000
Url=http://picsum.photos/${Size}/?random
WALLS_PATH=/etc/Wallpapers
if [ ! -d "${WALLS_PATH}" ]; then
mkdir $WALLS_PATH
fi
wget $Url -O ${WALLS_PATH}/${Size}.jpg
gsettings set org.gnome.desktop.background picture-uri "file://${WALLS_PATH}/${Size}.jpg"
EOF
sudo systemctl start autowallpaper.timer
sudo tee /etc/systemd/system/autowallpaper.service <<-'EOF'
[Unit]
Description=autowallpaper Service
[Service]
Type=simple
ExecStart=/usr/local/bin/autowallpaper
[Install]
WantedBy=multi-user.target
EOF
sudo tee /etc/systemd/system/autowallpaper.timer <<-'EOF'
[Unit]
Description=autowallpaper Timer
[Timer]
OnBootSec=5min
OnUnitActiveSec=1min
Unit=autowallpaper.service
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl start autowallpaper.timer
sudo systemctl enable autowallpaper.timer