Results 1 to 10 of 26

Thread: trash can for gnome dash/dash to dock

Threaded View

  1. #1
    Join Date
    Jul 2006
    Location
    Here
    Beans
    11,187

    trash can for gnome dash/dash to dock

    alright peoples final script. should be user neutral just place in $HOME/Documents & make executable.

    Code:
    #!/bin/bash
    icon=$HOME/.local/share/applications/trash.desktop
    
    while getopts "red" opt; do
    	case $opt in
        r)
    	if [ "$(gio list trash://)" ]; then
    		echo -e '[Desktop Entry]\nType=Application\nName=Trash\nComment=Trash\nIcon=user-trash-full\nExec=nautilus trash://\nCategories=Utility;\nActions=trash;\n\n[Desktop Action trash]\nName=Empty Trash\nExec='$HOME/Documents/trash.sh -e'\n' > $icon
    	fi
    	;;
        e)
    	gio trash --empty && echo -e '[Desktop Entry]\nType=Application\nName=Trash\nComment=Trash\nIcon=user-trash\nExec=nautilus trash://\nCategories=Utility;\nActions=trash;\n\n[Desktop Action trash]\nName=Empty Trash\nExec='$HOME/Documents/trash.sh -e'\n' > $icon
    	;;
        d)
    	while sleep 5; do ($HOME/Documents/trash.sh -r &) ; done
    	;;
      esac
    done
    once placed in Documents, open a terminal there, run-> trash.sh -e <- this will create trash.desktop in $HOME/.local/share/applications

    final piece, you need to add to autostart-> trash.sh -d

    example of my ~/.config/autostart/trash-icon.desktop:
    Code:
    [Desktop Entry]
    Type=Application
    Name=Trash Icon
    Icon=user-trash
    Exec=/home/user/Documents/trash.sh -d
    enjoy your new trash icon for dash/dash to dock.

    Screenshot from 2018-05-07 10-39-47.jpgScreenshot from 2018-05-07 10-38-49.jpgScreenshot from 2018-05-08 19-22-01.jpg

    Trash.zip
    Attached Files Attached Files
    Last edited by kerry_s; May 22nd, 2018 at 09:30 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •