Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blink other Leds, #1

Closed
ghost opened this issue Dec 19, 2021 · 3 comments
Closed

Blink other Leds, #1

ghost opened this issue Dec 19, 2021 · 3 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ghost
Copy link

ghost commented Dec 19, 2021

Hi,

Your tool is awesome, although I have several questions and suggestions:

  • How to blink Mute, Micmute or other LEDs, which can be triggerd using echo "7 blink" > /proc/acpi/ibm/led
  • How to make blink the "red dot" on the screen's back with your tool ? I know it implicates to use modprobe ec_sys

It will also be great if the tool can handle the `/sys/class/leds/*/trigger, which triggers any leds according to events, like disk IO, charging, network tx/rx, etc...

@Mahyar24
Copy link
Owner

Mahyar24 commented Dec 19, 2021

Hey @jJit0, Thanks for your kind feedback.

How to blink Mute, Micmute or other LEDs, which can be triggerd using echo "7 blink" > /proc/acpi/ibm/led

Well, TMorse is pretty flexible. Consider a scenario when you can on and off a LED with a "/test/led" path. for turning on the LED, you must use echo "on_command" > /test/led, and for turning off you must use echo "off_command" > /test/led.

you can do it simply with tmorse:

sudo tmorse --on-command "on_command" --off-command "off_command" -l /test/led

besides that, you can use two other valuable flags:
first -m for changing the time of each blink (default is 0.15, increase it for longer blinks)
Second --default-led-status for keeping the LED on or off after the morse code is over. for example, the power LED must remain on after the blinking (default is ON), but the keyboard's LED should be OFF in most cases.

How to make blink the "red dot" on the screen's back with your tool ? I know it implicates to use modprobe ec_sys

About the red dot, IDK! I can't find a way to control it, honestly, at least not on my T440P! And I didn't try hard! But If you find out, let me know!

It will also be great if the tool can handle the `/sys/class/leds/*/trigger ...

I don't quite understand what are you saying. You can always use -l for a LED path, but if you want to use the input text based on something else's output, use pipes (e.g. |) and --stdin flag. In this case be careful, because TMorse only supports basic English alphabets, although you can assign a custom JSON file with -c flag.
It would help if you made something like this for mapping characters to morse codes: codes.json

check out REDME.md explanations and sudo tmorse --help for additional flags. :)

@Mahyar24 Mahyar24 added good first issue Good for newcomers help wanted Extra attention is needed labels Dec 19, 2021
@ghost
Copy link
Author

ghost commented Dec 20, 2021

Hello Mahyar24,

Thanks for the answers.

  • About the first question, how to you translate this:
    echo "X status" > /proc/acpi/ibm/led
    X=number from 0 to 15
    status= on, off, blink

to this:
tmorse --on-command 2 --off-command 0 -l "/proc/acpi/ibm/led" -m 0.7 --default-led-status OFF

  • About the second question, yeah no problem, it’s difficult to handle especially that this led has a specific path and needs a specific module. Unfortunately I am no developer nor coder, but I’m glad to give you ideas and suggestions.

  • About the third question, well I wanted to know if it’s possible to use tmorse to handle events and notifications, let me clarify:

tmorse -l /proc/acpi/ibm/led -a Thunderbird -e notification -p "S.O.S"
This command will make the power led blinks with morse pattern SOS when thunderbird app send notifications
It means clearly tmorse will be daemonized and listen for specified app notifications.

OR
tmorse -l /proc/acpi/ibm/led -e network -i wlan0 -p "GO"
This command will listen for network activities and make power led blinks with morse pattern GO, it will listen for transmission and reception traffic.

I tons of ideas to improve your tool 😉

@Mahyar24
Copy link
Owner

echo "X status" > /proc/acpi/ibm/led

Simple as sudo tmorse. /proc/acpi/ibm/led is the default. look at the examples on the first page. They should work flawlessly.

let me clarify ...

Well, TMorse cannot handle something like that on its own. You should write some bash/python script to fetch the data from the source continuously, and if some condition occurs, it sends a message to TMorse. And it's not a feature that I can add. It's another subject and irrelevant to what TMorse tries to solve.

P.S: If you need that script, feel free to contact me. I do freelancing with a 10$/h rate. HireMe@Mahyar24.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant