Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-12-19 07:24:24

pavloskiv
Member
Registered: 2019-12-19
Posts: 27

xfce4-popup-places plugins

Good evening,
I have a question about xfce4-popup-places plugin: Is it possible to add a launcher configured as xfce4-popup-places in whiskermenu without adding this plugin to panel ?  I tested and it only works if the plugin is added to panel.
I have asked in Ubuntu forum if is it possible to add to whiskermenu right pane an item to display Recent Opened Files/Documents, but the answer was: Not possible, so I tried to add the Places plugin in whiskermenu as a launcher but t only works if the plugin is added to Panel.
OS: Xubuntu 16.04.6
Thanks, vladi

Offline

#2 2019-12-19 11:51:26

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: xfce4-popup-places plugins

Hello and welcome.

Unfortunately, the xfce4-places plugin needs to be running (added to the panel) for that command to work. There are 2 options available to you if you don't want the plugin visible on the panel:

  1. Create a second panel, add the plugin to that panel and then set the panel to "Always Hide". The plugin won't be visible but the command will still work.
    --

  2. Use the program zenity to create your own list of recently opened documents, create a desktop file for it and add it to the menu.. All of your recent documents are stored in the ~/.local/share/recently-used.xbel file. For this option, do the following:
    a. With root privileges, create the file /usr/local/bin/zrecent with the following content:

    #!/bin/bash
    
    RECENTS=$(cat ~/.local/share/recently-used.xbel | grep bookmark\ href | cut -d '"' -f2 | sed -e 's/file...//g')
    
    ANS=$(zenity --width 500 \
    	--height 500 \
    	--list \
    	--text="" \
    	--title="Recent Files List" \
    	--column="Select a file..." \
    	$RECENTS)
    						
    if [ -f $ANS ] || [ -d $ANS ]
    then
    	exo-open $ANS
    else
    	zenity --info --width 200 --text="File/Directory no longer exists"
    fi

    .
    b. Make the file executable:

    sudo chmod +x /usr/local/bin/zrecent

    .
    c. Create the ~/.local/share/applications/zrecent.desktop file with the following content:

    [Desktop Entry]
    Name=Recent Files
    Comment=Recently opened files
    GenericName=Recent files
    Exec=zrecent
    Icon=document-open-recent
    Terminal=false
    StartupNotify=true
    Type=Application
    Categories=Utility;GTK;

    The item will now show up in the Accessories section.
    Double-click the file/directory that you want to open and the script will use "exo-open" to open it with the default program.
    Note: this requires the zenity package to be installed.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2019-12-19 19:53:29

pavloskiv
Member
Registered: 2019-12-19
Posts: 27

Re: xfce4-popup-places plugins

@Toz thanks for quick and accurate reply. I'll try with zenity. That's a pity whiskermenu doesn't have it by default.

Offline

#4 2019-12-19 23:23:17

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 862

Re: xfce4-popup-places plugins

l like #1.  that can be a panel in general to run many things in the background that don't make sense for my own background system (everything runs under a shell).

Offline

#5 2020-08-04 14:07:44

Tabespe
Member
Registered: 2019-12-04
Posts: 129

Re: xfce4-popup-places plugins

Is there an alternative to 1. and 2. ?

As you can see here:
https://bugs.launchpad.net/ubuntu/+sour … ug/1472376
https://bugzilla.xfce.org/show_bug.cgi?id=12050

~/.local/share/recently-used.xbel does not work reliable.

Just open a featherpad file within thunar, then change anything in it. Save it.
You will not find it in ~/.local/share/recently-used.xbel now.

Just open a *.png within thunar. Close it. You will not find it in ~/.local/share/recently-used.xbel.

I had instaled this plug-in (variant 1). But it is unusable for me in this case.

So I am looking for an alternative.

Offline

#6 2020-10-21 20:33:08

Tabespe
Member
Registered: 2019-12-04
Posts: 129

Re: xfce4-popup-places plugins

ToZ wrote:
#!/bin/bash

RECENTS=$(cat ~/.local/share/recently-used.xbel | grep bookmark\ href | cut -d '"' -f2 | sed -e 's/file...//g')

ANS=$(zenity --width 500 \
	--height 500 \
	--list \
	--text="" \
	--title="Recent Files List" \
	--column="Select a file..." \
	$RECENTS)
						
if [ -f $ANS ] || [ -d $ANS ]
then
	exo-open $ANS
else
	zenity --info --width 200 --text="File/Directory no longer exists"
fi

Thank you, I would like to use this zenity script. But I can not, because it looks like this way the path text has the wrong format.

For example:

.../My Folder/...

looks like this and is not guilty:

.../My%20Folder/... 

------------------------------------

In addition:
It would be nice, if we could copy any selected file from this "zenity window" into the clipboard.

Last edited by Tabespe (2020-10-21 20:40:30)

Offline

#7 2020-10-21 23:13:31

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: xfce4-popup-places plugins

Tabespe wrote:

For example:

.../My Folder/...

looks like this and is not guilty:

.../My%20Folder/... 

Thats the way its presented in the xbel file. This script just reads and presents the name as it exists.

In addition:
It would be nice, if we could copy any selected file from this "zenity window" into the clipboard.

Zenity doesn't appear to support this.

The above script didn't work for me. Here is the updated version:

#!/bin/bash

RECENTS=$(cat ~/.local/share/recently-used.xbel | grep bookmark\ href | cut -d '"' -f2 | sed -e 's/file...//g')

ANS=$(zenity 	--width 500 \
				--height 500 \
				--list \
				--text="" \
				--title="Recent Files List" \
				--column="Select a file..." \
				$RECENTS)			
ANS="$(echo $ANS | sed -e 's/%20/ /g')"
					
if [ ! "$ANS" == "" ]; then
    if [ -f "$ANS" ]; then
    	exo-open "$ANS"
    else
	    zenity --info --width 200 --text="File no longer exists"
    fi			
fi

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#8 2020-10-22 12:30:43

Tabespe
Member
Registered: 2019-12-04
Posts: 129

Re: xfce4-popup-places plugins

Wow, great. Thank you. Does this also work for "ü", "ä", and "ö" ?

Where can we change the amount of entries we want to have in the list "recently opened documents" (~/.local/share/recently-used.xbel), when I do not want to use xfce4-places plugin?

Last edited by Tabespe (2020-10-22 12:51:31)

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.010 seconds, 7 queries executed - Memory usage: 553.35 KiB (Peak: 570.63 KiB) ]