title: Get only device name from xinput -list
body: <p>I've written a small program that toggles whether a device is enabled, mostly to run from a hotkey to enable/disable the touchpad since my hands always hit it while typing.
  I have it using <code>notify-send</code> to create a dialog box, however all I can currently do is say</p>
  
  <pre><code>device $1 has been enabled
  </code></pre>
  
  <p>The output of xinput list looks like :</p>
  
  <pre><code>⎡ Virtual core pointer                      id=2    [master pointer  (3)]
  ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
  ⎜   ↳ Atmel Atmel maXTouch Digitizer            id=10   [slave  pointer  (2)]
  ⎜   ↳ ETPS/2 Elantech Touchpad                  id=14   [slave  pointer  (2)]
  ⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
      ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
      ↳ Power Button                              id=6    [slave  keyboard (3)]
      ↳ Video Bus                                 id=7    [slave  keyboard (3)]
      ↳ Power Button                              id=8    [slave  keyboard (3)]
       ↳ Sleep Button                             id=9    [slave  keyboard (3)]
      ↳ USB2.0 HD UVC WebCam                      id=11   [slave  keyboard (3)]
      ↳ Asus WMI hotkeys                          id=12   [slave  keyboard (3)]
      ↳ AT Translated Set 2 keyboard              id=13   [slave  keyboard (3)]
  </code></pre>
  
  <p>Is there any easy way to reliably get <code>ETPS/2 Elantech Touchpad</code> or <code>USB2.0 HD UVC WebCam</code>? A regex won't correctly match unless I look for the ↳ character, something in between, then multiple spaces, but is that a valid character for a regex?</p>
  
  <p>Edit : The script is simple so I've included it, it's called with a device number (would be cool if I could also <code>toggle_device touchpad</code> but that's a later problem)</p>
  
  <pre><code>#!/bin/bash 
  
  DEVICE_ENABLED=`xinput list-props $1 | grep "Enabled" | awk '{print $NF}'`
  
  if [ "$DEVICE_ENABLED" == "1" ] #disable if it's enabled 
      then
      xinput set-prop $1 "Device Enabled" 0
      notify-send "Device $1 has been disabled"
  else
      xinput set-prop $1 "Device Enabled" 1
      notify-send "Device $1 has been enabled"
  fi
  </code></pre>