-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwelcome
More file actions
executable file
·29 lines (21 loc) · 874 Bytes
/
Copy pathwelcome
File metadata and controls
executable file
·29 lines (21 loc) · 874 Bytes
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
#! /bin/sh
# Custom greetings depending on time
sleep 3
morning_begin="050000"
morning_end="115959"
afternoon_begin="120000"
afternoon_end="165959"
evening_begin="170000"
evening_end="045959"
now=$(date +"%H%M%S")
# if you want to use a given time instead of the current time, use
# $(date --date=$some_time +%s)
if [[ $now -ge $morning_begin && $now -le $morning_end ]]; then
notify-send -u normal "Good morning, Fabian" "$(sh ~/scripts/weather)"
elif [[ $now -ge $afternoon_begin && $now -le $afternoon_end ]]; then
notify-send -u normal "Good afternoon, Fabian" "$(sh ~/scripts/weather)"
elif [[ $now -ge $evening_begin && $now -le "240000" ]]; then
notify-send -u normal "Good evening, Fabian" "$(sh ~/scripts/weather)"
elif [[ $now -ge "000001" && $now -le $evening_end ]]; then
notify-send -u normal "Good evening, Fabian" "$(sh ~/scripts/weather)"
fi