This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # How to use | |
| # 1. Download the script with one of two ways: | |
| # 1.1 WGET: wget https://gist.githubusercontent.com/igor725/5cff93614c8286e7d7ff348a70dace91/raw/rpcsx.run | |
| # 1.2 CURL: curl https://gist.githubusercontent.com/igor725/5cff93614c8286e7d7ff348a70dace91/raw/rpcsx.run -o rpcsx.run | |
| # 2. Run `chmod +x ./rpcsx.run` | |
| # 3. And then `./rpcsx.run -h` | |
| set -o pipefail; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xinput = require('xinput').on() | |
| xinput.iterStates(function(state) | |
| print('Device ', state:getIndex(), 'is a', state:getType()) | |
| print('\tBattery info:', state:getBatteryInfo()) | |
| local caps = state:fetchCaps() | |
| if caps then | |
| print('\tCapabilities:') | |
| for cap_name, cap_present in pairs(caps)do | |
| io.write('\t\t', cap_name, ': ', (cap_present and'yes')or'no', '\r\n') | |
| end |