Forum › Forums › General › Software › Adding an enviromental variable in .desktop icon fails the icon
Tagged: Icon
- This topic has 5 replies, 3 voices, and was last updated Mar 29-5:59 am by symbol.
-
AuthorPosts
-
March 27, 2023 at 9:31 am #103320Member
symbol
I am editing the .desktop file for microsoft edge, originally the icon file works:
Comment[zh_CN]=访问互联网 Comment[zh_HK]=連線到網際網路 Comment[zh_TW]=連線到網際網路 Exec=/usr/bin/microsoft-edge-stable %U StartupNotify=true Terminal=false Icon=microsoft-edge Type=Application Categories=Network;WebBrowser;While after adding an environmental variable in the Exec the program won’t start.
Comment[vi]=Truy cập Internet Comment[zh_CN]=访问互联网 Comment[zh_HK]=連線到網際網路 Comment[zh_TW]=連線到網際網路 # Exec=/usr/bin/microsoft-edge-stable %U Exec=env GTK_IM_MODULE=xim /usr/bin/microsoft-edge-stable %U StartupNotify=true Terminal=false Icon=microsoft-edge Type=Application Categories=Network;WebBrowser;Anyone knows how to correct this? (GTK_IM_MODULE is for ibus)
March 27, 2023 at 4:03 pm #103346MemberRJP
March 27, 2023 at 4:17 pm #103353MemberPPC
::Also, to be on the safe side, when executing complex commands on the Exec= field of a .desktop file, try using:
Exec= sh -c “Command1 ; Command2”
March 27, 2023 at 9:56 pm #103379Membersymbol
::apt-cache policy ibus
Yes, I am using ibus, it works for most of the apps including firefox and geany, however it does not work for microsoft-edge.
$ apt-cache policy ibus ibus: Installed: 1.5.23-2 Candidate: 1.5.23-2 Version table: *** 1.5.23-2 500 500 http://ftp.de.debian.org/debian bullseye/main amd64 Packages 100 /var/lib/dpkg/statusMarch 27, 2023 at 9:59 pm #103380Membersymbol
::Also, to be on the safe side, when executing complex commands on the Exec= field of a .desktop file, try using:
Exec= sh -c “Command1 ; Command2”
This one does not work, clicking on the icon has not effect at all:
Exec=bash -c 'export GTK_IM_MODULE=xim;/usr/bin/geany'
While without export it works:
Exec=bash -c '/usr/bin/geany'
I need to import new environment variable though.- This reply was modified 1 month, 1 week ago by symbol.
March 29, 2023 at 5:59 am #103512Membersymbol
::I exported GTK_IM_MODULE and XMODIFIERS in the script /usr/bin/microsoft-edge-stable and fixed the problem.
#!/bin/bash # # Copyright 2011 The Chromium Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. #ibus export GTK_IM_MODULE=xim #Fix for Chrome and Brave, when I start either of them from command lines export XMODIFIERS=@im=ibus # Let the wrapped binary know that it has been run through the wrapper. export CHROME_WRAPPER="<code>readlink -f "$0"</code>"- This reply was modified 1 month, 1 week ago by symbol.
- This reply was modified 1 month, 1 week ago by symbol. Reason: highlight keywords in solution
-
AuthorPosts
- You must be logged in to reply to this topic.