dropbox / nautilus-dropbox

Dropbox Integration for Nautilus
Other
236 stars 53 forks source link

Port extension to libnautilus-extension-4 and fix deprecations in dropbox-client #105

Closed coreyberla closed 1 year ago

coreyberla commented 2 years ago

Nautilus 43 introduced several breaking changes with libnautilus-extension-4. libnautilus-extension-4 now depends on gtk4. Certain deprecated symbols / headers were dropped and changes were made to separate GTK widgets from extension code.

See: https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/876

CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

amorehead commented 2 years ago

Hey, all. Any ideas when we might expect to see these changes pushed to the AUR for users to download?

jtojnar commented 2 years ago

@amorehead You need to ask the maintainer of https://aur.archlinux.org/packages/nautilus-dropbox to pick this patch. Some distros already do that (e.g. NixOS).

coreyberla commented 2 years ago

Some distros already do that (e.g. NixOS).

Because @jtojnar is on top of it!

I'll probably add a package on AUR because it looks like the maintainer there isn't available

amorehead commented 2 years ago

@coreyberla, I know many Arch users would greatly appreciate it if you are able. Thanks!

belegdol commented 2 years ago

On Fedora 37 there is an unknown icon showing for folders containing images: Bildschirmfoto vom 2022-11-15 19-22-02

coreyberla commented 2 years ago

@coreyberla, I know many Arch users would greatly appreciate it if you are able. Thanks!

Here's a working PKGBUILD. I submitted an orphan request on the nautilus-dropbox package in AUR

https://github.com/coreyberla/nautilus-dropbox-aur

coreyberla commented 2 years ago

On Fedora 37 there is an unknown icon showing for folders containing images: Bildschirmfoto vom 2022-11-15 19-22-02

This is because the dropbox backend is sending a bad emblem name to nautilus-dropbox. Here's a workaround, it's ugly, so I don't really want to include it in this PR

diff --git a/src/nautilus-dropbox.c b/src/nautilus-dropbox.c
index b9c10b4..e1a1d0f 100644
--- a/src/nautilus-dropbox.c
+++ b/src/nautilus-dropbox.c
@@ -361,7 +361,12 @@ nautilus_dropbox_finish_file_info_command(DropboxFileInfoCommandResponse *dficr)
       int i;
       for ( i = 0; status[i] != NULL; i++) {
          if (status[i][0])
-           nautilus_file_info_add_emblem(dficr->dfic->file, status[i]);
+         {
+           gchar *emblem = status[i];
+           if (g_strcmp0(emblem, "people") == 0)
+             emblem = "shared";
+           nautilus_file_info_add_emblem(dficr->dfic->file, emblem);
+         }
       }
       result = NAUTILUS_OPERATION_COMPLETE;
     }
juurakki commented 2 years ago

For somebody arriving to this page and just want to get dropbox command to work on Fedora 37, you can start the terminal and run: git clone https://github.com/coreyberla/nautilus-dropbox.git cd nautilus-dropbox git checkout libnautilus-extension-4 docker run -v $PWD:/d -w /d -it --rm fedora:37 /bin/bash

and inside the docker container run: dnf install -y gnome-common nautilus-devel python3-docutils python3-gobject gtk4-devel ./autogen.sh && make && make install

now, from another terminal window, copy dropbox "binary" (actually a Python file) to /usr/bin/ e.g. sudo install -m 755 -g root -o root dropbox /usr/bin/dropbox

cbmeeks commented 2 years ago

For somebody arriving to this page and just want to get dropbox command to work on Fedora 37, you can start the terminal and run: git clone https://github.com/coreyberla/nautilus-dropbox.git cd nautilus-dropbox git checkout libnautilus-extension-4 docker run -v $PWD:/d -w /d -it --rm fedora:37 /bin/bash

and inside the docker container run: dnf install -y gnome-common nautilus-devel python3-docutils python3-gobject gtk4-devel ./autogen.sh && make && make install

