Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 09-14-2025, 05:54 PM   #1
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 985
Karma: 1044682
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
Help Getting a Plugin to Work

Theme Switcher Plugin for Calibre
This interface plugin allows you to apply custom visual themes in Calibre using palette files (*.calibre-palette) and stylesheets (*.qss). Its goal is to offer a modular and reproducible way to change the look of the graphical interface, including background colors, text, buttons, and scroll bars.

🔧 What does it do?
Adds an icon to the Calibre toolbar to access the theme switcher.

Automatically detects .calibre-palette files located in ~/.config/calibre/themes/.

Allows you to select and apply a theme from a popup window.

Applies the color palette using Qt's QPalette.

Apply additional visual styles (such as scroll bars) using .qss files from the plugin's resources/ folder.

Supports multiple themes: dark, light, custom, and any others added manually.

📁 Structure Requirements
Themes must be in ~/.config/calibre/themes/ with an INI file and a .calibre-palette extension.

The .qss styles must be in resources/ within the plugin, with names like scrollbar-dark.qss, scrollbar-light.qss, etc.

The plugin icon must be in images/icon.png.

But the icon doesn't appear in the toolbar. If someone could review it to make it functional, I'd be happy to share the credits.
Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	100
Size:	55.7 KB
ID:	218095  
Attached Files
File Type: zip theme_switcher.zip (4.6 KB, 77 views)

Last edited by dunhill; 09-14-2025 at 06:19 PM.
dunhill is offline   Reply With Quote
Old 09-14-2025, 09:07 PM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 22,280
Karma: 30317806
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Moderator Notice
@dunhill

Asking for help in developing a plugin is not the intended purpose of the Plugin ideas thread. This is where it belongs… Developer's Corner

BR
BetterRed is offline   Reply With Quote
Old 09-15-2025, 07:10 AM   #3
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 929
Karma: 3501168
Join Date: Jan 2017
Location: Poland
Device: Various
Misc issues.
The text file name is very important and must be unique READ:
Code:
plugin-import-name-theme_switcher.txt
I suggest a slight redesign and the use of `common_icons.py` by Grant Drake.
This is just a suggestion, because you can write your own icon handling and add it to the plugin.
Attached Files
File Type: zip Theme Switcher.zip (7.1 KB, 85 views)
BeckyEbook is offline   Reply With Quote
Old 09-15-2025, 01:46 PM   #4
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 985
Karma: 1044682
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
Quote:
Originally Posted by BetterRed View Post
@dunhill

Asking for help in developing a plugin is not the intended purpose of the Plugin ideas thread. This is where it belongs… Developer's Corner

BR

Sorry, I thought the thread your ideas were correct, but you always learn, it won't happen again.

Last edited by dunhill; 09-15-2025 at 01:49 PM.
dunhill is offline   Reply With Quote
Old 09-18-2025, 10:55 PM   #5
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 985
Karma: 1044682
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
Quote:
Originally Posted by BeckyEbook View Post
Misc issues.
The text file name is very important and must be unique READ:
Code:
plugin-import-name-theme_switcher.txt
I suggest a slight redesign and the use of `common_icons.py` by Grant Drake.
This is just a suggestion, because you can write your own icon handling and add it to the plugin.
Thanks for your advice!!
dunhill is offline   Reply With Quote
Old 09-28-2025, 02:36 PM   #6
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 985
Karma: 1044682
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
It seems to me that I have to study this file src/calibre/gui2/tweak_book/editor/themes.py which I suppose is the one that chooses the color settings or calibre-palette files so that it takes effect when selecting the file from the plugin interface.


So far the files appear in the interface but selecting them has no effect.
Attached Thumbnails
Click image for larger version

Name:	2.png
Views:	66
Size:	26.2 KB
ID:	218359  
Attached Files
File Type: zip Theme Switcher.zip (277.4 KB, 44 views)

