How do I create a dynamic quicklist for the home folder?

How can i create a vibrant quicklist for the residence folder which includes all the book marks as quicklists (i heard it is feasible using libunity)?

6
2022-06-07 15:16:38
Source Share
Answers: 2

Here is a tiny covering manuscript that updates your Home - Quicklist with all your bookmarks. No guidebook adjustment. It reviews your book mark documents and also develops the food selection things from it. It additionally includes the "Root Filemanager" food selection access.

  1. Copy the manuscript listed here right into a vacant documents and also placed it in your manuscripts - folder (we will certainly think that is ~/bin/ and also the manuscript name you pick is unityhome.bash)
  2. Run the manuscript as soon as to add the access:

    bash ~/bin/unityhome.bash
    
  3. Optionally you might have cron run the manuscript for you every now and then. To add it to cron, type the follwing command right into a covering:

    crontab -e An editor will open. There add a line like:
    
    @reboot /bin/bash/ $HOME/bin/unityhome.bash > /dev/null 2>&1
    

    If you do not do this action, you'll need to run the manuscript by hand every single time you transform your nautilus bookmarks if you desire the quicklist upgraded.

  4. Adjustments just work on your next login or after you Alt+F2

    unity --replace So do that. *Note: Don't run `unity --replace`
    

    in an incurable. If you close that incurable, it will certainly eliminate unity with it. *

  5. Enjoy and also look at the similar script for gnome-terminal that analyzes your ssh bookmarks (in ~/.ssh/config).

Manuscript: - - - - - - - Here is the manuscript:

#!/bin/bash
# tabsize: 4, encoding: utf8
#
# © 2011 [email protected] Use permitted under MIT license:
#     http://www.opensource.org/licenses/mit-license.php
# 
# CONTRIBUTORS: Chris Druif <[email protected]>
#               Scott Severance <http://www.scottseverance.us/>
# 
# This script updates the unity quicklist menu for nautilus to

have the customer # bookmarks. The updates will certainly have efect after unity is reactivated (either on # the next login or by conjuring up 'unity - - change').

# location of template and unity bar launchers
nautempl="/usr/share/applications/nautilus-home.desktop"
target="$HOME/.local/share/applications/nautilus-home.desktop"
bookmarks="$HOME/.gtk-bookmarks"

# backup if file already exists
if [ -e "$target" ]; then
    echo "Creating backup of: $target."
    mv -n "$target" "$target.bak"
fi

# copy template
cp "$nautempl" "$target"

sed -i "s/\(OnlyShowIn=GNOME;\)/\1Unity;/" "$target"

echo "X-Ayatana-Desktop-Shortcuts=" >> $target

bmcount=0
while read bmline; do
    bmcount=$(($bmcount+1))     # number of current bookmark
    bmname=${bmline#*\ }        # name of the bookmark
    bmpath=${bmline%%\ *}       # path the bookmark leads to
    # deal with bookmarks that have no name
    if [ "$bmname" = "$bmpath" ]; then
        bmname=${bmpath##*/}
    fi
    # fix spaces in names and paths
    bmname="$(echo "$bmname" | sed 's/%20/ /g')"
    bmpath="$(echo "$bmpath" | sed 's/%20/ /g')"
    # extend shortcut list with current bookmark
    sed -i

"s/ (X - Ayatana - Desktop - Shortcuts =. *)/ bkslsh1Scg$ bmcount ;/ " "$ target" # write book mark details pet cat - >> "$ target" <

[Scg$bmcount Shortcut Group]
Name=$bmname
Exec=nautilus "$bmpath"
OnlyShowIn=Unity
EOF
done < "$bookmarks"

# Add a root file manager entry
sed -i "s/\(X-Ayatana-Desktop-Shortcuts=.*\)/\1RootFM;/" "$target"
cat - >> "$target" <<EOF

[RootFM Shortcut Group]
Name=Root
Exec=gksudo nautilus
OnlyShowIn=Unity
EOF

exit 0

Original Answer - Written by con-f-use

1
2022-06-10 12:13:51
Source

FYI The API is clarified on the Ubuntu Wiki

Dynamic Quicklist entries

Quicklists may also be created and appended to the launcher. To create a quicklist 
a root node must first be created as a container, and then child nodes are added
to it. This final result may be packed into the launcher which is then 
shipped over the bus to Unity. Updates to the quicklist are also live.
Rather than describe the entire API, an example of using quicklist (as well as 
progress and count) is provided below using the vala bindings.

It is important to note that the main loop must be invoked for the program to 
actual work. Libunity requires the usage of the main loop as work may be done 
async. 

I have actually not seen an instance of this yet. If I do I will certainly add it below within a hr ;)

Dynamic quicklists did NOT function before unity - 3.8.8 - 0ubuntu1 as a result of a bug.

2
2022-06-07 15:48:37
Source