jun7 / wyeb

a vim-like webkit2gtk web browser
GNU General Public License v3.0
105 stars 6 forks source link

configurable download directory #5

Closed Foxbud closed 6 years ago

Foxbud commented 6 years ago

As of d2e8058bb7ca89e87d54fa0370e954c30e3220a3, it does appear possible to configure the download directory,

main.c:341-345

static const gchar *dldir()
{
    return g_get_user_special_dir(G_USER_DIRECTORY_DOWNLOAD) ?:
        g_get_home_dir();
}

I believe that 'G_USER_DIRECTORY_DOWNLOAD' is managed by XDG. The trouble, however, is that I have to make things difficult for myself, so I don't use a desktop environment that manages XDG for me.

Now, it is possible to manually configure the user download directory using either "extra/xdg-user-dirs" or "extra/xdg-user-dirs-gtk", but allowing users to configure a custom download directory (if they wish) in main.conf would be nice for those who don't use XDG and don't want all downloads going to $HOME/.

jun7 commented 6 years ago

I've just made echo XDG_DOWNLOAD_DIR=$HOME/Downloads > ~/.config/user-dirs.dirs and it works. Does it not works?

Since .config is XDG specific dir, so I think 'wyeb depends on XDG' is simple way. If we can change dl dir by the 'set;' of the conf, I will add it but downloading event doesn't relate windows. So I haven't reason to add it to the conf currently.

jun7 commented 6 years ago

Ah, sorry download event relates window, so I will add it to the 'set;'.

Foxbud commented 6 years ago

Awesome! Setting the new "dlsubdir" configuration variable works perfectly. Thank you! (Sorry for the late response.)

jun7 commented 6 years ago

Thank you for reporting!