0

So, I have seen some other answers out there on similar questions, and I think I'm getting closer to an answer on my specific question. However, none of the answers I've seen are exactly what I need just yet.

So, I know that you can load things at login for the fish shell in ~/.config/fish/config.fish

However, I was wanting to run this specific thing at login to the x environment (xfce for me):

# Rclone mount
if status is-interactive
    if test -s /run/media/greg/Files/Dropbox/
        if ping -qc 1 -W 3 1.1.1.1 > /dev/null
            rclone mount --daemon Dropbox:/ /run/media/greg/Files/Dropbox/
        else
            echo "Dropbox was not successfully mounted"
        end
    end
end

It works likes this:

  1. If the folder in question is empty (test)
  2. If you can ping out to the world (1.1.1.1)
  3. Mount configured drive to location (Dropbox)
  4. Or echo it was not mounted

This appears to work when I open a terminal on the desktop (with the is-interactive line or not), but I've tried other ways to get it to automount this drive when I gain access to the desktop and none have worked yet.

Does anyone have a simple solution to this problem?

Thanks all!

GregTheHun
  • 61
  • 1
  • 6
  • You can see how to run arbitrary programs on Xfce, Gnome, and all other FreeDesktop standardized DEs [here](https://stackoverflow.com/a/8290652/1899640). Make sure your fish script is in a file with execute permissions and a shebang – that other guy Dec 23 '20 at 21:09
  • 2
    Don't - service management is better done in a service manager, not the shell. See e.g. https://github.com/rclone/rclone/wiki/Systemd-rclone-mount for how to do it in systemd. – faho Dec 23 '20 at 21:14
  • OK, that looks a little complicated, but I'll see what I need to change to get this working. – GregTheHun Dec 23 '20 at 21:54

0 Answers0