Search code examples
gnomegsettings

Create Gnome Clocks alarm using gsettings


I am trying to create an alarm in Gnome Clocks using the terminal. I am trying to use gsettings, but no alarms are created.

  1. Create an alarm using the user interface
  2. Inspect the value using gsettings
gsettings get org.gnome.clocks alarms
[{'name': <'test for so'>, 'id': <'01da159f5b290d7b8c2e885c65088901'>, 'active': <true>, 'hour': <13>, 'minute': <41>, 'days': <@ai []>, 'snooze_minutes': <10>, 'ring_minutes': <5>}]
  1. Delete the alarm using the user interface
  2. Verify the alarm was deleted using gsettings
gsettings get org.gnome.clocks alarms
@aa{sv} []
  1. Try to create an alarm using gsettings with a new id
gsettings set org.gnome.clocks alarms "[{'name': <'test for so'>, 'id': <'4e52429bb11746d39dcbe566597c3c8a'>, 'active': <true>, 'hour': <13>, 'minute': <41>, 'days': <@ai []>, 'snooze_minutes': <10>, 'ring_minutes': <5>}]"
  1. Verify value was persisted
gsettings get org.gnome.clocks alarms
[{'name': <'test for so'>, 'id': <'4e52429bb11746d39dcbe566597c3c8a'>, 'active': <true>, 'hour': <13>, 'minute': <41>, 'days': <@ai []>, 'snooze_minutes': <10>, 'ring_minutes': <5>}]
  1. Expect alarm to exist in Gnome Clocks, but there are no alarms

Solution

  • While not a solution to my problem using gsettings I was able to simulate an alarm using notify-send with at.

    e.g. at "now + 1 hour" <<< "notify-send foo bar"