Difference between revisions of "Udiskie"

From ArchWiki
Jump to: navigation, search
(Window Maker: Fixed the Window Maker menu scripts)
(Window Maker: Fixed the Window Maker scipt)
Line 38: Line 38:
 
#!/bin/bash
 
#!/bin/bash
  
# For a Window Maker "Devices" menu
+
# For a Window Maker menu for removable media.
 
#
 
#
 
# This script will generate sub-menus for any device mounted
 
# This script will generate sub-menus for any device mounted
# under /media. You can open the device in a file manager or
+
# under /media. You can browse the device in a file manager or
 
# unmount it.
 
# unmount it.
 
#
 
#
Line 50: Line 50:
 
cd /media
 
cd /media
  
echo \"Devices\" MENU
+
echo \"Media\" MENU
  
echo \"Open\" MENU
+
echo \"Browse\" MENU
  
 
for i in *
 
for i in *
Line 58: Line 58:
 
   if [ "$i" != "cd" ] && [ "$i" != "dvd" ] && [ "$i" != "fl" ]
 
   if [ "$i" != "cd" ] && [ "$i" != "dvd" ] && [ "$i" != "fl" ]
 
   then
 
   then
     echo \"$i\" EXEC \"thunar /media/$i\"
+
     echo \"$i\" EXEC \"thunar \'/media/$i\'\"
 
   fi
 
   fi
 
done
 
done
  
echo \"Open\" END
+
echo \"Browse\" END
  
 
echo \"Unmount\" MENU
 
echo \"Unmount\" MENU
Line 70: Line 70:
 
   if [ "$i" != "cd" ] && [ "$i" != "dvd" ] && [ "$i" != "fl" ]
 
   if [ "$i" != "cd" ] && [ "$i" != "dvd" ] && [ "$i" != "fl" ]
 
   then
 
   then
     echo \"$i\" EXEC \"udiskie-umount /media/$i\"
+
     echo \"$i\" EXEC \"udiskie-umount \'/media/$i\'\"
 
   fi
 
   fi
 
done
 
done
Line 76: Line 76:
 
echo \"Unmount\" END
 
echo \"Unmount\" END
  
echo \"Devices\" END
+
echo \"Media\" END
 
</pre>
 
</pre>
  

Revision as of 20:13, 29 September 2010


Introduction

Udiskie is an automatic disk mounting service using udisks. It can be used for mounting CDs, flash drives, and other media. It is simple to use and requires almost to configuration.

Installation

You can install Udiskie by using the udiskie package that is found in the AUR.

Start the Udiskie service by adding

 udiskie &

to your xinitrc file, before the window manager is loaded.

Once Udiskie is running, all removable media will automatically be mounted under /media under a new directory that matches the device name.

Unmounting

Use the udiskie-umount command to unmount and eject media. For example, for a device named "MY_USB_DRIVE":

 udiskie-umount /media/MY_USB_DRIVE

Or, you can unmount all media with the command:

 udiskie-umount -a

Window Manager Menu Scripts

For convenience, you can add a script to the menu in some window managers to allow for easy access and control of removable media.

Openbox

todo

Window Maker

Create a "Generated Submenu" entry in the root menu.

#!/bin/bash

# For a Window Maker menu for removable media.
#
# This script will generate sub-menus for any device mounted
# under /media. You can browse the device in a file manager or
# unmount it.
#
# It will ignore the "cd", "dvd", and "fl" directories.
#
# It uses "thunar" to browse the media.

cd /media

echo \"Media\" MENU

echo \"Browse\" MENU

for i in *
do
  if [ "$i" != "cd" ] && [ "$i" != "dvd" ] && [ "$i" != "fl" ]
  then
    echo \"$i\" EXEC \"thunar \'/media/$i\'\"
  fi
done

echo \"Browse\" END

echo \"Unmount\" MENU

for i in *
do
  if [ "$i" != "cd" ] && [ "$i" != "dvd" ] && [ "$i" != "fl" ]
  then
    echo \"$i\" EXEC \"udiskie-umount \'/media/$i\'\"
  fi
done

echo \"Unmount\" END

echo \"Media\" END

Links