now, from another terminal window, copy dropbox "binary" (actually a Python file) to /usr/bin/ e.g. sudo install -m 755 -g root -o root dropbox /usr/bin/dropbox

This worked very well for me so far. I just wished Dropbox would give the same level of quality to their Linux users. I mean, the are charging the same amount of money.

coreyberla commented 2 years ago

copy dropbox "binary" (actually a Python file) to /usr/bin/ e.g.

FYI this won't install the nautilus extension (context menus / emblems in Nautilus). If you want to follow the same process make sure to grab the extension (e.g. /usr/lib64/nautilus/extensions-4/libnautilus-dropbox.so)

edit: so I just learned that Dropbox has all linux users download nautilus-dropbox at https://www.dropbox.com/install in order to get the Dropbox binary (and nautilus extension) in order to download the daemon at https://clientupdates.dropboxstatic.com/dbx-releng/client/dropbox-lnx.x86_64-161.4.4923.tar.gz (current version). Interesting.

coreyberla commented 2 years ago

I updated this branch to fix the deprecation warnings in the dropbox binary

cbmeeks commented 2 years ago

Hmm. I thought this would work but Dropbox never syncs. It just says syncing forever and nothing ever happens. This is so frustrating.

coreyberla commented 2 years ago

It just says syncing forever and nothing ever happens.

Did you run dropbox start -i

cbmeeks commented 2 years ago

It just says syncing forever and nothing ever happens.

Did you run dropbox start -i

Yes, several times. Including erasing the Dropbox folders and re-installing. I started noticing this the other day with Fedora 36. Dropbox would never finish syncing. Then I completely wiped my hard drive, installed Fedora 37 and discovered Dropbox has even more trouble with F37. I'm seriously done with Dropbox. Been a Pro user for 10 years or more.

coreyberla commented 2 years ago

Including erasing the Dropbox folders and re-installing.

Are you referring to ~/Dropbox or ~/.dropbox and ~/.dropbox-dist. The latter two would be worth moving a backup location.

cbmeeks commented 2 years ago

Well, right now I deleted everything. All of it. I'm going to try again. I found a few different solutions online and I think I got some of them mixed up.

cbmeeks commented 2 years ago

Hmm.

I tried pulling this patch down (gh pr checkout 105). Now when I run ./autogen.sh, I get this error:

checking for NAUTILUS... yes
checking for GLIB... yes
checking for GTK... no
configure: error: Package requirements (gtk4 >= 4.6.0) were not met:

Package 'gtk4', required by 'virtual:world', not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GTK_CFLAGS
and GTK_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
coreyberla commented 2 years ago

Package 'gtk4', required by 'virtual:world', not found

You need to have gtk4 installed

cbmeeks commented 2 years ago
➜  sudo dnf list installed | grep gtk4
colord-gtk4.x86_64                                   0.3.0-2.fc37                        @anaconda        
gtk4.x86_64                                          4.8.2-2.fc37                        @anaconda        
ibus-gtk4.x86_64                                     1.5.27-4.fc37                       @updates         
javascriptcoregtk4.1.x86_64                          2.38.2-1.fc37                       @anaconda        
libnma-gtk4.x86_64                                   1.10.2-1.fc37                       @anaconda        
libportal-gtk4.x86_64                                0.6-3.fc37                          @anaconda        
libreoffice-gtk4.x86_64                              1:7.4.3.2-1.fc37                    @updates         
webkit2gtk4.1.x86_64                                 2.38.2-1.fc37                       @anaconda        

I think it is installed. However, I think I got it to work. By using this hack: https://github.com/dropbox/nautilus-dropbox/pull/105#issuecomment-1321215164

coreyberla commented 2 years ago

You had gtk4 installed but not the headers. The comment you linked installs the headers (gtk4-devel), so that's why it fixed it.

cbmeeks commented 2 years ago

