File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # a small script that set the wallpaper for my computer with nitrogen
3+ # it sets the wallpaper based on the current time
4+ # it was made to be run in the background
5+
6+ refresh=120 # in seconds
7+ min_rating=5 # minimum stars
8+
9+ morning=" 6" # when starts the morning ?
10+ day=" 9" # when starts the night ?
11+ evening=" 18" # when starts the evening ?
12+ night=" 22" # when starts the night ?
13+
14+ # directory of time wallpapers
15+ morning_pics=" $HOME /.local/share/wallpapers/morning/"
16+ day_pics=" $HOME /.local/share/wallpapers/day/"
17+ evening_pics=" $HOME /.local/share/wallpapers/evening/"
18+ night_pics=" $HOME /.local/share/wallpapers/night/"
19+
20+ while [[ true ]]; do
21+ time=$( date +" %H" )
22+ if [[ $time -ge $night ]] || [[ $time -lt $morning ]]; then
23+ # night
24+ killall nitrogen
25+ nitrogen --set-zoom-fill $night_pics
26+ elif [[ $time -lt $day ]]; then
27+ # morning
28+ killall nitrogen
29+ nitrogen --set-zoom-fill $morning_pics
30+ elif [[ $time -lt $evening ]]; then
31+ # day
32+ killall nitrogen
33+ nitrogen --set-zoom-fill $day_pics &
34+ elif [[ $day -lt $night ]]; then
35+ # evening
36+ killall nitrogen
37+ nitrogen --set-zoom-fill $evening_pics &
38+ fi
39+
40+ sleep $refresh
41+ done
You can’t perform that action at this time.
0 commit comments