"Open With" & Launcher - WINE program

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Geonovast
Level 2
Level 2
Posts: 62
Joined: Wed Apr 06, 2016 2:19 pm

"Open With" & Launcher - WINE program

Post by Geonovast »

To start: Two computers I'd like to make this change on, one is LM18.2/MATE, the other is LM18.3/MATE

My favorite programming editor is Programmer's Notepad 2. Yes, I know there are "better" ones out there, but it's what I'm used to, and what I'm most comfortable in. Getting the program to run isn't an issue, it's a portable program that gets along with WINE just fine.

What I'd like to is:
1. Create an application launcher on my panel to launch the program. Just creating a launcher does nothing, since it has to open with WINE WIndows Program Loader
2. I'd like all .html, .php, .css, .js files to open with Programmer's Notepad 2 by default just by double clicking on them.

I'm assuming both of these have a similar process. Asking Google for help is just bringing me to a bunch of guides on how to install WINE and/or how to install programs in WINE.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Desktop: Ryzen 7 5800X, 64 GB DDR4 @ 3600MT/s, AMD RX 6700XT, Mint 21.1 x64 MATE
Lappy: Ryzen 5 4600H, 32 GB DDR4 @ 3200MT/s, Nvidia GTX 1660Ti, Mint 21.1 x64 MATE
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: "Open With" & Launcher - WINE program

Post by Flemur »

I open a lot of stuff with wine programs, and make wine programs "act like" regular linux programs, e.g. "foobar" (starts windows foobar2000 music player under wine).

Terminal:
$ foobar
$ foobar file-name.mp3
or
file-browser->double-click->open .mp3 and .wav with foobar by default

$ cat ~/bin/foobar

Code: Select all

#!/bin/sh

PAR=`winepath -w "$*"`

LOC=~/.wine/drive_c/pgms/foobar2000/foobar2000.exe

if [ $# -lt 1 ]; then
	wine "$LOC" &
else
	wine "$LOC" "$PAR" &
fi

exit 0
Explanation:
PAR=`winepath -w "$*"` converts the passed file-names to windows-like for the windows programs, so
/mnt/DATA/music/file.mp3 --> D:/music/file.mp3 (IF there are any params passed).

LOC=~/.wine/drive_c/pgms/foobar2000/foobar2000.exe is where the executable is. Usually this is the only part of the script I have to change to run a different wine program!

Also do:

Code: Select all

chmod +x ~/bin/foobar
2. I'd like all .html, .php, .css, .js files to open with Programmer's Notepad 2 by default just by double clicking on them.
Make a script like the above, then in your file browser, select that script as the default programs for those file types.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
User avatar
Pierre
Level 21
Level 21
Posts: 13222
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: "Open With" & Launcher - WINE program

Post by Pierre »

Yeah - - both of these have a similar process:
How to launch a standalone Windows .exe
https://www.codeweavers.com/support/wik ... l/run_only
How to create a launcher icon for a Windows application
https://www.codeweavers.com/support/wik ... e_launcher

sure - that's using their Cx product :o but, the technique is similar when using ./wine itself.
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
User avatar
Geonovast
Level 2
Level 2
Posts: 62
Joined: Wed Apr 06, 2016 2:19 pm

Re: "Open With" & Launcher - WINE program

Post by Geonovast »

Awesome! Worked perfectly!

Thank you so much. This will save me a lot of time.
Desktop: Ryzen 7 5800X, 64 GB DDR4 @ 3600MT/s, AMD RX 6700XT, Mint 21.1 x64 MATE
Lappy: Ryzen 5 4600H, 32 GB DDR4 @ 3200MT/s, Nvidia GTX 1660Ti, Mint 21.1 x64 MATE
Locked

Return to “MATE”