Add Trash support on VFAT and NTFS filesystem.

New features which should be implemented in Porteus; suggestions are welcome. All questions or problems with testing releases (alpha, beta, or rc) should go in their relevant thread here, rather than the Bug Reports section.
Post Reply
User avatar
babam
Black ninja
Black ninja
Posts: 83
Joined: 16 Nov 2016, 10:30
Distribution: Porteus Xfce 3.2.2
Location: Rainy city

Add Trash support on VFAT and NTFS filesystem.

Post#1 by babam » 23 Mar 2020, 15:52

Add Trash support on VFAT and NTFS filesystem.

Code: Select all

 --- old/finit
+++ new/finit
@@ -51,11 +51,11 @@
 EOF
 for x in $dev; do
     fs=`grep -w /dev/$x /tmp/devices | egrep -o ' TYPE=[^ ]+' | cut -d'"' -f2`
-    [ $fs = vfat ] && echo "/dev/$x /mnt/$x vfat $MOPT,umask=0,check=s,utf8 0 0" >>/etc/fstab || echo "/dev/$x /mnt/$x $fs $MOPT 0 0" >>/etc/fstab
+    [ $fs = vfat ] && echo "/dev/$x /mnt/$x vfat $MOPT,umask=0,check=s,utf8,uid=1000 0 0" >>/etc/fstab || echo "/dev/$x /mnt/$x $fs $MOPT 0 0" >>/etc/fstab
     if [ ! -d /mnt/$x ]; then
 	mkdir /mnt/$x
 	if [ $fs = ntfs ]; then
-	    ntfs-3g /dev/$x /mnt/$x -o $MOPT 2>/dev/null || { sed -i "/$x /d" /etc/fstab; rmdir /mnt/$x; }
+	    ntfs-3g /dev/$x /mnt/$x -o $MOPT,uid=1000,big_writes 2>/dev/null || { sed -i "/$x /d" /etc/fstab; rmdir /mnt/$x; }
 	else
 	    mount -n /mnt/$x 2>/dev/null || { modprobe $fs 2>/dev/null && mount -n /mnt/$x 2>/dev/null || { sed -i "/$x /d" /etc/fstab; rmdir /mnt/$x; }; }
 	fi
@@ -73,9 +73,9 @@
 if [ "$fs" ]; then
     mkdir /mnt/$1
     if [ $fs = vfat ]; then
-	mount -n /dev/$1 /mnt/$1 -o $MOPT,umask=0,check=s,utf8 2>/dev/null || rmdir /mnt/$1
+	mount -n /dev/$1 /mnt/$1 -o $MOPT,umask=0,check=s,utf8,uid=1000 2>/dev/null || rmdir /mnt/$1
     elif [ $fs = ntfs ]; then
-	ntfs-3g /dev/$1 /mnt/$1 -o $MOPT 2>/dev/null || rmdir /mnt/$1
+	ntfs-3g /dev/$1 /mnt/$1 -o $MOPT,uid=1000,big_writes 2>/dev/null || rmdir /mnt/$1
     else
 	mount -n /dev/$1 /mnt/$1 -o $MOPT 2>/dev/null || { modprobe $fs 2>/dev/null && mount -n /dev/$1 /mnt/$1 -o $MOPT || rmdir /mnt/$1; }
     fi

Code: Select all

$ gio trash /path/to/fileordirectory
Sorry, my English is bad.

Post Reply