LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 01-30-2020, 07:30 PM   #1
ACRIzona
Member
 
Registered: Dec 2007
Location: Phoenix
Distribution: iMAC(64) Mint & Q4os
Posts: 82

Rep: Reputation: Disabled
Unhappy XFCE desktop Launcher - one-line command how-to


We often run Terminal and type in commands like: "echo Hello World",
"cat /etc/linuxmint/info", "ping 123.456.7.8".

I want to create desktop XFCE Launchers with one-line commands,,, not using a BASH script.

How-to: Right click on XFCE background and run "Create Launcher".
Enter Name:"OneLiner",
Command: "echo Hello world",
Select "Run in terminal"
click Create.

Click the new launcher to test.
After a short wait, an error message "Failed to run "OneLiner.desktop"

I cannot believe this can be that difficult !
 
Old 01-30-2020, 07:53 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
When you run in a terminal, you are also “in” a shell, which provides you with an environment including paths to commands (PATH)
Try using the absolute paths to commands.
 
Old 01-30-2020, 08:39 PM   #3
ACRIzona
Member
 
Registered: Dec 2007
Location: Phoenix
Distribution: iMAC(64) Mint & Q4os
Posts: 82

Original Poster
Rep: Reputation: Disabled
Tried:
Launcher command: /bin/echo Hello world
Option: Run in terminal
Same results - nothing.

Last edited by ACRIzona; 01-30-2020 at 08:51 PM.
 
Old 01-31-2020, 10:49 AM   #4
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,146

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
I think that you need this:
Code:
xfce4-terminal --command="echo 'Hello World'"
 
Old 01-31-2020, 12:11 PM   #5
ACRIzona
Member
 
Registered: Dec 2007
Location: Phoenix
Distribution: iMAC(64) Mint & Q4os
Posts: 82

Original Poster
Rep: Reputation: Disabled
Something??? flashes on the desktop.
If I run Terminal and Enter: xfce4-terminal --command="echo 'Hello World'"
Something flashes on the next line.
There must be a default 'execute + exit' parameter somewhere.

Note:
I have found this same problem in three other forums. No solution found. (without using a script file).
What ever happened to DOS ?

Last edited by ACRIzona; 01-31-2020 at 03:34 PM.
 
Old 02-01-2020, 11:17 AM   #6
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,146

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
I can see the problem. Using a command like
Code:
xfce4-terminal --command="units"
works because the terminal stays running so long as the program units is using it. But the echo command stops after it's done its job, and so the terminal closes before you can see it. I tried altering the command to "echo 'Hello' && sleep 5" but that doesn't help. You need a real bash expert here, and that's not me.
 
Old 02-02-2020, 07:17 PM   #7
ACRIzona
Member
 
Registered: Dec 2007
Location: Phoenix
Distribution: iMAC(64) Mint & Q4os
Posts: 82

Original Poster
Rep: Reputation: Disabled
I need a desktop tool that be handled over-the-phone, ultra-simple. Obviously 'Launcher' won't do.
However, I did discover another work-around:

Create a new file: /usr/local/bin/wrapper containing:

#!/bin/bash
$@
/bin/bash

Make: wrapper executable.

Edit: Launcher: Command: xfce4-terminal -x wrapper echo "hello world"

.... or .... wrapper cat /etc/linuxmint/info
.... Tested OK with 1 command only.
.... Failed using wrapper echo "hello world" ; cat /etc/linuxmint/info

Thanks for your input.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How do I find the target of a desktop launcher? How do I edit an existing launcher? tnandy Linux - Software 9 01-23-2018 09:25 PM
Launcher Problems! Why is there a line through my icons on my launcher? LinuxNoob12 Linux - Newbie 1 10-26-2012 01:37 AM
[SOLVED] Xfce: could not use $( <command> ) in a launcher command catkin Linux - Desktop 3 10-05-2010 10:46 AM
Creating a launcher (could be java launcher) The_Messiah Linux - Newbie 12 04-06-2005 01:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 06:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration