Xfce Forum

Sub domains
 

You are not logged in.

#1 2020-06-23 09:00:56

phre4k
Member
Registered: 2011-11-15
Posts: 8

Adding script as launcher doesn't work

Hello,

I try to add a screen layout script which looks like this:

#!/bin/sh
xrandr --output DP-1 --off --output DP-2 --off --output HDMI-1 --off --output HDMI-2 --off --output DP-3 --mode 2560x1440 --pos 2560x0 --rotate right --output DP-4 --off --output DP-5 --primary --mode 2560x1440 --pos 0x637 --rotate normal --output DP-6 --off

and is executable to the xfce4-panel 4.14.4.

I right-click the panel, select "Add New Items":

KMoVI2v.png

select "Launcher":

54Y0PU0.png

then right-click the launcher and select "Properties":

KKXgcad.png

click "Add New Item" again, enter the script's filename (/home/user/.screenlayout/default.sh) and click on save.

6D2SbVr.png

no error message (neither in GUI nor in terminal or syslog/journal) and there's nothing added in the launcher list.

Please tell me why this doesn't work. I tried with xfce4-terminal -H -x, selecting "run in terminal" and "sh …/default.sh" but those don't work either. Creating a .desktop file and using that works, but I'd just like the Launcher menu to work properly.


Offline

#2 2020-06-23 23:33:01

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Adding script as launcher doesn't work

phre4k wrote:

no error message (neither in GUI nor in terminal or syslog/journal) and there's nothing added in the launcher list.

Please tell me why this doesn't work. I tried with xfce4-terminal -H -x, selecting "run in terminal" and "sh …/default.sh" but those don't work either. Creating a .desktop file and using that works, but I'd just like the Launcher menu to work properly.

This is a little unclear. Are you saying that no entry is created in the launcher properties dialog, or when clicking the launcher, the script is not executed?

If your distro uses an ~/.xsession-errors file, look in that file for errors. The other way to check for errors is to first quit the panel:

xfce4-panel -q

...then start it in debug mode:

PANEL_DEBUG=1 xfce4-panel

Re-do your steps and look for errors in the terminal window.


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 2020-06-25 17:26:21

phre4k
Member
Registered: 2011-11-15
Posts: 8

Re: Adding script as launcher doesn't work

There's no entry created.

It works reliably when I put the script into ~/.local/bin/.

When I use

PANEL_DEBUG=1 xfce-panel

I get:

xfce4-panel(module): new item (type=object-type, name=launcher, id=1)
xfce4-panel(application): saving /panels/panel-1: ids=true, providers=false
xfce4-panel(struts): 0x562a093fdd60: top=664, start_x=0, end_x=2559
liblauncher-Message: 19:14:59.392: launcher-1: Failed to cleanup the configuration: Error removing file /home/drip/.config/xfce4/panel/launcher-1: Directory not empty
xfce4-panel(application): saving /panels/panel-1: ids=true, providers=false

(xfce4-panel:27833): Gtk-CRITICAL **: 19:14:59.425: gtk_icon_theme_load_icon: assertion 'icon_name != NULL' failed

(xfce4-panel:27833): Gtk-CRITICAL **: 19:15:02.924: gtk_widget_grab_default: assertion 'gtk_widget_get_can_default (widget)' failed
xfce4-panel(module-factory): reading /usr/share/xfce4/panel/plugins
xfce4-panel(module-factory): reading /usr/share/xfce4/panel-plugins
xfce4-panel(struts): 0x562a093fdd60: top=665, start_x=0, end_x=2559
xfce4-panel(module): new item (type=object-type, name=launcher, id=14)
xfce4-panel(application): saving /panels/panel-1: ids=true, providers=false
xfce4-panel(struts): 0x562a093fdd60: top=664, start_x=0, end_x=2559
xfce4-panel(application): saving /panels/panel-1: ids=false, providers=true

But there's no output while saving the new launcher.

I wanted to record it but for some reason it suddenly worked one time – adding several other launchers with scripts in them worked, too! Then I removed the launcher, added another one and it stopped working again.

When I add an existing .desktop file as launcher and edit the script's path in, it works, but I can't edit the name. It launches the script though.


Offline

#4 2020-06-25 19:16:38

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Adding script as launcher doesn't work

liblauncher-Message: 19:14:59.392: launcher-1: Failed to cleanup the configuration: Error removing file /home/drip/.config/xfce4/panel/launcher-1: Directory not empty

What does the following return:

xfconf-query -c xfce4-panel -lv | grep launcher

...and:

ls -l ~/.config/xfce4/panel/ | grep launcher

It works reliably when I put the script into ~/.local/bin/.

Do you mean that if the script is in that location the launcher is created? Or just that the script runs properly from that location?


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

#5 2020-06-28 12:33:08

phre4k
Member
Registered: 2011-11-15
Posts: 8

Re: Adding script as launcher doesn't work

Do you mean that if the script is in that location the launcher is created?

Yes. Outside of that folder it seems to be total luck (1/10 times) that a launcher is created. If it works a single time you can add more launchers without a problem though.

xfconf-query -c xfce4-panel -lv | grep launcher

returns nothing.

$ ls -l ~/.config/xfce4/panel/ | grep launcher
drwx------. 2 drip drip 4096 25. Jun 19:28 launcher-1
drwx------. 2 drip drip 4096 25. Jun 19:28 launcher-14
drwx------. 2 drip drip 4096 23. Jun 10:42 launcher-15

Offline

#6 2020-06-28 14:55:10

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Adding script as launcher doesn't work

phre4k wrote:

Do you mean that if the script is in that location the launcher is created?

Yes. Outside of that folder it seems to be total luck (1/10 times) that a launcher is created. If it works a single time you can add more launchers without a problem though.

xfconf-query -c xfce4-panel -lv | grep launcher

returns nothing.

Which should mean that you don't have any launchers currently on your panel.

$ ls -l ~/.config/xfce4/panel/ | grep launcher
drwx------. 2 drip drip 4096 25. Jun 19:28 launcher-1
drwx------. 2 drip drip 4096 25. Jun 19:28 launcher-14
drwx------. 2 drip drip 4096 23. Jun 10:42 launcher-15

Can you delete these folders (and their contents) and try again?

Also, is your userid on the system "drip"? In other words, do you own those files?


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

Board footer

Powered by FluxBB