andreafrancia / trash-cli

Command line interface to the freedesktop.org trashcan.
GNU General Public License v2.0
3.63k stars 177 forks source link

trash-cli unable to restore trashed file with sudo #144

Open faridcher opened 5 years ago

faridcher commented 5 years ago

a reproducible example of the problem:

╰ sudo trash-empty                                                          
╰ sudo trash-list                                                           
╰ sudo cp /usr/share/X11/xorg.conf.d/70-synaptics.conf /etc/X11/xorg.conf.d/
╰ sudo trash /etc/X11/xorg.conf.d/70-synaptics.conf                         
╰ sudo trash-restore                                                        
No files trashed from current dir ('/home/farid')                            
╰ sudo trash-list                                                           
2019-05-08 21:42:41 /etc/X11/xorg.conf.d/70-synaptics.conf                   

thanks

jxu commented 4 years ago

same problem with trash-rm. the program crashes with python.

You can get around this by calling the script directly. Try which trash-restore and use sudo with the full executable path.