diff --git a/README.md b/README.md index 0438584..07d9dce 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ AHK_X11 can be used completely without a terminal. You can however if you want u
CLICK TO SEE WHICH COMMANDS ARE IMPLEMENTED AND WHICH ARE MISSING. Note however that this is not very representative. For example, no `Gui` sub command is included in the listing. For a better overview on what is already done, skim through the FULL DOCUMENTATION HERE. ```diff -DONE ?% (121/220): +DONE ?% (122/220): + Else, { ... }, Break, Continue, Return, Exit, GoSub, GoTo, IfEqual, Loop, SetEnv, Sleep, FileCopy, + SetTimer, WinActivate, MsgBox, Gui, SendRaw, #Persistent, ExitApp, + EnvAdd, EnvSub, EnvMult, EnvDiv, ControlSendRaw, IfWinExist/IfWinNotExist, SetWorkingDir, @@ -72,7 +72,7 @@ DONE ?% (121/220): + PixelSearch, #Include, InputBox, ClipWait, EnvSet, SetKeyDelay, SetMouseDelay, MouseClickDrag, + #NoTrayIcon, TrayTip, Random, Shutdown, RunAs, SoundGet, SoundSet, SoundPlay, Sort, + StringTrimLeft, StringTrimRight, WinMinimizeAll, WinMinimizeAllUndo, WinSetTitle, WinWait, -+ WinWaitClose, WinWaitActive, WinWaitNotActive, DriveSpaceFree, FileGetSize ++ WinWaitClose, WinWaitActive, WinWaitNotActive, DriveSpaceFree, FileGetSize, FileRecycle NEW ?% (9/220): (not part of spec or from a more recent version) @@ Echo, ahk_x11_print_vars, FileRead, RegExGetPos, RegExReplace, EnvGet, Click @@ @@ -87,13 +87,13 @@ REMOVED ?% (11/220): # AutoTrim: It's always Off. It would not differentiate between %a_space% and %some_var%. # It's possible but needs significant work. -TO DO ?% (75/220): alphabetically +TO DO ?% (74/220): alphabetically - BlockInput, Control, ControlFocus, ControlGet, ControlGetFocus, - ControlMove, - DetectHiddenText, DetectHiddenWindows, Drive, DriveGet, - FileCopyDir, FileCreateShortcut, - FileInstall, FileGetAttrib, FileGetShortcut, FileGetTime, FileGetVersion, -- FileMove, FileMoveDir, FileRecycle, FileRecycleEmpty, FileRemoveDir, +- FileMove, FileMoveDir, FileRecycleEmpty, FileRemoveDir, - FormatTime, GroupActivate, GroupAdd, - GroupClose, GroupDeactivate, GuiControlGet, - If var is [not] type, diff --git a/docs/index.html b/docs/index.html index a6e19a9..012d621 100644 --- a/docs/index.html +++ b/docs/index.html @@ -141,7 +141,7 @@

Table of contents

FileRead
  • - FileRecycle + FileRecycle
  • FileRecycleEmpty @@ -1051,7 +1051,7 @@

    Tutorial Contents

  • FileCopy: Copy one or more files. Use FileCopyDir to copy an entire folder.
  • FileMove: Move or rename one or more files. Use FileMoveDir to move an entire folder.
  • FileDelete: Delete one or more files. Use FileRemoveDir to delete an entire folder.
  • -
  • FileRecycle: Send one or more files (or an entire folder) to the recycle bin.
  • +
  • FileRecycle: Send one or more files (or an entire folder) to the recycle bin.
  • FileSelectFile and FileSelectFolder: Display a dialog for the user to pick a file or folder.
  • FileSetAttrib and FileSetTime: Change the attributes or timestamp of one or more files.
  • IniRead, IniWrite, and IniDelete: Create, access, and maintain standard-format INI files.
  • @@ -2223,7 +2223,7 @@

    The "Last Found" Window

    Moves a directory and all sub-directories and files. It can also rename a directory. - FileRecycle + FileRecycle Sends a file or directory to the recycle bin, if possible. @@ -4006,9 +4006,9 @@

    The "Last Found" Window

    -
    +
    - #

    FileRecycle

    [v1.0.09+] + #

    FileRecycle


    Sends a file or directory to the recycle bin, if possible.

    @@ -4025,7 +4025,7 @@

    The "Last Found" Window

    @@ -4043,7 +4043,7 @@

    The "Last Found" Window

     

    Example

    -

    FileRecycle, C:\temp files\*.tmp
    +

    FileRecycle, %A_Home%/temp files/*.tmp

    diff --git a/src/cmd/file/file-recycle.cr b/src/cmd/file/file-recycle.cr new file mode 100644 index 0000000..38f88e1 --- /dev/null +++ b/src/cmd/file/file-recycle.cr @@ -0,0 +1,16 @@ +# FileRecycle, FilePattern +class Cmd::File::FileRecycle < Cmd::Base + def self.min_args; 1 end + def self.max_args; 1 end + def self.sets_error_level; true end + def run(thread, args) + begin + Dir.glob(args[0]).each do |src| + Process.new("gio", ["trash", src]) + end + "0" + rescue + "1" + end + end +end \ No newline at end of file
    FilePattern -

    The name of a single file or a wildcard pattern such as C:\Temp\*.tmp. FilePattern is assumed to be in %A_WorkingDir% if an absolute path isn't specified.

    +

    The name of a single file or a wildcard pattern such as /tmp/*.tmp. FilePattern is assumed to be in %A_WorkingDir% if an absolute path isn't specified.

    To recycle an entire directory, provide its name without a trailing backslash.