This commit is contained in:
Daniel Flanagan 2023-05-17 10:12:41 -05:00
parent 4068fdf409
commit 5a42bed8d8
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
4 changed files with 26 additions and 24 deletions

View file

@ -5,8 +5,8 @@
set message_file (mktemp)
for f in (fd good-morning.d.fish $HOME/.config/lytedev-env --max-depth 2)
# run scripts for any linked environments with a hooked script
source $f $message_file
# run scripts for any linked environments with a hooked script
source $f $message_file
end

View file

@ -1,21 +0,0 @@
#!/usr/bin/env fish
# TODO: some kind of better time-based or last-awakened heuristic to determine
# whether or not this shows
set -l hours 08 09 10
if ! contains (date +%H) $hours
echo "Not sending notification since it isn't the morning" >>&2
exit 1
end
notify-send \
--urgency critical \
"Good morning!" \
"Activate this notification (click it) to run the script. Dismiss (Super+Ctrl+Space) to ignore." \
--action=default=Activate \
| rg default
if test $status -eq 0
hyprctl dispatch exec [float] wezterm start good-morning
end

View file

@ -83,4 +83,9 @@ auto-format = false
[[grammar]]
name = "nim"
source = { git = "https://github.com/aMOPel/tree-sitter-nim", rev = "8ce3627827e45a5835004391ff5ffcfe029ae6cf" }
source = { git = "https://github.com/aMOPel/tree-sitter-nim", rev = "8ce3627827e45a5835004391ff5ffcfe029ae6cf" }
[[language]]
name = "fish"
auto-format = true
indent = { tab-width = 2, unit = "\t" }

18
os/linux/bin/maybe-good-morning Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env fish
# TODO: some kind of better time-based or last-awakened heuristic to determine
# whether or not this shows
set -l hours 08 09 10
if ! contains (date +%H) $hours
echo "Not sending notification since it isn't the morning" >>&2
exit 1
end
notify-send \
--urgency critical \
"Good morning!" \
"Activate this notification (click it or Super+Shift+Space) to run the script. Dismiss (Super+Ctrl+Space) to ignore." \
--action=default=Activate \
| rg default \
&& hyprctl dispatch exec [float] wezterm start good-morning