Ah, I see. Hopefully, Dropbox will get on this soon and provide some better support for Fedora users. Thanks for your help.

cbmeeks commented 1 year ago

Back to not working now. It finally pulled down all files and said it was "up to date". I moved a few files around and it went into "syncing" last night and has been there ever since.

cbmeeks commented 1 year ago

One thing I am curious about, I always move my Dropbox folder out of the home drive onto another hard drive. This has always worked in the past but I am wondering if there could be issues with that long term.

cbmeeks commented 1 year ago

OK...sorry for all of the updates. So I deleted everything again. This time, I got the gtk4-devel headers installed. I was then able to build/make this branch.

As a test, I pulled down a few files. Then, I moved the Dropbox location to another hard drive.
Next, I created a folder on my Linux machine and saw it immediately on my iPhone Dropbox client. I then created a folder on the iPhone and saw it immediately on my Linux machine.

I then moved some files over on my Linux machine and saw them get moved over on my iPhone.

So looking good so far.

But I have over 1 million files (~1.5TiB of data) that I keep synced. I'm slowly pulling down files now to Linux. Hopefully, this one will finally work for good!

belegdol commented 1 year ago

On Fedora 37 there is an unknown icon showing for folders containing images: Bildschirmfoto vom 2022-11-15 19-22-02

This is because the dropbox backend is sending a bad emblem name to nautilus-dropbox. Here's a workaround, it's ugly, so I don't really want to include it in this PR

diff --git a/src/nautilus-dropbox.c b/src/nautilus-dropbox.c
index b9c10b4..e1a1d0f 100644
--- a/src/nautilus-dropbox.c
+++ b/src/nautilus-dropbox.c
@@ -361,7 +361,12 @@ nautilus_dropbox_finish_file_info_command(DropboxFileInfoCommandResponse *dficr)
       int i;
       for ( i = 0; status[i] != NULL; i++) {
          if (status[i][0])
-           nautilus_file_info_add_emblem(dficr->dfic->file, status[i]);
+         {
+           gchar *emblem = status[i];
+           if (g_strcmp0(emblem, "people") == 0)
+             emblem = "shared";
+           nautilus_file_info_add_emblem(dficr->dfic->file, emblem);
+         }
       }
       result = NAUTILUS_OPERATION_COMPLETE;
     }

I can confirm this hack works: Bildschirmfoto vom 2022-11-22 17-17-47

cbmeeks commented 1 year ago

Well, guess what. No longer works again. Dropbox is no help at all.

Is there another alternative to Dropbox?

esclapes commented 1 year ago

Hey @goffrie and @wilbeibi, it seems like you two have been active in this repo.

Would you be up for having a quick look at this PR? The linux dropbox installer is failing for the newer versions of Gnome.

Thanks

goffrie commented 1 year ago

Hi folks, sorry about the delay here. Thanks for the PR, it looks good. We'll try to get a new release out soon!

goffrie commented 1 year ago

On Fedora 37 there is an unknown icon showing for folders containing images: Bildschirmfoto vom 2022-11-15 19-22-02

This is because the dropbox backend is sending a bad emblem name to nautilus-dropbox. Here's a workaround, it's ugly, so I don't really want to include it in this PR

diff --git a/src/nautilus-dropbox.c b/src/nautilus-dropbox.c
index b9c10b4..e1a1d0f 100644
--- a/src/nautilus-dropbox.c
+++ b/src/nautilus-dropbox.c
@@ -361,7 +361,12 @@ nautilus_dropbox_finish_file_info_command(DropboxFileInfoCommandResponse *dficr)
       int i;
       for ( i = 0; status[i] != NULL; i++) {
          if (status[i][0])
-           nautilus_file_info_add_emblem(dficr->dfic->file, status[i]);
+         {
+           gchar *emblem = status[i];
+           if (g_strcmp0(emblem, "people") == 0)
+             emblem = "shared";
+           nautilus_file_info_add_emblem(dficr->dfic->file, emblem);
+         }
       }
       result = NAUTILUS_OPERATION_COMPLETE;
     }

