Xfce Forum

Sub domains
 

You are not logged in.

#1 2017-12-21 02:37:07

rogue_ronin
Member
Registered: 2015-03-03
Posts: 11

launching calibre using environment variable

Neither the whisker-menu nor the panel's quicklauncher plugin will use environment variables, it seems.  Or perhaps I'm doing something wrong.

I have set the following environment variable in my .bashrc:

export CALIBRE_USE_SYSTEM_THEME=1

This is working fine; if I launch calibre from command-line or from the verve panel plugin, calibre uses my preferred theme.

If I launch from the whisker-menu or from the quicklauncher, I don't get the proper theme, just some burning-white glow designed to sear retinas and induce schizophrenia.

I have tried a script to launch calibre so that it will use my theme.  I have tried two options: setting the environment variable and using gtk-launchgtk-launch is currently uncommented in the example below, but I've tried both individually.  Both options work from command-line, and from the verve plugin.

Contents:

#!/bin/sh
#env CALIBRE_USE_SYSTEM_THEME=1 calibre
gtk-launch calibre-gui

Neither works from the quicklauncher.  I've also tried putting the above env line and the gtk-launch line directly into the quicklauncher.

I have tried editing the /usr/share/applications/calibre-gui.desktop file and changing the Exec line:

Exec=env CALIBRE_USE_SYSTEM_THEME=1 calibre --detach %F

This works from command-line and from verve, but no go from whisker-menu or quicklauncher.

What is happening?  Why do the whisker-menu and the quicklauncher seem to ignore the environment variables?  Especially, I don't understand why it would strip them from my script and the desktop files, it's weird.  Do I need to set this variable somewhere else for XFCE?

Aloha!

Offline

#2 2018-01-02 06:46:43

Sideburns
Member
From: Camarillo, CA
Registered: 2011-03-30
Posts: 422
Website

Re: launching calibre using environment variable

No wonder your script doesn't work: the line setting the environment has been commented out.  What you want is this:

CALIBRE_USE_SYSTEM_THEME=1

on a line of its own, followed by launching the program.  Strictly speaking, of course, this isn't Xfce specific, it's just basic bash scripting.


Registered Linux user #470359
Permanently recovered BOFH
Any advice in this post is worth exactly what you paid for it.

Offline

#3 2018-01-12 03:07:31

rogue_ronin
Member
Registered: 2015-03-03
Posts: 11

Re: launching calibre using environment variable

I understand that, and as I explained I tried both options in the script.  The implication should have been clear that I had one commented out at a time.  Apologies if I somehow made that unclear.

To be explicit: the issue is not the commenting; I have tried it without the commenting and with a lot of different methods as described in the original post.

I am trying to launch it from the whisker-menu and from the quicklauncher plugin and I cannot get it to use the environment variable.  I am asking why these two methods of launching ignore the environment variable when it is properly invoked, either from the script or from the command property in the menu/launcher.

Thanks for trying to help.  I'm hoping someone has knowledge of why I cannot assign the environment variable in either quicklauncher or whisker-menu.

Aloha.

Offline

#4 2018-01-12 13:06:06

alcornoqui
Member
Registered: 2014-07-28
Posts: 114

Re: launching calibre using environment variable

Try this:

Exec=bash -c "env CALIBRE_USE_SYSTEM_THEME=1 calibre --detach %F"

... and/or take a look at this: https://unix.stackexchange.com/question … /4628#4628

Offline

Board footer

Powered by FluxBB