need help for .desktop file to include the following requirement?

Questions about Wine on Linux
Locked
User avatar
ineuw
Level 2
Level 2
Posts: 28
Joined: Mon Aug 12, 2013 11:08 am

need help for .desktop file to include the following requirement?

Post by ineuw »

I am using Linux Mint Cinnamon 21.1 with Wine 8.0.1

I want to create a .desktop file which includes the following code but I don't know how to convert it, or if it's possible.

The following code works as an .sh file . . .

Code: Select all

#!/usr/bin/bash

pkill -f 'autokey-gtk'

# start textpad in wine
env WINEPREFIX="/home/ineuw/.wine/dosdevices/h:/.wine" wine "/home/ineuw/.wine/drive_c/Program Files/TextPad 8/TextPad.exe"

Code: Select all

$ inxi -Fxz 

System:
  Kernel: 5.15.0-72-generic x86_64 bits: 64 compiler: gcc v: 11.3.0
    Desktop: Cinnamon 5.6.8 Distro: Linux Mint 21.1 Vera
    base: Ubuntu 22.04 jammy
Machine:
  Type: Laptop System: Acer product: Aspire A515-43 v: V1.12
    serial: <superuser required>
  Mobo: PK model: Grumpy_PK v: V1.12 serial: <superuser required>
    UEFI: Insyde v: 1.12 date: 08/20/2021
Battery:
  ID-1: BAT1 charge: 36.8 Wh (100.0%) condition: 36.8/48.9 Wh (75.2%)
    volts: 16.3 min: 15.2 model: LGC AC14B8K status: Full
CPU:
  Info: dual core model: AMD Ryzen 3 3200U with Radeon Vega Mobile Gfx
    bits: 64 type: MT MCP arch: Zen/Zen+ note: check rev: 1 cache: L1: 192 KiB
    L2: 1024 KiB L3: 4 MiB
  Speed (MHz): avg: 1621 high: 2309 min/max: 1400/2600 boost: enabled
    cores: 1: 2309 2: 1679 3: 1206 4: 1290 bogomips: 20760
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: AMD Picasso/Raven 2 [Radeon Vega Series / Radeon Mobile Series]
    vendor: Acer Incorporated ALI driver: amdgpu v: kernel bus-ID: 05:00.0
  Device-2: Quanta HD Webcam type: USB driver: uvcvideo bus-ID: 1-1:2
  Display: x11 server: X.Org v: 1.21.1.4 driver: X: loaded: amdgpu,ati
    unloaded: fbdev,modesetting,vesa gpu: amdgpu resolution: 1: 1920x1080
    2: 1920x1080~60Hz
  OpenGL: renderer: AMD Radeon Vega 3 Graphics (raven2 LLVM 15.0.7 DRM 3.42
  5.15.0-72-generic)
    v: 4.6 Mesa 22.2.5 direct render: Yes
Audio:
  Device-1: AMD Raven/Raven2/Fenghuang HDMI/DP Audio
    vendor: Acer Incorporated ALI driver: snd_hda_intel v: kernel
    bus-ID: 05:00.1
  Device-2: AMD Raven/Raven2/FireFlight/Renoir Audio Processor
    vendor: Acer Incorporated ALI driver: snd_pci_acp3x v: kernel
    bus-ID: 05:00.5
  Device-3: AMD Family 17h HD Audio vendor: Acer Incorporated ALI
    driver: snd_hda_intel v: kernel bus-ID: 05:00.6
  Sound Server-1: ALSA v: k5.15.0-72-generic running: yes
  Sound Server-2: PulseAudio v: 15.99.1 running: yes
  Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Acer Incorporated ALI driver: r8169 v: kernel port: 2000
    bus-ID: 03:00.0
  IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: Intel Wireless 7265 driver: iwlwifi v: kernel bus-ID: 04:00.0
  IF: wlp4s0 state: down mac: <filter>
  Device-3: Realtek RTL8153 Gigabit Ethernet Adapter type: USB
    driver: r8152 bus-ID: 1-3.4:9
  IF: enx00e04c68891e state: down mac: <filter>