Last edited by dunhill; 09-28-2025 at 02:38 PM.
dunhill is offline   Reply With Quote
Old 02-04-2026, 08:51 PM   #7
varia
Member
varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'
 
varia's Avatar
 
Posts: 20
Karma: 39844
Join Date: Jan 2026
Device: Samsung Galaxy Tab S10 Lite
Hi, are you still making this plugin?
varia is online now   Reply With Quote
Old Yesterday, 09:37 AM   #8
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 985
Karma: 1044682
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
Quote:
Originally Posted by varia View Post
Hi, are you still making this plugin?
Hi, the plugin is incomplete; the problem is that it doesn't recognize the palette file and apply the palettes. That's why I'm posting it here in case someone can find a solution.
dunhill is offline   Reply With Quote
Old Yesterday, 03:16 PM   #9
varia
Member
varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'
 
varia's Avatar
 
Posts: 20
Karma: 39844
Join Date: Jan 2026
Device: Samsung Galaxy Tab S10 Lite
Quote:
Originally Posted by dunhill View Post
Hi, the plugin is incomplete; the problem is that it doesn't recognize the palette file and apply the palettes. That's why I'm posting it here in case someone can find a solution.
Ohh, okay. I hope this bump helps. I like the idea of this plugin.
varia is online now   Reply With Quote
Old Yesterday, 05:01 PM   #10
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,870
Karma: 7945227
Join Date: Sep 2020
Device: none
attached version is working!
Attached Files
File Type: zip Theme Switcher-1.0.100.zip (280.0 KB, 2 views)
Comfy.n is offline   Reply With Quote
Old Yesterday, 05:38 PM   #11
varia
Member
varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'
 
varia's Avatar
 
Posts: 20
Karma: 39844
Join Date: Jan 2026
Device: Samsung Galaxy Tab S10 Lite
Quote:
Originally Posted by Comfy.n View Post
attached version is working!
Awesome!!
varia is online now   Reply With Quote
Old Yesterday, 07:00 PM   #12
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 985
Karma: 1044682
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
Quote:
Originally Posted by Comfy.n View Post
attached version is working!
Thanks, friend! If you want, we can put it in the plugins threads. Let me know what I missed. I'm going to prepare the translation support, which it already has but doesn't have the files, and in the init section under authoring I'll put this: `author = 'Dunhill & Comfy.n'`. Does that agree?

Last edited by dunhill; Yesterday at 07:07 PM.
dunhill is offline   Reply With Quote
Old Yesterday, 07:54 PM   #13
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,870
Karma: 7945227
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by dunhill View Post
Thanks, friend! If you want, we can put it in the plugins threads. Let me know what I missed. I'm going to prepare the translation support, which it already has but doesn't have the files, and in the init section under authoring I'll put this: `author = 'Dunhill & Comfy.n'`. Does that agree?
Cool, I appreciate the credit!.

Here is an improved version that can switch instantly across palette files, supports importing from zip files (recursively), and skips duplicates.
Attached Files
File Type: zip Theme Switcher-1.0.200.zip (280.9 KB, 3 views)
Comfy.n is offline   Reply With Quote
Old Yesterday, 10:08 PM   #14
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 985
Karma: 1044682
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
Okay, I'll review the file you sent me. I've been working on the translation and replacing "themes" with "palettes" to standardize the usage of the plugin. It will be posted in the plugins threads soon. Thank you for your help.
dunhill is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FootnoteLinker plugin won't work on Sigil 2.42. md029 Sigil 5 05-20-2025 06:45 PM
Plugin code example don't work un_pogaz Plugins 3 03-03-2020 01:25 PM
How does the KOReader Evernote plugin work? maximus83 KOReader 3 01-27-2019 04:27 PM
DRM removal plugin doesn't work joro Conversion 1 01-12-2019 10:54 PM
my first plugin did not work yang738 Development 5 07-24-2014 11:43 PM


All times are GMT -4. The time now is 12:48 AM.


MobileRead.com is a privately owned, operated and funded community.