Thunar unmount usb drives not working

  • This topic has 7 replies, 4 voices, and was last updated Aug 3-6:32 pm by seaken64.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #39658
    Member
    ex_Koo

      If I use Thunar and mount a usb externel drive I can not unmount the drive. Operation not permitted
      This has never been fixed with antiX 19 you will never be able to unmount a usb device until the gvfs files can be installed a work with Thunar, including phones will not mount either.
      Yet this works just fine with MX 19 and Thunar as the gvfs are installed and working.

      Using spaceFM mounting and unmounting usb Drives work fine with antiX 19 but phones are not working..

      #39661
      Member
      Xecure
        Helpful
        Up
        0
        ::

        Have you set thunar as your file manager using Control Centre > Desktop > Preferred Applications?

        You could try:

        Make sure the command thunar –daemon is autostarted on login.
        From: https://wiki.archlinux.org/index.php/Thunar

        You could also try
        dbus-launch thunar
        and see if you can mount/unmount stuff with it.

        I have no experience with thunar, so this is probably a shot in the dark.

        antiX Live system enthusiast.
        General Live Boot Parameters for antiX.

        #39691
        Member
        ex_Koo
          Helpful
          Up
          0
          ::

          @Xecure Thanks for Replying.

          Don’t worry about it now as I have put thunar on the back burner with antiX. The drive mounting won’t work without the gvfs working in thunar. (Works fine with MX)
          thunar –daemon wont not work with antiX.
          dbus-launch thunar makes no difference.

          Have made SpaceFM my default file manager with antiX as drive mounting/unmounting works just fine.. And can make custom actions too like thunar.

          As far as the phone mounting goes it does work but only by using /usr/share/applications/antixandroid-device-usb-connect.desktop. And this will only open on a gui desktop won’t open at all so far with i3wm. (Will look into this later.)

          Thanks again.

          #39697
          Member
          ModdIt
            Helpful
            Up
            0
            ::

            On Ice I have Taskbar entrys

            prog “MountPhone” /usr/share/icons/papirus-antix/48×48/devices/pda.png jmtpfs /home/myhome/Phone

            prog “Abziehen des Wechseldatenträgers” /usr/share/icons/papirus-antix/48×48/devices/drive-removable-media-usb.png unplugdrive.sh

            They had to be added to personal menu to work and a folder in home called Phone created.

            Works fine for me with exception of clean unmount. The phone folder is often blocked until reboot.
            not a big deal in my or group usage case so I never looked for how to fix it.

            #39717
            Member
            ex_Koo
              Helpful
              Up
              0
              ::

              @ModdIt I would try the script below Or just copy the file from the location given it may work better just make sure yad is installed or maybe it is by default.

              /usr/share/applications/antixandroid-device-usb-connect.desktop executes the script below

              /usr/local/bin/android-device-usb-connect.sh This is a bash script which users yad as an interface (interesting this should work with i3wm as I use yad interface for other things)

              And so it does..

              #!/bin/bash
              
              # -----------------------------------------------------------------------------
              # antiX gui for mounting/unmount android devices, by PPC and sybok, 21/5/2020, fully GPL...
              # -----------------------------------------------------------------------------
              
              TEXTDOMAINDIR=/usr/share/locale
              TEXTDOMAIN=android-device-usb-connect
              
              dir="$HOME/android_device"
              sleep_time=1
              yad_title=$"Android Device USB Connect"
              yad_window_icon="phone"
              yad_image="/usr/share/icons/papirus-antix/48x48/devices/smartphone.png"
              
              preparation(){
                # Clear some files and prepare directories:
                echo $"Clearing files and preparing directories"
                  
                if ! [ -d "${dir}" ]; then
                  mkdir -p "$dir"
                fi
              } # preparation
              
              check_utilities(){
                # Check that some commands are available
                echo $"Checking availability of required utilities"
                fusermount -V 1>/dev/null || exit 1
              ## testing -  yad
              	if ! [ -x "$(command -v yad)" ]; then
              		echo $"Error: yad is not available" >&2 && exit
              	fi
              ## testing -  jmtpfs
              	if ! [ -x "$(command -v jmtpfs)" ]; then
              		echo $"Error: jmtpfs is not available" >&2 && exit
              	fi
                echo $"Checking availability of required utilities finished successfully"
              } # check_utilities
              
              check_mounted(){
                # 1- check if a android device seems to be mounted. If so, offer to unmount it and exit OR to access device
              	if [ "$(ls -A "$dir")" ]; then
              		echo $"An android device seems to be mounted"
              		yad --fixed --window-icon=$yad_window_icon --image=$yad_image --title "$yad_title" --center --text=$"An android device seems to be mounted.\n \nChoose 'Unmount' to unplug it safely OR \n Choose 'Access device' to view the device's contents again.   "  --button=$"Access device":1 --button=$"Unmount":2
              			foo=$?
              			[[ $foo -eq 1 ]] && echo $"User has chosen to access the android device" && desktop-defaults-run -fm "$dir" && exit 1
              			[[ $foo -eq 2 ]] && echo $"User has chosen to unmount the android device" && fusermount -u "$dir" && rm -r "$dir" ###&& exit
              				#### NEW confirmation dialog, that warns if it's safe to unplug the device
              				if [ "$(ls -A "$dir")" ]; then
              					echo $"Android device WAS NOT umounted for some reason, do not unplug!"
              					yad --fixed --window-icon=$yad_window_icon --image=$yad_image --title "$yad_title" --center --text=$"Android device WAS NOT umounted for some reason, do not unplug!"  --button=$"OK" && exit
              				 else
              					echo $"Android device is umounted; it is safe to unplug!"
              					yad --fixed --window-icon=$yad_window_icon --image=$yad_image --title "$yad_title" --center --text=$"Android device is umounted; it is safe to unplug!"  --button=$"OK" && exit
              		
              				fi
              	fi
               } # check_mounted
              
              check_connected(){
                # 2- Check if an android device is connected to the computer, if not, warn user and exit
               while :
              	do
              		device_check=$(jmtpfs  2>&1)
              			if [[ $device_check == *"No mtp"* ]]; then
              				echo $"No device connected"
              				else echo $"Device is connected" && sleep 1 && break
              			fi
              		yad --fixed --window-icon=$yad_window_icon --image=$yad_image --title "$yad_title" --center --text=$"No (MTP enabled) Android device found!\n  \n Connect a single device using its USB cable and \n make sure to select 'MTP' or 'File share' option and retry.   \n" --button=$"EXIT":1 --button=$"Retry":2
              		foo=$?
              		[[ $foo -eq 1 ]] && echo $"User pressed Exit" && exit 1
              		[[ $foo -eq 2 ]] && echo $"User pressed Retry"
              	done
              } # check_connected
              
              mount_display(){
                # 3- Try to mount android device and show contents
                jmtpfs "$dir" &&
                
                 if  [ "$(ls -A "$dir")" ]; then
              	desktop-defaults-run -fm "$dir"
              	echo $"Device is mounted!"
                 else 
              	echo $"Device is NOT mounted!" 
                fi
                echo $"Attempted to mount device and display its contents"
              } # mount_display
              
              check_while_mount(){
                # 4- When trying to mount device, perform check if device contents are displayed, if not, user may need to allow access on the device. Prompt user to do that and unmount, remount device, and try to display it's contents again
                 echo $"Checking if device can be mounted, asking user to grant permission on the device and try to mount again"
               	if [ "$(ls -A "$dir")" ] ; then
              			echo $"Device seems properly mounted!"
              	     else
              			echo $"Please check that you have ALLOWED access to your files on your android device in order to proceed" && yad --fixed --window-icon=$yad_window_icon --image=$yad_image --title "$yad_title" --center --text=$"Please check that you have ALLOWED access to your files on your android device in order to procced\n \n Note: If you did not allow access, simply unplug and plug in your device's USB cable once more" --button Retry && fusermount -u "$dir" && jmtpfs "$dir" && desktop-defaults-run -fm "$dir"
              	fi
                #recheck if device contents are displayed, if not, warn user and exit and unmount device to avoid errors
                sleep 1 && echo $"Final check to see if device can be mounted. If not, unmount it to avoid any errors"
              [ "$(ls -A "$dir")" ] && echo $"The device seems to be correctly mounted." && exit
               echo $"Please check that you have ALLOWED access to your files on your android device in order to proceed" && yad  --fixed --window-icon=$yad_window_icon --image=$yad_image --title "$yad_title" --center --text=$" Unable to mount device! \n Please check you correctly selected 'MTP...' or 'File transfer...' option.\n Or 'Allowed' file access.\n \n Unplug and plug in your device and try again." --button Exit
              	 fusermount -u "$dir" && rm -r "$dir"
              } # check_while_mount
              
              main(){
                # The main function
                preparation
                check_utilities
                check_mounted
                check_connected
                mount_display
                check_while_mount
                echo "Done"
              } # main
              
              main
              • This reply was modified 2 years, 9 months ago by ex_Koo.
              #39719
              Member
              ModdIt
                Helpful
                Up
                0
                ::

                Thanks Koo, I did see what PPC and Sybock were working on, it does as you say work well
                so will go on the master stick soon.

                i am pretty demotivated unfortunately, looks like a second lockdown might not be far away
                lot of cases around where I live.
                Many of my loved ones are in UK and Vietnam. UK is in a terrible state, VN suffering after
                being able to keep things under control for a long time. Especialy In Ho Chi Minh, my friends
                are terrified of workplace closures and jobs lost forever. Many places closed already.

                #39759
                Member
                ex_Koo
                  Helpful
                  Up
                  0
                  ::

                  Sorry to hear how badly the virus is affecting your friends and family the world really needs a vaccine.I wish you and everyone all the Best.

                  #39800
                  Member
                  seaken64
                    Helpful
                    Up
                    0
                    ::

                    Sorry ModdIt. Yes, it’s terrible that so many people do not know how they will make a living. I hope you and your family and friends can make it through this without getting too discouraged. Koo is right, we need a vaccine soon. I also wish you only the best.

                    Seaken64

                  Viewing 8 posts - 1 through 8 (of 8 total)
                  • You must be logged in to reply to this topic.