LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 05-17-2020, 11:27 AM   #1
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,312
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
Desktop (.desktop) icon with custom environment variables


I need to set an environment variable for an application launched as a .desktop icon. I'm not seeing any reference to variables in the latest version of the specification. So I am trying a work-around with a shell:

Code:
[Desktop Entry]
Name=Oclock
GenericName=Clock
Comment=Display Time
Type=Application
Exec=sh -c "TZ=America/Chicago oclock -transparent -geometry 94x94+110+0"
Icon=/usr/share/icons/Mint-X/apps/96/clock.svg
StartupNotify=false
Terminal=false
Categories=Clock;
Would there be a relevant desktop entry key, or is the above method the only way?
 
Old 05-17-2020, 09:52 PM   #2
TheOuterLinux
LQ Newbie
 
Registered: Apr 2020
Location: ~/
Distribution: PsychOS
Posts: 10
Blog Entries: 14

Rep: Reputation: Disabled
Just add 'env':

Exec=sh -c "env TZ=America/Chicago oclock -transparent -geometry 94x94+110+0"
 
1 members found this post helpful.
Old 05-17-2020, 11:05 PM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,312

Original Poster
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
Both work but I was hoping for some kind of separate line in the .desktop file itself.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mouse wheel VOLUME control icon , NETWORK control icon on MATE's desktop panel on CentOS 7 disappeared primorec Linux - Desktop 0 07-31-2018 05:45 PM
Does Deepin Desktop Environment support addons that can heavily modify the desktop environment? Joe232 Linux - Software 1 02-07-2018 07:43 AM
[SOLVED] How to put an icon/shortcut on the desktop for a custom application? firefiber Linux - Newbie 5 09-17-2011 03:40 AM
custom environment variables cad Linux - General 4 01-26-2007 06:00 AM
My Network Browsing desktop icon is gone > my network browsing desktop icon i kkempter SUSE / openSUSE 1 01-12-2006 12:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 02:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration