automount in terminal based file manager

Forum Forums General Tips and Tricks automount in terminal based file manager

  • This topic has 2 replies, 3 voices, and was last updated Mar 29-11:15 pm by christophe.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #103579
    Member
    blur13

      Hi!

      I figured out how to use automount in a terminal file manager.

      I only use terminal file managers and whenever I insert a USB stick roxfiler will open up displaying its contents. This can be changed in the preferred applications by selecting another file manager, but only if its gui based. I thought it would be nice if instead the USB folder opened up in my favorite terminal file manager. So I did some research and experimentation. I want to use the terminal st and the file manager nnn

      A basic problem is that you cant specify the working directory when launching st, so as a workaround create file automount.sh with the following lines:

      #!/bin/bash
      
      cd "$1"
      st -e nnn

      chmod 755 and put in $PATH

      in ~/.desktop-session/startup
      make sure the following line is commented out
      #automount-antix &

      and put in

      devmon --exec-on-drive 'automount.sh "%d"' &

      Thats it, now whenever a USB drive is plugged in, it will open up in nnn

      Obviously, st and nnn can be changed for another terminal and file manager (ranger, mc, etc).

      • This topic was modified 1 month ago by blur13.
      • This topic was modified 1 month ago by blur13.
      #103584
      Member
      techore
        Helpful
        Up
        1
        ::

        Interesting.

        I’ve not used udevil, but it looks promising. After an update several months ago, my network drives stopped mounting from fstab on boot. I’ve been issuing ‘mount -a’ to mount after login.

        @blur13, thank you for sharing.

        #103603
        Moderator
        christophe
          Helpful
          Up
          0
          ::

          Yes. I, too, like terminal file managers (mc). And I play with antiX core often.
          This will come in handy. Thanks!

          confirmed antiX frugaler, since 2019

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