Thanks for pointing this out. I'll get a fix for this into the next release of the client.

cbmeeks commented 1 year ago

For somebody arriving to this page and just want to get dropbox command to work on Fedora 37, you can start the terminal and run: git clone https://github.com/coreyberla/nautilus-dropbox.git cd nautilus-dropbox git checkout libnautilus-extension-4 docker run -v $PWD:/d -w /d -it --rm fedora:37 /bin/bash

and inside the docker container run: dnf install -y gnome-common nautilus-devel python3-docutils python3-gobject gtk4-devel ./autogen.sh && make && make install

now, from another terminal window, copy dropbox "binary" (actually a Python file) to /usr/bin/ e.g. sudo install -m 755 -g root -o root dropbox /usr/bin/dropbox

This has stopped working.

[root@9dd4c486ccf0 d]# ./autogen.sh && make && make install
./autogen.sh: line 16: which: command not found
You need to install gnome-common

Any idea how to get past this?

Thanks

juurakki commented 1 year ago

dnf install -y gnome-common nautilus-devel python3-docutils python3-gobject gtk4-devel ./autogen.sh

autogen.sh does not seem to test whether "which" command or it's package exists. Fix is as easy as adding package "which" to the dnf installation: install -y gnome-common nautilus-devel python3-docutils python3-gobject gtk4-devel which

sschuberth commented 1 year ago

Fix is as easy as adding package "which" to the dnf installation:

Or maybe use the anyway more portable command -v?

goffrie commented 1 year ago

Or maybe use the anyway more portable command -v?

Good suggestion, I did that.

Arcitec commented 1 year ago

@goffrie @coreyberla Huge thanks for bringing Dropbox to GTK4 Nautilus! :)

To my surprise, there's an alternative implementation of GTK4 support here:

https://build.opensuse.org/package/show/openSUSE:Factory/nautilus-dropbox

This patch:

https://build.opensuse.org/package/view_file/openSUSE:Factory/nautilus-dropbox/105.patch?expand=1

Perhaps it would be good to skim through it, corey, to see if there's anything else in there that wasn't covered by your pull request? It's a very short patch file. In fact I am guessing it's a very basic solution and probably doesn't contain anything of value, but I bring it up just in case.

coreyberla commented 1 year ago

@goffrie @coreyberla Huge thanks for bringing Dropbox to GTK4 Nautilus! :)

To my surprise, there's an alternative implementation of GTK4 support here:

https://build.opensuse.org/package/show/openSUSE:Factory/nautilus-dropbox

This patch:

https://build.opensuse.org/package/view_file/openSUSE:Factory/nautilus-dropbox/105.patch?expand=1

Perhaps it would be good to skim through it, corey, to see if there's anything else in there that wasn't covered by your pull request? It's a very short patch file. In fact I am guessing it's a very basic solution and probably doesn't contain anything of value, but I bring it up just in case.

That looks like a diff of my pull request. More PRs were merged, so ultimately they'll want to use main, or a tagged version if a maintainer can do that.

Arcitec commented 1 year ago

@coreyberla

That looks like a diff of my pull request. More PRs were merged, so ultimately they'll want to use main, or a tagged version if a maintainer can do that.

Oh, I didn't think about checking the author name of the patch. It's you. Doh! :) I thought someone else had written that one.

BlueRidgeDog commented 1 year ago

Looks like the installer on the DB website has merged the above patch.

kparal commented 1 year ago

Looks like the installer on the DB website has merged the above patch.

I installed the official RPM package for Fedora 37 (that's my OS) and I have nautilus integration in the right click menu, but I see no overlay icons over synced files (the green check marks, etc). I logged out and back again. So it seems their included fix is just partial and not the whole patch present here 🫤

belegdol commented 1 year ago

https://gitlab.gnome.org/GNOME/nautilus/-/issues/2789