From 4142359498518633e0054cf5fac8023714654707 Mon Sep 17 00:00:00 2001 From: Or Bin Date: Fri, 25 Oct 2024 02:37:34 +0300 Subject: [PATCH] Update sleep reminder settings --- configuration/notify_sleep.sh | 4 ++-- tasks/configuration.yml | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/configuration/notify_sleep.sh b/configuration/notify_sleep.sh index 823c748..d11e9d4 100755 --- a/configuration/notify_sleep.sh +++ b/configuration/notify_sleep.sh @@ -7,6 +7,6 @@ if [[ "$(gnome-screensaver-command --query)" = "The screensaver is active" ]]; t exit fi -notify-send -t 300000 'Go to sleep!' 'Screen will be locked in 2 minutes' -sleep 120 +notify-send -t 30000 'Go to sleep!' 'Screen will be locked in 30 seconds' +sleep 30 gnome-screensaver-command --activate diff --git a/tasks/configuration.yml b/tasks/configuration.yml index 8578862..1fc218c 100644 --- a/tasks/configuration.yml +++ b/tasks/configuration.yml @@ -62,9 +62,17 @@ - name: Add notify_sleep.sh to cron ansible.builtin.cron: - name: notify_sleep + name: notify_sleep 12 AM minute: "*/15" - hour: "0-4" + hour: "0" + job: "{{ notify_sleep_script.dest }}" + when: computer_type == "personal" + +- name: Add notify_sleep.sh to cron + ansible.builtin.cron: + name: notify_sleep 1-4 AM + minute: "*/5" + hour: "1-4" job: "{{ notify_sleep_script.dest }}" when: computer_type == "personal"