https://wiki.archlinux.org/api.php?action=feedcontributions&user=Ikaruga&feedformat=atomArchWiki - User contributions [en]2024-03-28T18:51:22ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Media_Transfer_Protocol&diff=236677Media Transfer Protocol2012-11-24T22:18:44Z<p>Ikaruga: /* Workarounds for Android */</p>
<hr />
<div>[[Category:Sound]]<br />
MTP is the "Media Transfer Protocol" and is used by many MP3 players such as the Creative Zen and some Walkmans. In addition, Android phones and tablets use it since version 3.0. It is part of the "Windows Media" Framework and has close relationship with Windows Media Player.<br />
<br />
==Installation==<br />
MTP support is provided by the [http://libmtp.sourceforge.net/ libmtp] package, to install:<br />
pacman -S libmtp<br />
==Usage==<br />
After installation, you have several mtp tools available.<br />
Upon connecting your MTP device, you use:<br />
mtp-detect<br />
to see if your MTP device is detected.<br />
<br />
To connect to your MTP device, you use:<br />
mtp-connect<br />
<br />
If connection is successful, you will be given several switch options in conjunction with mtp-connect to access data on the device.<br />
<br />
There are also several stand alone commands you can use to access your MTP device such as,<br />
{{Note | Some commands may be harmful to your MTP device!!! }}<br />
<br />
mtp-albumart mtp-emptyfolders mtp-getplaylist mtp-reset mtp-trexist<br />
mtp-albums mtp-files mtp-hotplug mtp-sendfile<br />
mtp-connect mtp-folders mtp-newfolder mtp-sendtr<br />
mtp-delfile mtp-format mtp-newplaylist mtp-thumb<br />
mtp-detect mtp-getfile mtp-playlists mtp-tracks<br />
<br />
==Using media players==<br />
You can also use your mtp device in music players such as Amarok. To do this you may have to edit "/etc/udev/rules.d/51-android.rules" (The MTP device used in the following example is a Galaxy Nexus):<br />
To do this run:<br />
$ lsusb<br />
and look for your device, it will be something like:<br />
Bus 003 Device 011: ID 04e8:6860 Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II], GT-P7500 [Galaxy Tab 10.1]<br />
in which case the entry would be:<br />
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0666"<br />
Then, reload udev rules:<br />
# udevadm control --reload<br />
<br />
{{Note | After installing MTP you may have to reboot for your device to be recognised''}}<br />
<br />
==mtpfs==<br />
Mtpfs is FUSE filesystem that supports reading and writing from any MTP device. Basically it allows you to mount your device as an external drive.<br> It's available in the community repository; you can install it by running {{ic|pacman -S mtpfs}}.<br />
*First edit your {{ic|/etc/fuse.conf}} and uncomment the following line:<br />
user_allow_other<br />
*To mount your device <br />
# mtpfs -o allow_other /media/YOURMOUNTPOINT<br />
*To unmount your device<br />
$ umount /media/YOURMOUNTPOINT<br />
Also, you can put them into your ~/.bashrc:<br />
alias android-connect="mtpfs -o allow_other /media/YOURMOUNTPOINT"<br />
alias android-disconnect="sudo umount /media/YOURMOUNTPOINT"<br />
{{Note|if you want not be asked for password when using sudo, please refer to [[USB Storage Devices#Mounting USB devices]]}}<br />
<br />
==go-mtpfs==<br />
{{Note|Go-mtpfs gives a better performance while writing files to some devices than mtpfs/jmtpfs. Try it if you have slow speeds.}}<br />
If the above instructions don't show any positiv results one should try {{aur|go-mtpfs-git}} from the [[AUR]].<br />
The following has been tested on a Samsung Galaxy Nexus GSM.<br />
<br />
As in the section above install {{aur|android-udev}} which will provide you with "/etc/udev/rules.d/51-android.rules" edit it to apply to <br />
your vendorID and productID, which you can see after running mtp-detect. To the end of the line add with a comma OWNER="yourusername". Save the file.<br />
<br />
*Add yourself to the "fuse" group:<br />
gpasswd -a [user] fuse<br />
<br />
*If the group "fuse" doesn't exist create it with:<br />
groupadd fuse<br />
<br />
Logout or reboot to apply these changes. <br />
<br />
*To create a mount point called "Android" issue the following commands:<br />
mkdir Android<br />
<br />
*To mount your phone use:<br />
go-mtpfs Android<br />
<br />
*To unmount your phone:<br />
fusermount -u Android<br />
<br />
You can create a .bashrc alias as in the example above for easier use.<br />
<br />
==gvfs-mtp==<br />
<br />
Philip Langdale is working on native MTP support for gvfs. Currently gvfs uses gphoto2 for mounting MTP volumes. The weaknesses of gphoto2 and mtpfs are listed in his [http://intr.overt.org/blog/?p=153 blog post]. <br />
*You can test his native mtp implementation for gvfs before it gets upstream with the AUR package [https://aur.archlinux.org/packages.php?ID=62664 gvfs-mtp-git].<br />
<br />
*Devices will have gvfs paths like this<br />
gvfs-ls mtp://[usb:002,013]/<br />
<br />
==KDE MTP KIO Slave==<br />
There is a MTP KIO Slave built upon libmtp under development by Philipp Schmidt, availiable as AUR package [https://aur.archlinux.org/packages.php?ID=63140 kio-mtp-git].<br />
Using KIO makes file access in KDE seamless, in principle any KDE application would be able read/write files on the device.<br />
<br />
===Usage===<br />
The device will be available under the path mtp:/<br />
<br />
===Workaround if the KDE device actions doesn't work===<br />
If you are not able to use the action "Open with File Manager", you may work around this problem by editing the file /usr/share/apps/solid/actions/solid_mtp.desktop<br />
<br />
Change the line<br />
Exec=kioclient exec mtp:udi=%i/<br />
To<br />
Exec=dolphin "mtp:/"<br />
<br />
==Workarounds for Android==<br />
MTP is still buggy and may crash despite the best efforts of developers. The following are alternatives:<br />
* AirDroid - an Android app to access files via your web browser.<br />
* Samba - an Android app to share your SD card as a windows fileshare. Pros: Your desktop apps work as before (since the SD card appears as a windows fileshare). Cons: you need to root your phone.</div>Ikarugahttps://wiki.archlinux.org/index.php?title=Thunar&diff=228947Thunar2012-10-16T01:33:31Z<p>Ikaruga: /* ConsoleKit/PolicyKit */</p>
<hr />
<div>[[Category:File managers]]<br />
[[es:Thunar]]<br />
[[it:Thunar]]<br />
[[pl:Thunar]]<br />
[[ru:Thunar]]<br />
[[zh-CN:Thunar]]<br />
{{Article summary start}}<br />
{{Article summary text|This article discusses every aspect of the file manager named [http://thunar.xfce.org/index.html Thunar].}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Xfce}}: Thunar is installed with a nominal installation of {{Grp|xfce4}}.<br />
{{Article summary text|[[GNOME#Nautilus|Nautilus]]: Thunar is not the only file manager. There are many. For example, Nautilus is the file manager for {{Grp|gnome}}}}.<br />
{{Article summary end}}<br />
<br />
[http://thunar.xfce.org/index.html Thunar] is a file manager that is designed to be fast, lightweight, and easy-to-use. A standard installation of {{Grp|xfce4}} will contain Thunar, but it can be used with other standalone window managers.<br />
<br />
== Installation ==<br />
[[pacman|Install]] the {{pkg|thunar}} package which is available in the [[Official Repositories|official repositories]].<br />
<br />
If you are running [[Xfce|Xfce4]], you probably already have Thunar installed.<br />
<br />
== Automounting ==<br />
Thunar and Xfce4 are in transition from using [[HAL]] and [[ThunarVFS]], being currently deprecated, to using [[GIO]], [[ConsoleKit]], [[PolicyKit]] and the kernel [[udev]] architecture for detecting and automounting removable media. The information is accurate as of 16 August 2011 and Xfce 4.8.<br />
<br />
===Installation===<br />
<br />
[[pacman|Installation]]s of {{pkg|gvfs}} and {{pkg|polkit-gnome}} are ''required'' for automounting, available in [[Official Repositories]].<br />
<br />
Without polkit-gnome XFCE cannot request password authorisations from a user. Password authorisation is required by default for interal mounting on Arch Linux.<br />
<br />
You may need to restart your machine after installation.<br />
<br />
=== Storage group ===<br />
Ensure that the user account is a member of the ''storage'' [[Users and Groups#User groups|group]]. <br />
{{hc|$ groups|lp wheel games video audio optical '''storage''' scanner power users}}<br />
<br />
If it is not, add the user in the ''storage'' group of {{ic|/etc/group}} using the following command:<br />
{{bc|# usermod -a -G storage <user>}}<br />
<br />
=== ConsoleKit/PolicyKit ===<br />
If you are using a [[display manager]] to start your [[window manager]] or [[desktop environment]] session, see the display manager documentation to properly start your session with [[PolicyKit]].<br />
<br />
If you are not using a display manager, include {{ic|ck-launch-session}} and {{ic|dbus-launch}} (in that order) before the command to launch the window manager or desktop environment in [[xinitrc|~/.xinitrc]]: see the specific article for your WM or DE, e.g. [[Xfce#Running Xfce|Xfce]]. For example:<br />
<br />
exec ck-launch-session dbus-launch <your wm><br />
<br />
Note that {{ic|ck-launch-session}} comes before {{ic|dbus-launch}}. If you do them the other way around you might get "Not authorized" errors when you try to mount your drive. See [http://bbs.archbang.org/viewtopic.php?id=289 this forum thread] and bug report {{Bug|25031}}.<br />
<br />
In case your session is set up properly with PolicyKit you should at least be able to shutdown and restart your system using the GUI.<br />
<br />
Also note that [https://bbs.archlinux.org/viewtopic.php?id=111867&p=3 some users] also need to install [[gnome-disk-utility]] in order to get automounting to properly work.<br />
<br />
=== GVFS and trash issue ===<br />
If automounting is still not working you will need to install [[GVFS]]:<br />
{{bc|# pacman -S gvfs}}<br />
<br />
This should also help to enable trash if you have no trash icon on the desktop and adding a trash applet on the taskbar creates a red circle with a white minus instead with the error message saying<br />
FAILED TO CONNECT TO THE TRASH. Operation not supported.<br />
when clicking on it.<br />
<br />
=== Mounting problems after package update ===<br />
Even if mounting usually works, after a package update it may stop working, leaving you with the "Not Authorized" error. The solution is to configure PolicyKit to allow mounting for any user in the '''storage group''', regardless of the state of their session, by writing as root to file {{hc|/etc/polkit-1/localauthority/50-local.d/10-storage-group-mount-override.pkla|<nowiki><br />
[storage group mount override]<br />
Identity=unix-group:storage<br />
Action=org.freedesktop.udisks.filesystem-mount<br />
ResultAny=yes<br />
ResultInactive=yes<br />
ResultActive=yes</nowiki>}}<br />
Results should be instantaneous.<br />
<br />
If you're running the latest version of Arch Linux, you will need to edit this file to support [[udev|udisks]] version 2, as it is the version now included by default:<br />
{{hc|/etc/polkit-1/localauthority/50-local.d/10-storage-group-mount-override.pkla|<nowiki><br />
[storage group mount override]<br />
Identity=unix-group:storage<br />
Action=org.freedesktop.udisks2.filesystem-mount<br />
ResultAny=yes<br />
ResultInactive=yes<br />
ResultActive=yes</nowiki>}}<br />
<br />
<br />
If this does not work in latest version, try to use "Action=org.freedesktop.udisks2.filesystem-mount-system" instead of previous action line<br />
<br />
== Thunar Volume Manager ==<br />
While Thunar can support automatic mounting and unmounting of removable media, the Thunar Volume Manager allows extended functionality, such as automatically running commands or automatically opening a Thunar window for mounted media.<br />
<br />
==== Installation ====<br />
Thunar Volume Manager can be installed from the package {{Pkg|thunar-volman}} in the [[official repositories]].<br />
<br />
==== Configuration ====<br />
It can also be configured to execute certain actions when cameras and audio players are connected. <br />
After installing the plugin:<br />
# Launch Thunar and go to Edit -> Preferences<br />
# Under the 'Advanced' tab, check 'Enable Volume Management'<br />
# Click configure and check the following items:<br />
#* Mount removable drives when hot-pluged.<br />
#* Mount removable media when inserted.<br />
# Also make desired changes (see the example below)<br />
Here's an example setting for making Amarok play an audio CD.<br />
Multimedia - Audio CDs: {{ic|amarok --cdplay %d}}<br />
<br />
== Tips and Tricks ==<br />
=== Using Thunar to browse remote locations ===<br />
Since Xfce 4.8 (Thunar 1.2) it is possible to browse remote locations (such as FTP servers or Samba shares) directly in Thunar, similar to the functionality found in GNOME and KDE. The {{Pkg|gvfs}} and {{Pkg|gvfs-smb}} packages are required to enable this functionality. Both packages are available in the [[official repositories]].<br />
<br />
After a restart of Xfce an additional "Network" entry is added to Thunar's side bar and remote locations can be opened by using the following URI schemes in the location dialog (opened with {{Keypress|Ctrl+L}}): smb://, ftp://, ssh://<br />
<br />
=== Starting in Daemon Mode ===<br />
Thunar may be run in daemon mode. This has several advantages, including a faster startup for Thunar, as well as Thunar running in the background and only opening a window when necessary (for instance, when a flash drive is inserted).<br />
<br />
One option is to autostart it using {{ic|.xinitrc}} or an autostart script (such as [[Openbox]]'s {{ic|autostart}}). It is up to you to decide the best way to start it, and this option can be run from a script or run directly as a command in the terminal.<br />
<br />
To run Thunar in daemon mode, simply add to your autostart script or run from the terminal:<br />
{{bc|$ thunar --daemon &}}<br />
<br />
=== Eliminating Conflicts ===<br />
If [[HAL]] and [[autofs]] are running at the same time, the file hal-mtab will be locked. To avoid this, disable either [[HAL]] or [[autofs]].<br />
<br />
If you cannot get automount running while starting your window manager via {{ic|.xinitrc}} you may wish to change the start line for your window manger from<br />
{{bc|$ exec /usr/bin/dwm}}<br />
to<br />
{{bc|$ exec ck-launch-session /usr/bin/dwm}}<br />
<br />
=== Setting the Icon Theme ===<br />
When using Thunar outside of Gnome or Xfce, certain packages and configurations that control which icons are used may be missing. Window Managers like Awesome and Xmonad do not come with XSettings managers, which is where Thunar looks first for it's icon setting. It is possible to install and run xfce-mcs-manager from a startup script if many Xfce4 and Gnome applications are going to be used. The gtk-icon-theme-name setting for gtk2 can be set for a user by adding something like the following to {{ic|~/.gtkrc-2.0}}:<br />
gtk-icon-theme-name = "Tango"<br />
<br />
Of course, just installing the gnome-icon-theme package will give Thunar an icon theme to use other than the default paper icon for all items.<br />
{{bc|# pacman -S gnome-icon-theme}}<br />
<br />
=== Solving problem with slow cold start ===<br />
Some people still have problems with Thunar taking a long time to start for the first time. This is due to gvfs checking the network, preventing Thunar from starting until gvfs finishes its operations. To change this behaviour, edit {{ic|/usr/share/gvfs/mounts/network.mount}} and change '''AutoMount=true''' to '''AutoMount=false'''.<br />
<br />
== Other plugins and addons ==<br />
Many of these plugins are part of the xfce4-goodies group, so if you have downloaded it, you will probably have all of these anyway.<br />
<br />
=== Thunar Archive Plugin ===<br />
The Thunar Archive Plugin is a frontend to file archive software such as File Roller, Ark, or Xarchiver to allow a simple, consistent interface to opening and decompressing archives.<br />
==== Installation ====<br />
It can be installed by running:<br />
{{bc|# pacman -S thunar-archive-plugin}}<br />
<br />
=== Thunar Media Tags Plugin ===<br />
The media tags plugin will display detailed information about media files. It supports ID3 (the MP3 file format's system) and Ogg/Vorbis tags. It also has a bulk renamer and allows editing of media tags.<br />
==== Installation ====<br />
It can be installed by running:<br />
{{bc|# pacman -S thunar-media-tags-plugin}}<br />
<br />
=== Thunar thumbnails ===<br />
Thunar relies on an external program called [http://git.xfce.org/xfce/tumbler/tree/README tumbler] to generate thumbnails.<br />
{{Pkg|tumbler}} can be installed from the [[official repositories]].<br />
{{bc|# pacman -S tumbler}}<br />
To generate video thumbnails, you have to install additional programs. There are two options.<br />
<br />
First, you can install {{Pkg|ffmpegthumbnailer}}.<br />
{{bc|# pacman -S ffmpegthumbnailer}}<br />
Second, you can install {{Pkg|gstreamer0.10}} and {{Pkg|gstreamer0.10-ffmpeg}}, just in case {{Pkg|ffmpegthumbnailer}} doesn't work.<br />
{{bc|# pacman -S gstreamer0.10<br />
# pacman -S gstreamer0.10-ffmpeg<br />
}}<br />
<br />
=== Thunar Shares ===<br />
The Thunar Shares Plugin allows you to quickly share a folder using Samba from Thunar without requiring root access.<br />
==== Installation ====<br />
Install [https://aur.archlinux.org/packages.php?ID=24152 thunar-shares-plugin] package from the [[AUR]].<br />
<br />
==== Configuration ====<br />
{{Merge|Samba|These are samba configuration, should merge to [[Samba]] and leave link here.}}<br />
This marks the named objects for automatic export to the environment of subsequently executed commands:<br />
{{bc|<nowiki># export USERSHARES_DIR="/var/lib/samba/usershares"<br />
# export USERSHARES_GROUP="sambashare"</nowiki>}}<br />
This creates the usershares directory in var/lib/samba:<br />
{{bc|<nowiki># mkdir -p ${USERSHARES_DIR}</nowiki>}}<br />
This makes the group sambashare:<br />
{{bc|<nowiki># groupadd ${USERSHARES_GROUP}</nowiki>}}<br />
This changes the owner of the directory and group you just created to root:<br />
{{bc|<nowiki># chown root:${USERSHARES_GROUP} ${USERSHARES_DIR}</nowiki>}}<br />
This changes the permissions of the usershares directory so that users in the group sambashare can read, write and execute files:<br />
{{bc|<nowiki># chmod 01770 ${USERSHARES_DIR}</nowiki>}}<br />
Using your favorite text editor as root, create the file {{ic|/etc/samba/smb.conf}}<br />
{{bc|# joe /etc/samba/smb.conf}}<br />
Use this {{ic|smb.conf}} configuration file: <br />
{{hc|/etc/samba/smb.conf|<nowiki><br />
##This is the main Samba configuration file. You should read the<br />
##smb.conf(5) manual page in order to understand the options listed<br />
##here. Samba has a huge number of configurable options (perhaps too<br />
##many!) most of which are not shown in this example<br />
##<br />
##For a step to step guide on installing, configuring and using samba, <br />
## read the Samba-HOWTO-Collection. This may be obtained from:<br />
## http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf<br />
##<br />
## Many working examples of smb.conf files can be found in the <br />
## Samba-Guide which is generated daily and can be downloaded from: <br />
## http://www.samba.org/samba/docs/Samba-Guide.pdf<br />
##<br />
## Any line which starts with a ; (semi-colon) or a # (hash) <br />
## is a comment and is ignored. In this example we will use a #<br />
## for commentry and a ; for parts of the config file that you<br />
## may wish to enable<br />
##<br />
## NOTE: Whenever you modify this file you should run the command "testparm"<br />
## to check that you have not made any basic syntactic errors. <br />
##<br />
#[global]<br />
# workgroup = WORKGROUP<br />
# security = share<br />
# server string = My Share<br />
# load printers = yes<br />
# log file = /var/log/samba/%m.log<br />
# max log size = 50<br />
# usershare path = /var/lib/samba/usershares<br />
# usershare max shares = 100<br />
# usershare allow guests = yes<br />
# usershare owner only = False<br />
# <br />
#<br />
# #Windows Internet Name Serving Support Section:<br />
#<br />
# #WINS Support - Tells the NMBD component of Samba to enable it's WINS Server<br />
#; wins support = yes<br />
#<br />
## WINS Server - Tells the NMBD components of Samba to be a WINS Client<br />
## Note: Samba can be either a WINS Server, or a WINS Client, but NOT both<br />
#; wins server = w.x.y.z<br />
#<br />
##WINS Proxy - Tells Samba to answer name resolution queries on<br />
## behalf of a non WINS capable client, for this to work there must be<br />
## at least one WINS Server on the network. The default is NO.<br />
#; wins proxy = yes</nowiki>}}<br />
Save the file and then add your user to the group sambashares replacing "your_username" with the name of your user:<br />
{{bc|# usermod -a -G ${USERSHARES_GROUP} your_username}}<br />
Restart Samba:<br />
{{bc|# /etc/rc.d/samba restart}}<br />
Log out and log back in. You should now be able to right click on any directory and share it on the network.<br />
When the error {{ic|You are not the owner of the folder}} appears, simply try to reboot the system.<br />
To have samba start at boot, add samba to daemons in your {{ic|/etc/rc.conf}} file.<br />
For more information, visit the [[Samba]] wiki page.<br />
<br />
== Custom actions ==<br />
This section covers useful custom actions which can be accessed through Edit -> Configure custom actions. More examples are listed in the [http://thunar.xfce.org/pwiki/documentation/custom_actions thunar wiki].<br />
<br />
=== Scan for viruses ===<br />
To use this action you need to have clamav and clamtk installed.<br />
<br />
{| border="1" cellpadding="4" cellspacing="0"<br />
! Name !! Command !! File patterns !! Appears if selection contains<br />
|-<br />
! Scan for virus<br />
| clamtk %F || * || Select all<br />
|}<br />
<br /><br />
=== Link to Dropbox ====<br />
{| border="1" cellpadding="4" cellspacing="0"<br />
! Name !! Command !! File patterns !! Appears if selection contains<br />
|-<br />
! Link to Dropbox<br />
| ln -s %f /path/to/DropboxFolder || * || Directories, other files<br />
|}<br />
<br />
Please note that when using many custom actions to symlink files and folder to a particular place, it might be useful to put them into the {{ic|Send To}} folder of the context menu to avoid that the menu itself gets bloated. This is fairly easy to achieve and requires a .desktop file in {{ic|~/.local/share/Thunar/sendto}} for each action to perform. Say we want to put the above dropbox symlink action into Send To, we create a {{ic|dropbox_folder.desktop}} with the following content. The new applied action will be active after restarting Thunar.<br />
<br />
[Desktop Entry]<br />
Type=Application<br />
Version=1.0<br />
Encoding=UTF-8<br />
Exec=ln -s %f /path/to/DropboxFolder<br />
Icon=/usr/share/icons/dropbox.png<br />
Name=Dropbox<br />
<br />
== Links and References ==<br />
* [http://thunar.xfce.org/index.html Thunar] project page.<br />
* [http://goodies.xfce.org/projects/thunar-plugins/thunar-volman Thunar Volume Manager] project page.<br />
* [http://goodies.xfce.org/projects/thunar-plugins/thunar-archive-plugin Thunar Archive Plugin] project page.<br />
* [http://goodies.xfce.org/projects/thunar-plugins/thunar-media-tags-plugin Thunar Media Tags Plugin] project page.<br />
*[http://goodies.xfce.org/projects/thunar-plugins/thunar-shares-plugin/ Thunar Shares Plugin] project page.<br />
* This [http://goodies.xfce.org/projects/thunar-plugins/start list] of plugins.</div>Ikaruga