(I'm on Arch Linux, using i3 as my wm and xterm as my terminal emulator, though I don't know if any of that is relevant.)Occasionally, a website asks me to drag a file with my mouse from my desktop into the internet browser's window. Almost always, there is an alternative, but recently I found something I want to do that requires the drag and drop. Unfortunately, I don't have a file manager. I navigate my computer's file system solely through bash.Is there a way I can fake the drag and drop action? Can I tell my browser I just dropped this file onto you without actually doing it?Worst case scenario, I can download a graphical file manager exclusively to drop files into my web browser, but I'd like to avoid that solution.
Can I drag a file into a window without a file manager?
x11;file manager;drag and drop
Thanks to @derobert for recommending the Dragbox application to me.Dragbox does exactly what I need. For example, I have a folder with a number of .png files that I would like to be able to drag into Chromium. Inside that folder, executing dragbox *.png creates this window:I can use my mouse to drag files from there into Chromium, and it works flawlessly. However, getting to this point was a pain. As far as I am aware, Dragbox only officially supports Debian systems. I couldn't find it anywhere that natively worked for Arch. So, I've written a step-by-step guide to getting Dragbox working in Arch Linux. This is almost exactly what I did on my machine, with a couple modifications to follow better practices. If there's an error somewhere, you can look in this answer's edit history to see exactly what I did on my machine.Clone Dragbox's source to your computer by executing git clone https://github.com/engla/dragbox.gitThere will be a new directory called dragbox created inside your current working directory. Go inside.Dragbox and Dragbox's installation require Python 2, which comes standard on Arch Linux. However, it expects Python 2 to be the default Python installation, which isn't true on Arch. Get around this by executing export PYTHON=/bin/python2. Until you close your current terminal window, the environment variable $PYTHON will have the value /bin/python2. Dragbox's installation scripts check for that, and will use it over Python 3.Execute ./autogen.sh, ./configure, make and make install. make install must be done with root privileges (e.g. sudo make install).Dragbox is now installed on your computer, but is going to try to use Python 3 to run. With root privileges, open /usr/local/bin/dragbox in a text editor. Modify the shebang (the first line, that tells your shell what executable to run the script with) from #!/usr/bin/env python to #!/usr/bin/env python2.The script is now working, but it can't find the module containing the actual program. There are a couple of ways you can fix this.Include in your ~/.bashrc or similar a line reading export PYTHONPATH=$PYTHONPATH: immediately (as in, not even a space between) followed my the path to a directory. Python will now look in that directory when trying to import modules. Inside the directory created back in step 1, there will be a directory called Dropbox/ (with a capital D). Copy that directory to the directory you added to your $PYTHONPATH (e.g. if you wrote export PYTHONPATH=$PYTHONPATH:~/python/modules, copy the Dragbox/ directory to create ~/python/modules/Dragbox/).Probably worse practice, but you can copy that same directory to a directory already in your $PYTHONPATH. For example, you could copy it to create /usr/lib/python2.7/site-packages/.If you've followed these steps, Dragbox should be working! You can now execute man dragbox to learn more about how to use it, and launch it by simply typing dragbox.