How to start up Leo the dumb way

98 views
Skip to first unread message

andyjim

unread,
Jan 30, 2020, 7:48:28 PM1/30/20
to leo-editor
Really dumb question, I know.  MacOS system. I'd like to launch Leo from the launch bar instead of from terminal (which is the only way I know to launch it). But it ties up the terminal so I can't use it for anything else while Leo is running (not that I use terminal much, but occasionally), plus it would be easier/quicker to launch from icon.  I don't find a launchLeo or a runLeo file on my system.
Andy

tfer

unread,
Jan 30, 2020, 9:19:12 PM1/30/20
to leo-editor
I can't help you with making a shortcut, but if you start another terminal session, that terminal will be free,and not be tied up waiting for Leo to terminate.

andyjim

unread,
Jan 30, 2020, 10:55:37 PM1/30/20
to leo-editor
I guess I don't know how to open an additional terminal. When I click the icon it just switches focus to the existing terminal rather than opening another one.

Matt Wilkie

unread,
Jan 31, 2020, 1:28:28 AM1/31/20
to leo-editor
You could try "Settings >> Open desktop integration" and then use the [add-desktop-links] button.

I'm the author but I've not had access to a Mac in order to test it. It relies on an external module which supports Mac so it might "just work".

Failing that, add ampersand (&) after any command in Terminal  to make it run in the background and not tie it up (should work on any 'nix machine). Any messages from the background app still print to the terminal so it can get messy, but at least it still available for use.

-matt

andyjim

unread,
Jan 31, 2020, 9:01:52 AM1/31/20
to leo-editor
Thanks much Matt, that worked, so I now have a launch icon (plus I learned a smidgen about button use).  I happened to have a terminal open when I launched it, and it opened a another terminal, leaving the first one usable.  When I don't already have a terminal open and launch Leo from the shortcut, I cannot open a second terminal.  So I either need to launch Leo in terminal to run in background, or open a terminal before launching Leo from the shortcut.

Oh! I just found out I can open another terminal (when Leo is running in the first one) by right-clicking the terminal shortcut, where it gives the option to open another window! Ok, problem solved three different ways.

Thanks again,
Andy

Edward K. Ream

unread,
Jan 31, 2020, 9:21:34 AM1/31/20
to leo-editor
On Fri, Jan 31, 2020 at 8:01 AM andyjim <andy...@gmail.com> wrote:
Thanks much Matt, that worked, so I now have a launch icon (plus I learned a smidgen about button use).  I happened to have a terminal open when I launched it, and it opened a another terminal, leaving the first one usable.  When I don't already have a terminal open and launch Leo from the shortcut, I cannot open a second terminal.  So I either need to launch Leo in terminal to run in background, or open a terminal before launching Leo from the shortcut.

Oh! I just found out I can open another terminal (when Leo is running in the first one) by right-clicking the terminal shortcut, where it gives the option to open another window! Ok, problem solved three different ways.

Good work ;-) This kind of hangnail can be super annoying.

Edward

Steve Litt

unread,
Feb 1, 2020, 2:51:39 PM2/1/20
to leo-e...@googlegroups.com
I'd suggest investigating dmenu at https://tools.suckless.org/dmenu/ .
It works on Linux, and it's pure X so I don't see a reason it wouldn't
work on a modern Mac. If you can get it working on your Mac, see setup
details here:

http://troubleshooters.com/linux/dmenu/bestpractices.htm

(The preceding link will be back up 2/6/2020)

If you can't get dmenu to work, the following Python script enables you
to run any GUI program with a doublefork, freeing the terminal it's run
from:

=====================================================
#!/usr/bin/python3

import sys
import os


if os.fork():
sys.exit(0)
if os.fork():
sys.exit(0)
os.setsid() ### New to 1.9.3, guarantees complete fork
sys.argv.pop(0)
executable = sys.argv[0]
os.execvp(executable, sys.argv)
=====================================================

To run Gnumeric without consuming the terminal, just do the following:

./ufork.py gnumeric

SteveT

Steve Litt
January 2020 featured book: Troubleshooting: Just the Facts
http://www.troubleshooters.com/tjust

Steve Litt

unread,
Feb 4, 2020, 6:47:20 PM2/4/20
to leo-e...@googlegroups.com
On Sat, 1 Feb 2020 14:51:34 -0500
Steve Litt <sl...@troubleshooters.com> wrote:

> On Thu, 30 Jan 2020 16:48:27 -0800 (PST)
> andyjim <andy...@gmail.com> wrote:
>
> > Really dumb question, I know. MacOS system. I'd like to launch Leo
> > from the launch bar instead of from terminal (which is the only way
> > I know to launch it). But it ties up the terminal so I can't use it
> > for anything else while Leo is running (not that I use terminal
> > much, but occasionally), plus it would be easier/quicker to launch
> > from icon. I don't find a launchLeo or a runLeo file on my system.
> > Andy
> >
>
> I'd suggest investigating dmenu at https://tools.suckless.org/dmenu/ .
> It works on Linux, and it's pure X so I don't see a reason it wouldn't
> work on a modern Mac. If you can get it working on your Mac, see setup
> details here:
>
> http://troubleshooters.com/linux/dmenu/bestpractices.htm
>
> (The preceding link will be back up 2/6/2020)
>
> If you can't get dmenu to work, the following Python script enables
> you to run any GUI program with a doublefork, freeing the terminal
> it's run from the following ufork.py:
>
> =====================================================
> #!/usr/bin/python3
>
> import sys
> import os
>
>
> if os.fork():
> sys.exit(0)
> if os.fork():
> sys.exit(0)
> os.setsid() ### New to 1.9.3, guarantees complete fork
> sys.argv.pop(0)
> executable = sys.argv[0]
> os.execvp(executable, sys.argv)
> =====================================================
>
> To run Gnumeric without consuming the terminal, just do the following:
>
> ./ufork.py gnumeric
>
> SteveT
>
> Steve Litt
> January 2020 featured book: Troubleshooting: Just the Facts
> http://www.troubleshooters.com/tjust

SteveT

Steve Litt
February 2020 featured book: Thriving in Tough Times
http://www.troubleshooters.com/thrive

Micah Joel

unread,
Feb 25, 2020, 5:04:10 AM2/25/20
to leo-editor
In Mac Terminal, you can also Cmd+T to open a new tab in the same window.
But if you spend any appreciable amount of time in the Mac command line, you should go get iTerm2 https://iterm2.com/
-m

Edward K. Ream

unread,
Feb 25, 2020, 5:18:28 AM2/25/20
to leo-editor
On Tue, Feb 25, 2020 at 4:04 AM Micah Joel <mi...@micahjoel.info> wrote:
In Mac Terminal, you can also Cmd+T to open a new tab in the same window.
But if you spend any appreciable amount of time in the Mac command line, you should go get iTerm2 https://iterm2.com/
-m

Thanks for this comment.

Edward
Reply all
Reply to author
Forward
0 new messages