Skip to content

Instantly share code, notes, and snippets.

View sebdelsol's full-sized avatar

sebdelsol

  • Montpellier, France
  • 04:29 (UTC +02:00)
View GitHub Profile
@sebdelsol
sebdelsol / configuration.lua
Created May 7, 2025 15:13
[assistant.koplugin] configuration.lua for gemini
local GEMINI_API_KEY = "here is my key"
local MY_LANGUAGE = "English"
local CONFIGURATION = {
-- Choose your preferred AI provider: "anthropic", "openai", "gemini", "openrouter", "deepseek" or "ollama"
provider = "gemini",
-- Provider-specific settings
provider_settings = {
anthropic = {
@sebdelsol
sebdelsol / 2-change-status-bar-color.lua
Last active June 27, 2025 10:52
KOReader user patch: change status bar progress color
-- MOVED TO https://github.com/sebdelsol/KOReader.patches
-- based on https://gist.github.com/IntrovertedMage/d759ff214f799cfb5e1f8c85daab6cae
-- Menu added in the Reader menu:
-- settings > Status bar > Progress bar > Thickness, height & colors > Read color
-- settings > Status bar > Progress bar > Thickness, height & colors > Unread color
local Blitbuffer = require("ffi/blitbuffer")
local Math = require("optmath")
local ProgressWidget = require("ui/widget/progresswidget")
@sebdelsol
sebdelsol / 2-statusbar-better-compact.lua
Last active May 26, 2025 15:26
KOReader userpatch for better compact items status bar
-- **MOVED to https://github.com/sebdelsol/KOReader.patches**
-- enhance compact items:
-- use the better frontlight icons, and add the battery percentage
-- better separator for title/chapter/author in compact mode with no separator
local ReaderFooter = require("apps/reader/modules/readerfooter")
local userpatch = require("userpatch")
local footerTextGeneratorMap = userpatch.getUpValue(ReaderFooter.applyFooterMode, "footerTextGeneratorMap")
local symbol_prefix = userpatch.getUpValue(footerTextGeneratorMap.frontlight, "symbol_prefix")
@sebdelsol
sebdelsol / 2-reference-page-count.lua
Last active May 26, 2025 15:26
KOReader user patch: fix reference pages if missing. Gives the actual number of pages in the status bar
-- **MOVED to https://github.com/sebdelsol/KOReader.patches**
-- fallback if there's no source for reference pages
-- gives the actual number of pages in the status bar page_progress & page_left_book instead of a label
local ReaderFooter = require("apps/reader/modules/readerfooter")
local ReaderPageMap = require("apps/reader/modules/readerpagemap")
local userpatch = require("userpatch")
local footerTextGeneratorMap = userpatch.getUpValue(ReaderFooter.applyFooterMode, "footerTextGeneratorMap")