dash-to-dock icon indicating copy to clipboard operation
dash-to-dock copied to clipboard

Downloads folder on the favorite bar

Open chetanpm opened this issue 8 years ago • 9 comments
trafficstars

Following up from #173, Downloads folder in the dock would be very usefull and a much needed addtion atleast for peole like me who use it a lot in macOS folder stacks.

I hope the feature makes it to the extension.

chetanpm avatar Dec 11 '16 06:12 chetanpm

would love to see this! me too I'm using OS X at work and are used to folders on the dock (and displaying a list of files on click). please implement if possible

corebots avatar Jan 11 '17 14:01 corebots

The list of files on click may be too much, but being capable of adding folders to the Dock would be awesome already :)

vitor251093 avatar Nov 02 '17 16:11 vitor251093

I'd like this as well.

Natetronn avatar Feb 17 '19 00:02 Natetronn

Would also find this very useful.

RyanBeckett avatar May 07 '20 12:05 RyanBeckett

I wonder if the Recent Items extension could be used as a starting point?

Recent Items (github.com)

It's half-way there, although it's missing the most useful part of the Mac / Plasma versions IMO - the ability to drag and drop from the list. It's really useful to be able to simply drag a new screenshot from a popup on the dock into a web page or chat without opening a file browser window.

It's also missing an icon view with previews, which would also make it more useful.

arkonbob avatar Oct 11 '21 23:10 arkonbob

Optimally, it would also support drag and drop. So I could open the folder view and then drag files from their to upload them for example.

dploeger avatar Dec 17 '24 17:12 dploeger

Just in case someone else wants to add a folder to their Dock, I've made a workaround. It has been tested on Debian and Ubuntu about a year ago. It has been over a year since I created it, so I probably used multiple places as the reference to create this, but I can't really remember.

2024-12-17_14-58

First, create a file called new-dock-entry, with the block below as its content:

#!/bin/bash

folderpath="$1"

uuid="$(uuidgen)"
name="$(basename $folderpath)"
icon="$(gio info $folderpath -a standard::icon | tail -1 | sed 's/.*: \(.*\)/\1/' | sed 's/\([^,]*\),.*/\1/')"
destfile="$HOME/.local/share/applications/dock.folder.$name.$uuid.desktop"
desktopfilename="$(basename $destfile)"

mkdir -p $HOME/.local/share/applications/
touch $destfile
echo "[Desktop Entry]" > "$destfile"
echo "Name=$name" >> "$destfile"
echo "Comment=Access $name folder" >> "$destfile"
echo "Keywords=folder;manager;explore;disk;filesystem;" >> "$destfile"
echo "Exec=nautilus $folderpath" >> "$destfile"
echo "Icon=$icon" >> "$destfile"
echo "Terminal=false" >> "$destfile"
echo "Type=Application" >> "$destfile"
# Works in Ubuntu, but not in Debian; that's supposed to hide the app from the apps list
#echo "OnlyShowIn=" >> "$destfile";
chmod a+x $destfile

favourites="$(dconf read /org/gnome/shell/favorite-apps)"
if [ ${#favourites} -ge 2 ]; then
    favourites="${favourites::-1}, "
else 
    favourites="["
fi
favourites="$favourites'$desktopfilename']"
dconf write /org/gnome/shell/favorite-apps "$favourites"

Then use those two commands to make it runnable and available on the shell:

chmod +x new-dock-entry
sudo cp new-dock-entry /usr/local/bin/

And, at last, this is how you use it to add Downloads to your Dock:

new-dock-entry $HOME/Downloads

As a side effect, it will also add a "Downloads" app to your applications list (there are multiple ways to hide it from there though).

The icon on Dash-to-Dock will respect your system theme. This script was made to open the folder with Nautilus, but if you use something else, like Nemo, you can just update the Exec line from the new-dock-entry script.

If you want to remove the Downloads "application" for good, just remove it from your Dock and run:

rm $HOME/.local/share/applications/dock.folder.Downloads.*.desktop

And, to uninstall new-dock-entry, just run:

sudo rm /usr/local/bin/new-dock-entry

This is not a replacement for a drag and drop feature, which I would prefer, but it's a good enough workaround for me, since I don't change the folders on my Dock frequently.

vitor251093 avatar Dec 17 '24 18:12 vitor251093

@vitor251093 thanks! I will try that. It's not optimal because it would be better if it just would open a list instead of the file manager but it's a good step in the right direction. ♥️

dploeger avatar Dec 17 '24 18:12 dploeger

Works like a charm. Thanks!

dploeger avatar Dec 17 '24 18:12 dploeger