meganz / MEGAsync

Easy automated syncing between your computers and your MEGA Cloud Drive
Other
1.61k stars 278 forks source link

megasync behaviour in Linux when no systray available #41

Closed sedimentation-fault closed 7 years ago

sedimentation-fault commented 7 years ago

When someone uses megasync in Linux, in a window manager without any standard systray application (say, fvwm2), then one starts megasync from the command line of an xterm, megasync starts and...nothing.

The user who uses it for the first time (we are all first-time users at some point in a software's life-cycle!) is left in the dark: megasync seems to be running OK, even the debug output indicates that it is doing something and probably what it is doing is its job - but there is no icon, no feedback. Is it logging in? Is it synchronizing? Is it reading/writing? Is all OK? Did I miss anything during compilation/installation?

I had to search for days, under the almost certain impression that megasync is NOT functioning correctly, until I found some blog that displayed, step-by-step AND with screenshots, how installation of megasync looks like in a GNOME/KDE environment - an environment that comes with a systray application by its very definition. The screenshot 'megasync docs into your systray' was a revelation to me! There was no sign at all for me that megasync does such a thing by default - up to that point!

You should do something about this use case - I cannot imagine that it is too odd. There are people in the Linux world who dislike systrays, but would like to use a syncing application like megasync. In case there is no systray running, megasync should at least issue a warning to the user, so he knows what is going on and what is needed.

FYI, as soon as I installed stalonetray, all is well. stalonetray (a systray application, but not the only one around...) displays the megasync icon and the icon informs me about what is going on. All fine! :-)

To the FVWM users out there reading this, here is how you can incorporate stalonetray to your window manager:

Add the lines:


#-----------------------------------------------------------------------
# Starts a system tray "module"
#-----------------------------------------------------------------------
#
DestroyFunc FuncStartSysTray
AddToFunc FuncStartSysTray
+ "I" Test (x stalonetray) PipeRead `echo Exec exec stalonetray \
-d all \
--grow-gravity SE \
--kludges fix_window_pos,force_icons_size,use_icons_hints \
--background="grey67"`
+ "I" TestRc (Match) Wait stalonetray

#-----------------------------------------------------------------------
# Starts system tray applets like network, sound, etc
#-----------------------------------------------------------------------
DestroyFunc FuncStartSystrayApplets
AddToFunc FuncStartSystrayApplets
+ "I" PipeRead 'echo SetEnv systray_started `ps -e |grep -c stalonetray`'
+ "I" Test (EnvMatch systray_started 0 ) break
# volume
+ "I" Test (x volumeicon) exec exec volumeicon
# battery
+ "I" Test (x fdpowermon) exec exec fdpowermon
# network
+ "I" Test (x nm-applet) exec exec nm-applet
# bluetooth
+ "I" Test (x bluetooth-applet) exec exec bluetooth-applet

#-----------------------------------------------------------------------
# stalonetray
#-----------------------------------------------------------------------
Style stalonetray !Title
Style stalonetray HandleWidth 2
Style stalonetray EWMHUseStackingOrderHints
Style stalonetray Sticky
Style stalonetray WindowListSkip
Style stalonetray StaysOnBottom

to your ~/.fvwm2rc file. Then add the lines

+   "I" Test (Init) FuncStartSysTray
 +  "I"     Test (Init) FuncStartSystrayApplets

to your InitFunction, i.e. somewhere under the line:

AddToFunc InitFunction

To let FvwmButtons (in case you use it) swallow stalonetray, add something like:

*FvwmButtonsRows 3

The '1x3' makes stalonetray occupy 1 column and 3 rows in FvwmButtons,

resulting in a nice vertical tooltray.

*FvwmButtons (1x3, Swallow(NoClose, UseOld, SwallowNew) "stalonetray" 'Test (x stalonetray) FuncStartSysTray'

to ~/.fvwm2rc.

You also need a configuration file for stalonetray. This is ~/.stalonetrayrc. My ~/.stalonetray file contains:

transparent true
window_layer bottom
grow_gravity NW
icon_gravity NW
scrollbars vertical
no_shrink true
tint_level 0
tint_color white
log_level info
parent_bg false
icon_size 18
sticky true
window_layer normal
window_strut auto
window_type normal
geometry 4x12
skip_taskbar false

but YMMV.

PS. You might want to add the above to your FAQ.

polmr commented 7 years ago

Megasync is designed to give the same user experience in all the different supported systems: Windows, Mac, and the different Linux flavours. The ecosystem in the latter is as huge as it gets. Covering all cases is not something bearable nor intended. That's why, at the moment, we are "stuck" with the systray. The same goes for the FAQ. However, we do really appreciate the inputs and your words for the FVWM community. I think it's great to have them here as reference for those who want to install a systray for using megasync.

sedimentation-fault commented 7 years ago

I understand. No problem.

I am not trying to get you out of the "systray thing". But please put some message after megasync starts, along the lines of:

"Searching for a system tray to dock the megasync icon... No systray found. megasync is running fine without one, but you will not be able to monitor what it does through its icon. If you find this behavior difficult to follow, you might want to install a systray application and make sure it is running, before you start megasync."

I mean, megasync tries to dock into a systray anyway. In doing so, it either succeeds, or fails. My point is that you should output a message like the above, when it fails - instead of failing to dock silently.

polmr commented 7 years ago

Two comments on this: following @sedimentation-fault comments, a message on startup in systems without systray has been added. Also, in megasync >= 2.9.10, re-executing megasync will show the main interface. This way, we keep the systray behaviour and support environments without systray.