User Tools

Site Tools


howto:tempdisabledevicedetection

Disabling Device Detection Dialog

Whenever you attach a removable storage device - an SD card or USB device - a dialog will appear asking you whether you wish to open the device with an application. This dialog will also appear after logging on if a device is connected at the time. The following sections explain how to disable it every time you connect a device or just after start up, re-enabling it after a short time period. Note that this technique will not work on the eeePC 900.

Disabling it always

To disable the Device Detection Dialog from appearing whenever you connect a removable storage device, enter the following command in a console (press Ctrl+Alt+T in Easy Mode):

sudo chmod a-x /usr/bin/xandros_device_detection_dialog

To reverse, enter:

sudo chmod a+x /usr/bin/xandros_device_detection_dialog

How this works: The chmod command -x stops the xandros_device_detection_dialog file from being an executable and +x makes it executable again.

Disabling at startup only

To disable the dialog after logging in only, re-enabling after a set time period, following the instructions below. They will require the use of a command console. For Easy Mode users, press Ctrl+Alt+T to open one.

  1. Rename the Device Detection Dialog using the 'mv' command:
    sudo mv /usr/bin/xandros_device_detection_dialog /usr/bin/xandros_device_detection_dialog.copy
  2. Create a new file in place of the old one:
    sudo kwrite /usr/bin/xandros_device_detection_dialog
  3. Copy and paste the following into the file:
    #!/bin/sh
    awk '$1 < 40 { exit 1 }' /proc/uptime && xandros_device_detection_dialog.copy "$@" &
  4. This is equivalent but avoiding a new awk process:
    #!/bin/bash
    IFS=. read U1 E1 < /proc/uptime
    [ $U1 -gt 40 ] && xandros_device_detection_dialog.copy "$@" &
  5. Set execute permissions on the file:
    sudo chmod a+x /usr/bin/xandros_device_detection_dialog

Note: You can change the number 40 in the script to vary the amount of time following logging in that the dialog is disabled. Increase it if the dialog is appearing after you log in.

Note: On the eeepc 1000 the detecting mechanism has changed from ”/usr/bin/xandros_device_detection_dialog” to ”/usr/bin/usbstorageapplet”. You can still use the same trick as above, replacing all occurrences of xandros_device_detection_dialog to usbstorageapplet.

None of these methods seems to work if usbstorageapplet version 1.0.53-1 or later is installed. Make sure you have version 1.0.33-1 installed. It is also recommended that you lock the package so that it is never automatically updated

Source

howto/tempdisabledevicedetection.txt · Last modified: 2012/01/27 19:14 by hello