delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/04/20/17:17:37

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
X-IronPortListener: Outbound_SMTP
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AkgBALVMr02cKEcW/2dsb2JhbACXO44Kd60BmiCFcQSSPA
From: "Buchbinder, Barry (NIH/NIAID) [E]" <BBuchbinder AT niaid DOT nih DOT gov>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>,
"'SJ Wright'" <sjwright68 AT charter DOT net>
Date: Wed, 20 Apr 2011 17:17:14 -0400
Subject: RE: Idea on how to improve cygstart
Message-ID: <0105D5C1E0353146B1B222348B0411A209E8030BE3@NIHMLBX02.nih.gov>
References: <4DAE1B1C DOT 9010905 AT charter DOT net>
In-Reply-To: <4DAE1B1C.9010905@charter.net>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

SJ Wright sent the following at Tuesday, April 19, 2011 7:31 PM
>Well, maybe there's a better word than "improve." Maybe "streamline"
>would be better. Anyhow, here it is.
>
>Allow users to create a list of paths to GUI apps they have on their
>systems -- other than the selected Windows defaults -- and using either
>aliases (like "monkey" for SeaMonkey 2.0 or "irfan" for IrfanView) or a
>syntax similar to how ImageMagick used to work (library:filetype) when
>converting files from one format to another, facilitate quick and easy
>opening of files in applications Cygwin users would _prefer to open them
>in, rather than the assigned default.
>
>Should this prove to be too radical a re-working of cygstart, then
>perhaps it's time to introduce another utility to perform the above
>tasks, and have it install with Cygwin and update with upgrades. Maybe
>call it "userstart" or "winstart" or something along those lines?
>
>Unless I miss my guess, this might put Cygwin ahead of complete and
>genuine Linux/Unix distributions such as Ubuntu, It's been my experience
>with the latter that instead of system defaults, one only has recourse
>on the command line to a spare list of GUI apps that open different
>file types, and not all of them are "out-of-the-box" Debian or GNOME
>installs, which puts one at a disadvantage (if only w/regard to the time
>involved in doing "apt-gets").

How about in ~/.bashrc

	function irfan() {
		cygstart /path/irfanview.exe "$(cygpath -w "$1")"
		}

Or in a file named /usr/local/bin/irfan that has been made executable

	#!/bin/dash
	for IrfanFile in "$@"
	do cygstart /path/irfanview.exe "$(cygpath -w "${IrfanFile}")"
	done

If you never give irfan a file or only files in the current directory,
you could also put an alias in ~/.bashrc

	alias irfan "cygstart /path/irfanview.exe"

Once one has the model, it shouldn't be difficult to replicate it for
any desired program.

Best wishes,

- Barry
  Disclaimer: Statements made herein are not made on behalf of NIAID.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019