Skip to content

Instantly share code, notes, and snippets.

@funatsufumiya
Last active October 20, 2021 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save funatsufumiya/34a9c484cc42c89fee6e55c989a2e938 to your computer and use it in GitHub Desktop.
Save funatsufumiya/34a9c484cc42c89fee6e55c989a2e938 to your computer and use it in GitHub Desktop.
#!/bin/bash
ID1=$(cat /proc/bus/input/devices | grep -m 1 -A 4 'Name="Topre' | tail -n 1 | sed -e 's/.*event\([0-9]\+\).*/\1/' | tr -d '\n')
ID2=$(cat /proc/bus/input/devices | grep -m 2 -A 4 'Name="Topre' | tail -n 1 | sed -e 's/.*event\([0-9]\+\).*/\1/' | tr -d '\n')
/usr/bin/gnome-terminal -e 'bash -c "echo \"input device ids: '$ID1', '$ID2'\"; echo \"shingeta is working (if close, stops)\"; cd /path/to/shingeta-linux-ruby; echo PASSWORD | sudo -S ruby shingeta.rb -e /dev/input/event'$ID1' -E /dev/input/event'$ID2' &> /dev/null"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment