Giter Club home page Giter Club logo

Comments (18)

wychwitch avatar wychwitch commented on May 16, 2024 3

Interesting, I was using it in zsh, but for whatever reason the \r\n still didn't work. However setting it as a variable works perfectly!

image

from arttime.

wychwitch avatar wychwitch commented on May 16, 2024 3

@wychwitch Please do git pull, install and run arttime again. You can even run arttime without installing, just cd to the top of its clone and run $ ./bin/arttime The commit e18f262 should enable support for WSL. Give a few different goals a try: 5s, 5s;loop4 and post a screenshot :)

@stuartleeks Yes, I don't have a machine that can run WSL or this feature would have been tested in past... It would be great if you could also give it a try. Also, do options like -u critical make any sense for Windows? For rest of the platforms arttime intends to emulate the behavior of -u critical (notification must not disappear from screen after a timeout). Thanks for your notification softwares :)

YESS it works!! I tried this by doing cloning a new repo and running it with ./bin/arttime like you suggested!

image

It's the normal windows notification sound in case you tried to customize it, but it works great! Thank you so much!

Let me know if there's anything else you'd like for me to test ^^

from arttime.

wychwitch avatar wychwitch commented on May 16, 2024 2

huh! That doesn't work, even though it should 🤔

This is what I sent through

wsl-notify-send.exe --category "ARTTIME" "Sat May 06, 2023 12:16:55AM PDT\r\ngoal: 1m\r\nart: buttefly\r\nID: 23342"

And I get this notification

image

Maybe it can't support line breaks? Which would be really strange if so...

from arttime.

stuartleeks avatar stuartleeks commented on May 16, 2024 2

Hey - I see that you are using wsl-notify-send :-)

My motivation when creating it was to create something that can be aliased to notify-send in WSL so that any scripts that expect to call notify-send will "just work" in WSL and route notifications to the Windows desktop. (I have a blog post that I wrote about it, too).

If you're not so concerned about the argument compatibility with notify-send, you might also want to take a look at toast. I have a fork of the original project that made a few tweaks, but toast gives a bit more control over the notification than wsl-notify-send. (I have a blog post on toast, too!)

from arttime.

wychwitch avatar wychwitch commented on May 16, 2024 2

OH I know what happened with the 3/4 and the 4/4 goals difference. This actually has to do with your question about notification behavior! On windows, a notification is shown onscreen for a few seconds before automatically timing out and disappearing (only like, 5 seconds or so). If multiple notifications show up back to back, rather than OSX the notifications wont "stack", instead it will take its time to cycle through them one by one. I'm not sure if this behavior can be overwritten?

But yes, in that screenshot I'm pretty sure the difference happened because the 3/4 notification hadn't gone away when I took the screenshot, which meant the 4/4 one was queued up behind it! I didn't even notice hahahw

As for installing wsl-notify, it was pretty easy! I wasn't able to figure out how to properly get it working as a function in nushell (my shell of choice) but considering how different nushell's scripting is it's not surprising lmao

I hope that clears things up!! I'll do more testing when I get to the computer

from arttime.

wychwitch avatar wychwitch commented on May 16, 2024 1

@poetaman YEP \r works the same!! That's fantastic, it'll make adapting the script easier :)

As for the ZSH thing, it could be my zshrc maybe?

from arttime.

wychwitch avatar wychwitch commented on May 16, 2024 1

@poetaman oh im so sorry ive been swamped with the end of school

Ill totally do this tomorrow!! I cant wait to try it out ^^

from arttime.

wychwitch avatar wychwitch commented on May 16, 2024 1

@poetaman Oh I just got to the computer, and I realized after checking help that the urgency flag is completely ignored in wsl-notify!

Usage:
  wsl-notify-send [flags]

Flags:
      --appId string          [non-standard] Specifies the app ID (default "wsl-notify-send")
  -c, --category string       Specifies the notification category (default "wsl-notify-send")
  -t, --expire-time int       [Ignored in wsl-notiy-send] (default -1)
  -?, --help                  Show a help message
  -h, --hint stringArray      Ignored in wsl-notify-send
  -i, --icon string           An icon filename to display (stock icons are not currently supported)
  -u, --urgency stringArray   Ignored in wsl-notify-send
      --version               Show version information

Sure enough, they don't stay onscreen! Here's the video recorded:
ezgif-5-0f38448dda.webm

EDIT: Well that didn't embed lmao, hold on here's a gif version

ezgif-5-30897215c1

from arttime.

wychwitch avatar wychwitch commented on May 16, 2024 1

@poetaman yep! The sound happens for each time the notification pops up! and no problem, I'm happy to help!

from arttime.

poetaman avatar poetaman commented on May 16, 2024

@wychwitch Please give \r\n a try. Check this article on genealogy of CRLF in modern Windows operating system. My guess is that should format new lines.

from arttime.

poetaman avatar poetaman commented on May 16, 2024

@wychwitch One last try... I think I know what is going on. Perhaps you are running that command from bash. Bash does not substitute \r/\n with actual codes for CR/LF by default, zsh does. Try these options:

  1. Launch zsh , and in it's prompt run your command as is (without any modifications).
  2. Don't launch zsh, instead run this modified command from bash:
