-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.bash
More file actions
executable file
·37 lines (29 loc) · 881 Bytes
/
run.bash
File metadata and controls
executable file
·37 lines (29 loc) · 881 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
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
script_path=$(dirname $(realpath "$0"))
title="Stand up!"
subtitle="Blood needs to flow 🧍"
body="One hour has passed and still sitting? Cmon, up and exercise!"
replace_notification_id=0
icon_data="0"
actions='[]'
hints='{}'
expire_timeout=0
sound_path="$script_path/sounds/service-login.oga"
guid=1000
export XDG_RUNTIME_DIR="/run/user/$guid"
function send_notification() {
gdbus call --session \
--dest=org.freedesktop.Notifications \
--object-path=/org/freedesktop/Notifications \
--method=org.freedesktop.Notifications.Notify \
"$title" "$replace_notification_id" "$icon_data" "$subtitle" "$body" \
$actions "$hints" $expire_timeout
}
function play_sound() {
command=paplay
if [[ -x "$(command -v $command)" ]]
then
$command "$sound_path"
fi
}
send_notification & play_sound