Step 0
Set a binary PATH for your user. Run mkdir ~/bin
and add this directory to your PATH.
How this is done may vary depending on the shell and desktop environment you use.
Here you can found how to change your PATH in a variety of shells.
Check this solved question if your desktop environment don't care about your shell profile and the former does work from the terminal but not from the desktop environment.
Step 1
Once you have set your shell and your desktop environment to respect a new PATH, you can drop scripts there and run them as regular commands without typing their path.
Create a short shell script to run your wine program in this directory, i.e. ~/bin/textaloud
:
#!/bin/bash
cd "~/.wine/drive_c"
exec wine "~/.wine/drive_c/Program Files/TextAloud/TextAloudMP3.exe" "$@"
And give it execute permission.
chmod +x ~/bin/textaloud
There are three things to note about the above script:
- The
cd
path is where the program is going to be run (in which directory). Some programs may require you to run them on a specific directory. If you have trouble with this, set there that directory (usually the same where the executable is located). You may unwant this line in some cases.
- The
exec
commands tell bash to morph into wine with the following arguments, so this is no longer bash running wine, but bash process becoming wine. The PID remains. You don't have two processes running.
- The
$@
is substituted with the arguments you ran the script, if any. So those are passed to your wine program.
Now you can run your program from the shell like...
textaloud
Step 2
Create an application launcher. Nowadays these files are standarized as .desktop
files and many desktop environments provide graphical tools to create them.
Here is an example skeleton you can use to write it yourself. You may want to provide an icon (often in PNG, SVG or XPM).
[Desktop Entry]
Type=Application
Name=TextAloud
Exec=textaloud
Icon=textaloud.png
Place this file in ~/.local/share/applications/TextAloud.desktop
. Icons are searched (among other places) in ~/.local/share/icons
, so make sure to find a cute icon for your application and place it there with the name textaloud.png
.
Once you had done this, your desktop environment should find your shortcut file and be able to run the program with the script. If not, reload or restart it.
/proc/sys/fs/binfmt_misc/register
. It writes/proc/sys/fs/binfmt_misc/register E667: Fsync failed
. I tried to edit under user acount withsudo
and under root account too. Both write this error. – xralf Apr 01 '13 at 09:43root
account. I added/path/to/
to my$PATH
variable and I can runXX.exe
from command line but still can't run it fromdmenu
. Sorry I've mistaken it withxmobar
in the question. – xralf Apr 07 '13 at 08:52wine-systemd
adds/usr/lib/binfmt.d/wine.conf
, which is run bysystemd-binfmt.service
at boot time---and that does the registration so you don't have to do it manually. – uckelman Oct 10 '18 at 14:15