add trash-empty
This commit is contained in:
parent
45d4b73be3
commit
7bc526012d
4 changed files with 24 additions and 9 deletions
18
.config/fish/functions/trash-empty.fish
Normal file
18
.config/fish/functions/trash-empty.fish
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
function trash --description "Empty the windows recycle bin."
|
||||||
|
# Get function name
|
||||||
|
set current_name $(status current-function)
|
||||||
|
|
||||||
|
# Check if no arguments were provided
|
||||||
|
if test -z $argv[1]
|
||||||
|
echo -e "Usage: $current_name"
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
|
# Empty trash
|
||||||
|
powershell.exe -Command "" \
|
||||||
|
"\$bin = (New-Object -ComObject Shell.Application).NameSpace(10);" \
|
||||||
|
"\$bin.items() | ForEach {" \
|
||||||
|
" Write-Host 'Deleting:' \$_.Name;" \
|
||||||
|
" Remove-Item \$_.Path -Recurse -Force;" \
|
||||||
|
"}"
|
||||||
|
end
|
|
@ -36,12 +36,4 @@ function trash --description "Move file or directory to the windows recycle bin.
|
||||||
|
|
||||||
# Delete the WSL path
|
# Delete the WSL path
|
||||||
rm -r "$element";
|
rm -r "$element";
|
||||||
|
|
||||||
# Empty trash (move to another function!)
|
|
||||||
# powershell.exe -Command "" \
|
|
||||||
# "\$bin = (New-Object -ComObject Shell.Application).NameSpace(10);" \
|
|
||||||
# "\$bin.items() | ForEach {" \
|
|
||||||
# " Write-Host 'Deleting:' \$_.Name;" \
|
|
||||||
# " Remove-Item \$_.Path -Recurse -Force;" \
|
|
||||||
# "}"
|
|
||||||
end
|
end
|
||||||
|
|
1
Makefile
1
Makefile
|
@ -179,6 +179,7 @@ sync-wsl:
|
||||||
@$(CURL) $(REPO_SRC)/.config/fish/conf.d/abbr_wsl.fish >> $(HOME)/.config/fish/conf.d/abbr.fish
|
@$(CURL) $(REPO_SRC)/.config/fish/conf.d/abbr_wsl.fish >> $(HOME)/.config/fish/conf.d/abbr.fish
|
||||||
@$(CURL) $(REPO_SRC)/.config/fish/conf.d/alias_wsl.fish >> $(HOME)/.config/fish/conf.d/alias.fish
|
@$(CURL) $(REPO_SRC)/.config/fish/conf.d/alias_wsl.fish >> $(HOME)/.config/fish/conf.d/alias.fish
|
||||||
@$(WGET) $(REPO_SRC)/.config/fish/functions/trash.fish -O $(HOME)/.config/fish/functions/trash.fish
|
@$(WGET) $(REPO_SRC)/.config/fish/functions/trash.fish -O $(HOME)/.config/fish/functions/trash.fish
|
||||||
|
@$(WGET) $(REPO_SRC)/.config/fish/functions/trash-empty.fish -O $(HOME)/.config/fish/functions/trash-empty.fish
|
||||||
@echo "Fish specific settings synced!"
|
@echo "Fish specific settings synced!"
|
||||||
@echo
|
@echo
|
||||||
|
|
||||||
|
|
6
wsl.sh
6
wsl.sh
|
@ -83,7 +83,11 @@ function main {
|
||||||
curl -s ${repo}/.config/fish/conf.d/abbr_wsl.fish >> "$HOME"/.config/fish/conf.d/abbr.fish
|
curl -s ${repo}/.config/fish/conf.d/abbr_wsl.fish >> "$HOME"/.config/fish/conf.d/abbr.fish
|
||||||
curl -s ${repo}/.config/fish/conf.d/alias_wsl.fish >> "$HOME"/.config/fish/conf.d/alias.fish
|
curl -s ${repo}/.config/fish/conf.d/alias_wsl.fish >> "$HOME"/.config/fish/conf.d/alias.fish
|
||||||
# Specific WSL functions
|
# Specific WSL functions
|
||||||
wget -q "${repo}"/.config/fish/functions/trash.fish -O "$HOME"/.config/fish/functions/trash.fish
|
functions=("trash" "trash-empty")
|
||||||
|
for function in "${functions[@]}"
|
||||||
|
do
|
||||||
|
wget -q "${repo}"/.config/fish/functions/"${function}".fish -O "$HOME"/.config/fish/functions/"${function}".fish
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
# === OCaml ==
|
# === OCaml ==
|
||||||
|
|
Loading…
Reference in a new issue