Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Feature Request - using RGB for visual alerting #23

Open
dagbdagb opened this issue Mar 29, 2020 · 3 comments
Open

Feature Request - using RGB for visual alerting #23

dagbdagb opened this issue Mar 29, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@dagbdagb
Copy link

dagbdagb commented Mar 29, 2020

I am not a gamer. Nor am I very much into the RGB craze. Sorry. :-/
But I do like the thought of being able to use the keyboard or logo LED for alerting purposes.

Like a pulsing red 'M' when I have new email from a particular sender. Or a pulsing green 'D' for a discord notification. Not useful when I am sitting on the laptop, but handy when I watch TV and can just glance at the laptop (with sleeping display) to see if anything is happening.

How to get the alert out of the various apps/webpages/etc is not really the concern of this driver/utility. But if this is in place, a simple utility to fire the relevant commands to the razer controller is needed. I have been thinking how I would like this to work, as an 'end-user'.

Some sort of configfile with predefined ...stuff could allow for firing a CLI utility to say which pattern to fire and how many times. For example:

 dagb@home ~ $ ./bin/razeralert.py --help
 usage: razeralert.py [-h] [-d] [-l loops] pattern
 
 positional arguments:
   pattern     pattern to start

optional arguments:
  -h, --help   show this help message and exit
  -d, --debug  show debug output
  -l, --loops  number of loops, 0 (default) means forever


 dagb@home ~  $ ./bin/razeralert.py  mailalert

would read the configfile below and make the 'm' key pulse forever with a 3 second period.

[colors]
red = 0xff0000
green = 0x00ff00
blue = 0x0000ff

[steps]  # series of brightness values (0-255), timestep fixed at 20ms?
steps1 = 0,17,34,54,x,y,z.....
steps2 = sinus(3, 1, 128)   # predefined function, generate series given (period, multiplier, offset)
steps3 = triangle(period, multiplier, offset)   # predefined function, generate series given parameters

[sequence]  # combination of (color, steps) or series of (color, steps[n])
sequence1 = (red,steps1)
sequence1 = (red,steps[0]), (green,steps[1]), (blue,steps[2]), (red,steps[3]), (green,steps[4]),(blue,steps[5]),  ..
bluepulse = (blue, steps2)

[keysets]  # define keycombos for simplified pattern creation
keyset1 = 'a','b','c'
keyset2 = 'a','s','d','f'

[patterns]   # (combination of) ([key|keyset]/sequence/time offset)
pattern1 = (keyset1, sequence2), ('ctrl_l', sequence1, n)
mailalert = ('m', bluepulse)

Pretty sure the configfile can be repurposed for other things. :-)

@rnd-ash
Copy link
Owner

rnd-ash commented Mar 29, 2020

I love this idea! When i have IPC (Inter-process communication) working, I think this will be fairly easy to do.

@dagbdagb
Copy link
Author

Quite a few bits missing from above. Like:

  • when should the pattern be stopped? On any key? On a specific key? Only when a new pattern is set? User configurable?
  • what should we return to? a default set in the config file? The previous pattern? Do we need to maintain a stack of patterns, for pushing and popping?
  • should we allow for a logical AND of patterns? Should that be the default? Userconfigurable? Settable with the utility?

More ideas:

  • should we have classes of patterns? With priorities? Or priority set by the utility? Does it make sense to inherit the concept of loglevel/facility from syslog?
  • what is the best way to interface this to syslog?
  • can I have a key flashing a few times when a network interface changes state?
  • can we catch stuff from the kernel log?
  • what does it take to catch notifications in the browser (the little number on the discord tab for example) and fire a razeralert?

@dagbdagb
Copy link
Author

  • start any job with a wrapper which fires an alert when the job finishes. Green if $? is 0, some other color for other values?

@rnd-ash rnd-ash added the enhancement New feature or request label Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants