SOLVED - Desktop launcher for bash script not working

Forum rules
Before you post please read how to get help
Post Reply
iain_33
Level 2
Level 2
Posts: 75
Joined: Sat Dec 22, 2018 11:29 am
Location: UK

SOLVED - Desktop launcher for bash script not working

Post by iain_33 » Mon Jun 03, 2019 5:08 pm

I'm using Mint 19.1, MATE edition. I've created a simple little bash script to turn my laptop display off:

Code: Select all

$ cat ~/bin/screenoff
#!/bin/bash
sleep 1
xset dpms force off
I've used it from the terminal a few times and it works fine. However, I can't get a desktop launcher to work for it (see attached screenshot) - I just get "There was an error launching the application". I've tried "Type" as "Application" and "Application in terminal" but get the same result.

I've also tried the full path for the command - /home/iain/bin/screenoff - this time I get the error "Details: Failed to execute child process "xterm" (No such file or directory)"

Screenshot at 2019-06-03 22-00-52.png
Screenshot at 2019-06-03 22-00-52.png (31.48 KiB) Viewed 445 times
Last edited by iain_33 on Mon Jun 03, 2019 5:53 pm, edited 1 time in total.
Linux Mint 19.1 MATE (64 bit) on a HP G70 laptop (circa 2008)
Intel Pentium Dual Core T3400 @ 2.16GHz -- 3GB RAM -- 1TB HDD
Intel Mobile 4 Series graphics -- Intel 82801I audio
Atheros AR242x/AR542x wireless network adapter

ajgreeny
Level 4
Level 4
Posts: 460
Joined: Mon Nov 19, 2007 3:27 pm

Re: Desktop launcher for bash script not working

Post by ajgreeny » Mon Jun 03, 2019 5:32 pm

I suspect the command you're using is not needing the "Application in terminal" that you show but not using Mint I am not sure about that.

What other options show in that dropdown box?

One alternative, if the terminal is necessary, is to use a command starting with whatever terminal emulator you use, eg

Code: Select all

gnome-terminal -x /full/pathway/to/script
Change gnome-terminal to whatever is used in the mate desktop.

gm10
Level 20
Level 20
Posts: 10205
Joined: Thu Jun 21, 2018 5:11 pm

Re: Desktop launcher for bash script not working

Post by gm10 » Mon Jun 03, 2019 5:43 pm

ajgreeny wrote:
Mon Jun 03, 2019 5:32 pm
I suspect the command you're using is not needing the "Application in terminal" that you show
Yes, and that's the problem, if he switches it to just Application it'll work.

Terminal launchers are broken by default in LM MATE. Run this once to fix them:

Code: Select all

sudo ln -s /etc/alternatives/x-terminal-emulator /usr/bin/xterm
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

iain_33
Level 2
Level 2
Posts: 75
Joined: Sat Dec 22, 2018 11:29 am
Location: UK

Re: Desktop launcher for bash script not working

Post by iain_33 » Mon Jun 03, 2019 5:50 pm

Thanks both for your replies.

I tried both "Application" and "Application in Terminal" with the same result.

I changed the command line to bash /home/iain/bin/screenoff and it works - I thought the #!/bin/bash line meant it would run by itself but hey-ho.
Linux Mint 19.1 MATE (64 bit) on a HP G70 laptop (circa 2008)
Intel Pentium Dual Core T3400 @ 2.16GHz -- 3GB RAM -- 1TB HDD
Intel Mobile 4 Series graphics -- Intel 82801I audio
Atheros AR242x/AR542x wireless network adapter

iain_33
Level 2
Level 2
Posts: 75
Joined: Sat Dec 22, 2018 11:29 am
Location: UK

Re: Desktop launcher for bash script not working

Post by iain_33 » Mon Jun 03, 2019 5:52 pm

gm10 wrote:
Mon Jun 03, 2019 5:43 pm
Terminal launchers are broken by default in LM MATE. Run this once to fix them:

Code: Select all

sudo ln -s /etc/alternatives/x-terminal-emulator /usr/bin/xterm
I've just tried that, changed my launcher back to how it was before (without the bash prefix) and it works now :D
Linux Mint 19.1 MATE (64 bit) on a HP G70 laptop (circa 2008)
Intel Pentium Dual Core T3400 @ 2.16GHz -- 3GB RAM -- 1TB HDD
Intel Mobile 4 Series graphics -- Intel 82801I audio
Atheros AR242x/AR542x wireless network adapter

gostal
Level 2
Level 2
Posts: 78
Joined: Fri Sep 07, 2018 9:56 am

Re: Desktop launcher for bash script not working

Post by gostal » Tue Jul 30, 2019 8:09 am

gm10 wrote:
Mon Jun 03, 2019 5:43 pm
Terminal launchers are broken by default in LM MATE. Run this once to fix them:

Code: Select all

sudo ln -s /etc/alternatives/x-terminal-emulator /usr/bin/xterm
Those of us who happen to like xterm have probably not experienced this problem since one of the first things we do is to install it. :)

Cheers,
gostal
Lap: Latitude E6520, i3-2330M @ 2.20GHz, 4GB, Intel HD Graphics 3000, OS Mint 19.1 version Mate, Windows 7 Enterprise
Desk: Dell Precision T5810, Xeon E5-1650 v4 @ 3.60GHz,72 GB, Radeon Pro WX 7100, OS CentOS 7.7
Stockholm, Sweden

Post Reply

Return to “MATE”