You are not logged in.

#1 2008-03-16 15:35:21

md5fungi
Member
Registered: 2008-03-08
Posts: 14

KDE Trash mechanism and how to make alias

I want to make an alias so I can type in "delete" or "trash" and be able to mv files into the KDE trash (~/.local/share/Trash).

The problem is, I'm not even sure how KDE really "trashes" things, because when I move a file into ~/.local/share/Trash or ~/.local/share/Trash/files it can't actually be viewed by the GUI, almost like it was never trashed.

The only way I have been able to trash things thus far is via GUI, and it would be really helpful to be able to do this command line as well, and have all my trash organized in one location.

Any suggestions?

Offline

#2 2008-03-16 16:00:02

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 960
Website

Re: KDE Trash mechanism and how to make alias

When you choose "move to wastebin", KDE creates an info file with the same name. I don't know how one would get the Trash to show files that the GUI didn't explicitly tell it that it was there. Anyway if you just want a wrapper:

#!/bin/bash <or function>

DATE=`date +%d-%m-%y`

if [ ! -d ${HOME}/.trash/$DATE ]; then
  mkdir -p ${HOME}/.trash/$DATE
fi

for i in $@; do
  mv $i ${HOME}/.trash/$DATE
done

Last edited by schivmeister (2008-03-16 16:00:55)


I need real, proper pen and paper for this.

Offline

Board footer

Powered by FluxBB