MEGAsync icon indicating copy to clipboard operation
MEGAsync copied to clipboard

Linux: Start in background

Open p3lim opened this issue 7 years ago • 15 comments

The only options when starting seem to be --version and --debug, there's no option to start in the background (not showing window when started).

I'm using v3.5.3 (dd89d0), and have to resort to this bash script after starting:

until xdotool search --onlyvisible ---class '^megasync$' ; do
    sleep .2
done
xdotool key Escape

p3lim avatar Jan 11 '18 02:01 p3lim

Related issue here: https://github.com/meganz/MEGAsync/issues/142

polmr avatar Jan 12 '18 09:01 polmr

I highly suggest an option is put in to suppress that behavior, as you'd expect a window for an application, while the sync client is more of a service with a settings window.

p3lim avatar Jan 12 '18 09:01 p3lim

What is your OS/desktop environment? that behaviour should only happen when no systray is available: we want the user to notice MEGAsync is running. If systray is available main UI won't pop up, since there already is an indicator that MEGAsync is running. If you are using Gnome Shell, we'd recommend you to use TopIcons Plus extension: https://extensions.gnome.org/extension/1031/topicons/

polmr avatar Jan 12 '18 09:01 polmr

i3wm + polybar, so no tray (intentional). I know the client is running because of the notifications from it, which is more than sufficient.

p3lim avatar Jan 12 '18 09:01 p3lim

Ok, we'll consider adding a --do-not-startui-when-no-systray-available option. Also, if you wan't a non gui sync client you can also use MEGAcmd: https://mega.nz/cmd

polmr avatar Jan 12 '18 09:01 polmr

I do prefer having a GUI for status, but I'll take a look at it. Thanks for the consideration.

p3lim avatar Jan 12 '18 09:01 p3lim

+1 no-gui option. Yes, megacmd can do it, but it is another client that you have to install and configure separately. Also, megacmd does a lot more than megasync. I miss a simple command line interface when I need to start magasync remotely through ssh. A simple interface like the following would be great:

  • megasync --no-gui: do not open a GUI, even if one is available.
  • megasync --start: start the background process, even if a GUI is not available.
  • megasync --stop: stop the background process, even if a GUI is not available.
  • megasync --status: show the status of the background process in the terminal.

jjchico avatar Jan 24 '18 14:01 jjchico

this would be great! +1

JohnnyKing94 avatar Sep 10 '18 09:09 JohnnyKing94

Any updates on this?

Wondering what is the best way to run megasync in the background on i3wm.

iljapanic avatar Feb 24 '19 13:02 iljapanic

I'm looking for a MEGAsync daemon client for ArchLinux, because the megasync-daemon-git in AUR failed to compile, and megafuse-git crashes with SIGSEGV.

It's perfect if I can write a command in /etc/rc.local like this:

#!/bin/bash
# rc.local

something...

megasync --daemon --mount '/:/mnt/mega-cloud' --mount '//in:/mnt/mega-cloud-in' > /path/to/my/log/file.log 2>&1 & disown

Or write a megasync-daemon as a systemd service.

GUI is not allowed here because Xorg or Wayland may have not started yet, and it's really really unnecessary. I think that's what a linux app should do. (have a look at AWS s3! that's perfect!)

recolic avatar Mar 21 '19 02:03 recolic

Hi, what's the status on the no-gui option? I'm trying to start megasync on a distant computer that doesn't have a desktop started.

p-enel avatar May 08 '20 11:05 p-enel

Running megasync again minimizes the GUI so this is what I do in my i3-wm config:

exec --no-startup-id sleep 30 && megasync &
exec --no-startup-id sleep 33 && megasync &

It's annoying but it works.

Surendrajat avatar Mar 13 '21 08:03 Surendrajat

Any update ? I use i3wm + polybar and option megasync --no-gui: do not open a GUI, even if one is available is very welcome.

pietryszak avatar Nov 29 '21 22:11 pietryszak

Folks are waiting for the --no-gui, or should we demonstrate for it.?! !!

For now, I will workaround it by double opening it so it will toggle

megasync && megasync

MuhammadSawalhy avatar Feb 20 '22 06:02 MuhammadSawalhy

Another workaround : you can use the AppIndicator and KStatusNotifierItem Support extension (pre-installed on fedora) to support old system tray on gnome 40+ image

orkeilius avatar Dec 19 '23 10:12 orkeilius