Skip to content

everhaze/FLX1s-ELF-Button

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FLX1s-ELF-Button

Lets you run elfs using the assistance button on the FLX1s.

Info

This tool will let you run any elf or script you want using the assistance button on the Furilabs FLX1s. It listens for button presses.

Usage

Usage: elfbutton <PATH>
Example 1: ./elfbutton /path/to/your/elf
Example 2: ./elfbutton /path/to/your/script.sh

Press the assistance button once to launch your desired elf/script. Press it again to kill it.

If your user is not in the input group, you will probably need sudo to run this.

You can check if your user is in the input groups or not with:

groups

You can add your user to the group like this:

sudo usermod -aG input $USER

Autostart

If you want it to run on boot, create a systemd service:

Create the path and the .service first.

mkdir -p ~/.config/systemd/user
vim  ~/.config/systemd/user/elfbutton.service
# ~/.config/systemd/user/elfbutton.service
[Unit]
Description=Allows the assistance button to run any elf/script you want.

[Service]
ExecStart=%h/elfbutton %h/path/to/your/elf_or_script
Restart=no

[Install]
WantedBy=default.target

%h is the shortcut for /home/youruser.
Make sure to use your own paths.

To start the service:

systemctl --user enable --now elfbutton.service

To stop the service:

systemctl --user disable --now elfbutton.service

Cross compiling

Make sure you have aarch64-unknown-linux-musl installed. If not:

rustup target add aarch64-unknown-linux-musl   

Now compile it.

cargo build --release --target=aarch64-unknown-linux-musl

Or use zigbuild if you have issues compiling. You will need Zig installed on your system for zigbuild.

cargo install cargo-zigbuild

cargo zigbuild --release --target=aarch64-unknown-linux-musl

The elf should be inside target/aarch64-unknown-linux-musl/release/elfbutton.

Screenshots

Listening for assistance button presses

Listening

Pressed assistance button for the first time

Pressed 1

Pressed assistance button for the second time (you can press it again to summon the script/elf once again)

Pressed 2


Same example with a non looping script (file.sh)

Pressed 1

Showing that the script worked. (created shfile.txt)

Proof


If you use autostart and want to know if pressing the button is doing anything, you can use:

systemctl --user status elfbutton.service

Before you press the button, you can check its status.
In this screenshot you can see "Tasks: 1" and "Memory: 164K".

systemctl, not pressed

After you press the button, check it again.
Here you can see that it uses more tasks and memory.

systemctl, pressed

About

Lets you run elfs using the assistance button on the FLX1s.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors