Skip to content

Instantly share code, notes, and snippets.

View sebdelsol's full-sized avatar

sebdelsol

  • Montpellier, France
  • 09:34 (UTC +02:00)
View GitHub Profile
@sebdelsol
sebdelsol / 2-filemanager-title-bar.lua
Last active May 4, 2025 22:58
KOReader userpatch to show info in the file browser title with autorefresh_time
-- KOReader userpatch to show info in the file manager title bar
-- based on https://gist.github.com/hius07/c53bc1ed00e0490cb1a0709c5ed6e735#file-2-fm-title-info-lua
-- Menu added in the File browser menu (1st icon) to change all the settings and rearrange the items in the title bar
-- Items added: Custom text, Brightness Level, Warmth Level, Up time, Time spent awake, Time in suspend
-- Settings added: Auto refresh clock, Custom separator, Number of spaces around separator, Show wifi when disabled, Show path
-- Fix screen rotation (path was disappearing)
-- Arrange items reorders the items the menu
local BD = require("ui/bidi")
local Device = require("device")
@sebdelsol
sebdelsol / 2-statusbar-thin-chapter.lua
Last active May 4, 2025 22:38
KOReader user patch: Thin status bar with chapter markers
local BD = require("ui/bidi")
local Blitbuffer = require("ffi/blitbuffer")
local Device = require("device")
local Geom = require("ui/geometry")
local ProgressWidget = require("ui/widget/progresswidget")
local Math = require("optmath")
local ReaderFooter = require("apps/reader/modules/readerfooter")
local ReaderToc = require("apps/reader/modules/readertoc")
local T = require("ffi/util").template
local _ = require("gettext")
@sebdelsol
sebdelsol / 2-screensaver-cover.lua
Last active May 4, 2025 22:39
KOReader user patch: Screensaver message do not overlap the cover & clear all widgets when the screensaver has no background
-- Add 4 new options @ the end of the "Sleep screen" menu :
-- Close widgets before showing the screensaver
-- Refresh before showing the screensaver
-- Message do not overlap image
-- Center image
-- By default it doesn't change the sleep screen behavior
local ReaderUI = require("apps/reader/readerui")
local Screensaver = require("ui/screensaver")
@sebdelsol
sebdelsol / 2-screensaver-chapter.lua
Last active May 4, 2025 22:39
KOReader user patch: add chapter title and % in the screensaver message
local InfoMessage = require("ui/widget/infomessage")
local Math = require("optmath")
local ReaderUI = require("apps/reader/readerui")
local Screensaver = require("ui/screensaver")
local UIManager = require("ui/uimanager")
local _ = require("gettext")
local expandSpecial_orig = Screensaver.expandSpecial
Screensaver.expandSpecial = function(self, message)
@sebdelsol
sebdelsol / mitmproxy.py
Last active October 8, 2024 16:43
start mitmproxy in background programmatically
import asyncio
import threading
from typing import Any, Callable, Self
from mitmproxy import http
from mitmproxy.addons import default_addons, script
from mitmproxy.master import Master
from mitmproxy.options import Options
@sebdelsol
sebdelsol / sfvip_user_proxy.py
Last active August 20, 2023 10:30
Set/remove a global user proxy for all SFVIP users
# Use Python 3.11 with no dependencies
# set a global user proxy:
# python -m sfvip_user_proxy http://127.0.0.1:8888
# remove the global user proxy:
# python -m sfvip_puser_proxy
import argparse
import json
@sebdelsol
sebdelsol / sfvip_proxy.py
Last active May 3, 2023 13:30
Add an all category in vod and series
# requirements:
# Python >= 3.10
# pip install proxy.py pywin32 requests
# create a shortcut :
# python sfvip_proxy.py --shorcut
# use it !
import argparse
import itertools
import json
@sebdelsol
sebdelsol / sfvip_proxy.py
Last active April 30, 2023 14:02
proxy to search among movies and series in sfvip player
# requirements:
# Python >= 3.10
# pip install proxy.py psgtray psutil pysimplegui pywin32 requests
# use it:
# python sfvip_proxy.py [--port PORT]
# or create the launcher:
# python sfvip_proxy.py --launcher [--port PORT]
# and Launch the proxy with sfvip_proxy.vbs
#!/usr/bin/env python3
from __future__ import annotations
import subprocess
"""
888 888 d8b
888 888 Y8P
888 888