LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-20-2006, 11:21 PM   #1
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware
Posts: 1,134

Rep: Reputation: 277Reputation: 277Reputation: 277
How To Start A Program Minimized


Is there a common CL option or switch to start a program minimized?

Specifically, I have a particular xterm that starts when X loads, and I'd like it to start 'minimized.'

Since it appears to me that, literally, everything is possible in Linux, I figure this must be possible, but I haven't come across any way to do this.

cheers,
 
Old 04-21-2006, 05:30 AM   #2
introuble
Member
 
Registered: Apr 2004
Distribution: Debian -unstable
Posts: 700

Rep: Reputation: 31
There is no common command line argument to start a program minimized.
 
Old 04-21-2006, 12:01 PM   #3
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 34
This is totally dependant on your window manager. Most wm's have the option to start programs minimized (iconized), full screen etc. Few, if any, programs will themselves have this option since it is redundant. Window management is the responsibility of the (surprise!) window manager.
 
1 members found this post helpful.
Old 05-06-2020, 02:45 PM   #4
rarsa
Member
 
Registered: Nov 2004
Location: Canada
Distribution: Puppy Linux/ Mint
Posts: 211

Rep: Reputation: 31
Reviving the thread just in case

I was looking for a solution and came across this thread. It seems to be quite stale but I am sure people still have that question.

In my case, the application remains in the tray after closing, so I that's what I am doing:

IF YOUR APPLICATION KEEPS RUNNING WHEN YOU CLOSE IT
Create a little script file that includes the following comand
Code:
#!/bin/bash
<application> & sleep 2 && wmctrl -c "<window Title>"
where
<application> is the name of the application you want to start
<window Title> is the title of the window once you start the application

For example, for linphone this was the command:
Code:
#!/bin/bash
linphone & sleep 2 && wmctrl -c "linphone"
I used 2 seconds to let the application start before minimizing it. Of course, you will need to modify that number depending on how long your application takes to start up

Save that file. For example "startupApp.sh" (NOTE, the extension is not relevant, but given that it is a bash script, it is better if you reflect it on the name)

make that file executable:
Code:
chmod a+x startupApp.sh
Now, in your window manager startup applications add that script.

If you just want to minimize the application
Either because you don't have a tray or because your application doesn't keep running when you close the window, then you may want to just minimize it. For that, you can use the xdotool command.

for example
Code:
#!/bin/bash
linphone & sleep 2 && xdotool search --onlyvisible --name "Linphone" windowminimize

Last edited by rarsa; 05-06-2020 at 03:30 PM. Reason: Previous response was incomplete
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I automatically start a program at start up? victordh Linux - General 7 10-27-2013 06:02 AM
Start program hylke Linux - Newbie 6 08-03-2004 11:45 AM
Can I start a program without X, then start X and use that program? marenkiapina Linux - General 1 05-20-2004 05:07 AM
Minimized... LinuxSeeker Mandriva 1 03-17-2004 08:53 AM
start program killi Slackware 8 05-22-2003 04:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:05 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