update bookmarks

This commit is contained in:
TomasM
2019-01-29 13:31:36 +00:00
parent 81f424db2f
commit 05df6761f5
2 changed files with 20 additions and 9 deletions
+4 -5
View File
@@ -13,7 +13,6 @@
# $SUBSYSTEM (eg: block)
PATH=$PATH:/usr/bin:/usr/sbin:/bin:/sbin
BOOKMARKS="/root/.gtk-bookmarks"
BAS="$(basename "$DEVNAME")"
UNIT="media-$BAS.mount"
@@ -54,7 +53,7 @@ if [ "$ACTION" = "add" -o "$ACTION" = "change" ]; then
systemctl enable $UNIT
systemctl start $UNIT
echo "file://$MNT" "$BAS" >>$BOOKMARKS
gtk-bookmarks-update
DISPLAY=:0.0 pcmanfm file://$MNT >/dev/null 2>&1
fi
fi
@@ -62,7 +61,7 @@ fi
if [ "$ACTION" = "remove" ]; then
systemctl disable $UNIT
rm $TARGET
sed -i -r "\\;^file://$MNT;d" $BOOKMARKS
rm "$TARGET"
rmdir "$MNT"
gtk-bookmarks-update
fi