From 6cfab4b9d51f5647ce3a4ccff4c1bc0abeeb85a0 Mon Sep 17 00:00:00 2001 From: hayao Date: Sun, 27 Dec 2020 10:45:54 +0900 Subject: [PATCH] [update] : Use dirname for label --- .../alterlinux-gtk-bookmarks | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/alterlinux-gtk-bookmarks/alterlinux-gtk-bookmarks b/alterlinux-gtk-bookmarks/alterlinux-gtk-bookmarks index 24b7418..1fbddc9 100755 --- a/alterlinux-gtk-bookmarks/alterlinux-gtk-bookmarks +++ b/alterlinux-gtk-bookmarks/alterlinux-gtk-bookmarks @@ -85,11 +85,18 @@ init() { source "${HOME}/.config/user-dirs.dirs" - output "file://${XDG_DOCUMENTS_DIR} Documents" - output "file://${XDG_DOWNLOAD_DIR} Downloads" - output "file://${XDG_MUSIC_DIR} Music" - output "file://${XDG_PICTURES_DIR} Pictures" - output "file://${XDG_VIDEOS_DIR} Videos" + init_dirs=( + "${XDG_DOCUMENTS_DIR}" + "${XDG_DOWNLOAD_DIR}" + "${XDG_MUSIC_DIR}" + "${XDG_PICTURES_DIR}" + "${XDG_VIDEOS_DIR}" + ) + + local dir + for dir in "${init_dirs[@]}"; do + output "file://${dir} $(basename "${dir}")" + done }