Xfce Forum

Sub domains
 

You are not logged in.

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

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

[SOLVED] 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!

Last edited by rogue_ronin (2018-01-17 20:51:18)

Offline

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

Sideburns
Member
From: Trinidad, CO
Registered: 2011-03-30
Posts: 467
Website

Re: [SOLVED] 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: 24

Re: [SOLVED] 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: 832

Re: [SOLVED] 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

#5 2018-01-17 20:50:27

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

Re: [SOLVED] launching calibre using environment variable

Well, that worked!  Big thanks, and bigger thanks for the link.

Looks like I have to get my dotfiles in order.  Man, the boot and login process under linux has tremendous complexity.

Aloha!

Offline

#6 2018-01-17 20:58:16

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

Re: [SOLVED] launching calibre using environment variable

Great! Happy to help, it's nice to be aloha-ed!

Offline

#7 2019-06-13 11:26:59

Magnus B
Member
From: Stockholm, Sweden
Registered: 2019-06-13
Posts: 12
Website

Re: [SOLVED] launching calibre using environment variable

Found this thread today then I decided to solve the same problem. Tanks alcornoqui for the help.

But another way to solve it is to put this in /etc/environment (In Devuan).

CALIBRE_USE_SYSTEM_THEME=1

-----

The fun thing (or not so fun) is that in Gnome it work then you have this in /etc/profile.d/Calibre.sh (make the Calibre.sh yourself).

export CALIBRE_USE_SYSTEM_THEME=1

(I tested Gnome in a previous XFCE4 system there Calibre doesn't fit with the theme. But in Gnome it worked ok. Today then i went back to XFCE4 i scratched my head and tried to found out how I could make Calibre looks ok in XFCE4 also. It should. And now it does.)

Offline

#8 2019-06-13 19:45:14

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,491

Re: [SOLVED] launching calibre using environment variable

Cool. Thanks for sharing. And welcome to the forums!


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.009 seconds, 8 queries executed - Memory usage: 544.66 KiB (Peak: 545.5 KiB) ]