CRLF=$'\r\n'; wsl-notify-send.exe --category "ARTTIME" "Sat May 06, 2023 12:16:55AM PDT${CRLF}goal: 1m${CRLF}art: buttefly${CRLF}ID: 23342"

from arttime.

poetaman avatar poetaman commented on May 16, 2024

@wychwitch Awesome! Will figure the zsh mystery... Like why it works for some commands and not for others. For instance echo on zsh will translate \r and \n by default (bash echo doesn't). But looks like that is not true for other commands (while variable substitution works for all commands)... Can we try this without \n? For some reason, on Ubuntu's Gnome translates \n to space, but works perfect with just \r. I would prefer to keep it simple if \r just works for all platforms.

CRLF=$'\r'; wsl-notify-send.exe --category "ARTTIME" "Sat May 06, 2023 12:16:55AM PDT${CRLF}goal: 1m${CRLF}art: buttefly${CRLF}ID: 23342"

from arttime.

poetaman avatar poetaman commented on May 16, 2024

@wychwitch

As for the ZSH thing, it could be my zshrc maybe?

Most likely it is just a few special print builtins like echo that take character sequences \ followed by n, etc and substitute them with correct codes for moving the cursor. And the shell just passes the string with these character sequences untouched to all builtins and commands. But shell always seems to expand any variable $varname or command $(commandname ...). Check the help page for zsh's builtin echo (which is different from bash's echo or some binary command /bin/echo) below.

Screenshot 2023-05-07 at 1 42 59 PM

from arttime.

poetaman avatar poetaman commented on May 16, 2024

@wychwitch Please do git pull, install and run arttime again. You can even run arttime without installing, just cd to the top of its clone and run $ ./bin/arttime The commit e18f262 should enable support for WSL. Give a few different goals a try: 5s, 5s;loop4 and post a screenshot :)

@stuartleeks Yes, I don't have a machine that can run WSL or this feature would have been tested in past... It would be great if you could also give it a try. Also, do options like -u critical make any sense for Windows? For rest of the platforms arttime intends to emulate the behavior of -u critical (notification must not disappear from screen after a timeout). Thanks for your notification softwares :)

from arttime.

poetaman avatar poetaman commented on May 16, 2024

@wychwitch: Awesome! A couple of questions:

  1. On other platforms all arttime notifications are sticky, i.e. they don't time out. How is it here?
  2. Your screenshot shows notification for sprint 3/4 while arttime has already passed 4th sprint. Why is that?
  3. How was your experience installing wsl-notify-send? Did you have to change any setting on Windows to get it working?
  4. Unlike notify-send on Linux, seems like desktop notifications on Windows platform have a default sound. I did not have to do anything special for sounds. We will stick with default sound as playing sounds from Linux side is going to add extra dependencies. In future, maybe we can collaborate on playing sounds from Linux side.

More testing is always welcome. If you feel like, please play with arttime's features and post your testing experience on https://github.com/poetaman/arttime/discussions. The screencast below shows how notifications show up on macOS. On Linux, the way multiple notifications are handled depends on DE (Desktop Environment). Some Linux DEs show only 1 notification at a time on the screen, and the next is shown in the same place once you click on the currently show notification (oldest unclicked). On other DEs, each new notification is shown on an empty space on screen. That happens till all space is filled with notifications, and notifications start stacking. Just curious what happened to the other 3 notifications for this test you ran?

5ssprint4.mp4

from arttime.

poetaman avatar poetaman commented on May 16, 2024

@wychwitch Yes yes! That does clear things a lot. When you get to your computer, please try wsl-notify-send.exe with an additional option -u critical. On Linux's notify-send, it is supposed to make the notification stick and not timeout. Try a few such commands back to back, and see if all notifications still stack in order, and not time out. Also try --urgency critical if short option -u doesn't work. Also, I am not sure if a = sign is needed for long option names...

wsl-notify-send.exe' -u critical --category "ARTTIME" "Notification-1"
wsl-notify-send.exe' -u critical --category "ARTTIME" "Notification-2"
wsl-notify-send.exe' -u critical --category "ARTTIME" "Notification-3"
wsl-notify-send.exe' -u critical --category "ARTTIME" "Notification-4"
wsl-notify-send.exe' -u critical --category "ARTTIME" "Notification-5"

from arttime.

poetaman avatar poetaman commented on May 16, 2024

@stuartleeks Is it possible to get the effect of -u critical on Windows? On Linux Desktop Environments, the effect of -u critical is to make the notification stick till the user has clicked on each to acknowledge having seen them. The same effect exists for macOS if user does a one time setting change for notifications triggered by applescripts (reference to technique: #11).

@wychwitch Thanks! At least they are ordered, which is good enough for now. Did you hear the sound accompanying notification 5 times (synchronized with it)? That would be my guess...

from arttime.

poetaman avatar poetaman commented on May 16, 2024

This can be closed as desktop notifications work on Windows under WSL since release 2.1.0. For persistence/timeout of notifications, I have filed a feature request on wsl-notify-send here: stuartleeks/wsl-notify-send#8.

from arttime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.