Bluetooth:
  Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8
    bus-ID: 1-4:5
  Report: hciconfig ID: hci0 rfk-id: 1 state: up address: <filter>
    bt-v: 2.1 lmp-v: 4.2
Drives:
  Local Storage: total: 707.98 GiB used: 73.94 GiB (10.4%)
  ID-1: /dev/nvme0n1 vendor: Western Digital
    model: PC SN520 SDAPNUW-128G-1014 size: 119.24 GiB temp: 47.9 C
  ID-2: /dev/sda model: SATA SSD size: 238.47 GiB
  ID-3: /dev/sdb type: USB vendor: JMicron Tech model: N/A size: 111.79 GiB
  ID-4: /dev/sdc type: USB vendor: JMicron Tech model: Generic
    size: 238.47 GiB
Partition:
  ID-1: / size: 116.71 GiB used: 20.03 GiB (17.2%) fs: ext4
    dev: /dev/nvme0n1p5
  ID-2: /boot/efi size: 98.4 MiB used: 10.2 MiB (10.4%) fs: vfat
    dev: /dev/nvme0n1p1
Swap:
  ID-1: swap-1 type: file size: 2 GiB used: 450.8 MiB (22.0%) file: /swapfile
Sensors:
  System Temperatures: cpu: N/A mobo: N/A gpu: amdgpu temp: 57.0 C
  Fan Speeds (RPM): N/A
Info:
  Processes: 280 Uptime: 1d 3h 37m Memory: 5.73 GiB used: 1.9 GiB (33.1%)
  Init: systemd runlevel: 5 Compilers: gcc: 11.3.0 Packages: 2913 Shell: Bash
  v: 5.1.16 inxi: 3.3.13
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: need help for .desktop file to include the following requirement?

Post by jkfloris »

A .desktop file can run only one program. However, you can have the .desktop file run your bash script.

Place your bash script in an easy-to-find location (such as ${HOME}/bin) and make sure it is executable (chmod 755).
Create a the .desktop file in ${HOME}/.local/share/applications

Code: Select all

[Desktop Entry]
Type=Application
Name=TextPad
Comment=Run TextPad with Wine
Exec=env /home/ineuw/bin/textpad.sh
Icon=wine
Terminal=false
User avatar
sotel
Level 1
Level 1
Posts: 8
Joined: Thu Aug 07, 2008 9:09 am

Re: need help for .desktop file to include the following requirement?

Post by sotel »

  • If you need more info about the valid structure and possible keywords inside a desktop file you will have to read the specification from FreeDesktop. See here: Desktop Entry Specification.
  • There are some tools to check if your desktop file is valid. These tools are provided by a package called: desktop-file-utils. On Debian this is this package: desktop-file-utils.
User avatar
ineuw
Level 2
Level 2
Posts: 28
Joined: Mon Aug 12, 2013 11:08 am

Re: need help for .desktop file to include the following requirement?

Post by ineuw »

My sincere thanks to both of you. You both provided a lot of valuable info. If I have a question, I will post it.
User avatar
ineuw
Level 2
Level 2
Posts: 28
Joined: Mon Aug 12, 2013 11:08 am

Re: need help for .desktop file to include the following requirement?

Post by ineuw »

Another question please:

I need to use BabelMap.exe, which is a self loading file without installation. It works when clicked directly, or with a shortcut, but I need it in the menu to create panel a launcher. Created the folder with the .exe file as indicated below, but my .sh file won't launch it.


env WINEPREFIX="/home/ineuw/.wine/dosdevices/h:/.wine" wine "/home/ineuw/.local/share/applications/wine/Programs/BabelMap/BabelMap.exe"
User avatar
ineuw
Level 2
Level 2
Posts: 28
Joined: Mon Aug 12, 2013 11:08 am

Re: need help for .desktop file to include the following requirement?

Post by ineuw »

Please close this post. The problem was Cinnamon and it's working now.
Locked