Skip to content

Instantly share code, notes, and snippets.

@Axel-Erfurt
Axel-Erfurt / Gtk4AudioPlayer.py
Created December 24, 2024 17:51
Python Gtk4 AudioPlayer
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import gi
import time
gi.require_versions({"Gtk": "4.0", "Gdk": "4.0","Adw": "1"})
from gi.repository import Gtk, Gdk, GObject, Gio, Adw, GLib
from pathlib import Path
from mutagen.id3 import ID3, TIT2
@Axel-Erfurt
Axel-Erfurt / Install Calibre.md
Last active December 8, 2024 19:43
Install calibre 7.22 in Mint / LMDE

Download and extract

cd $HOME
mkdir calibre_app && cd calibre_app
wget https://download.calibre-ebook.com/7.22.0/calibre-7.22.0-x86_64.txz
tar Jxvf calibre-7.22.0-x86_64.txz
rm calibre-7.22.0-x86_64.txz
ln -s $HOME/calibre_app/calibre $HOME/.local/bin/calibre
@Axel-Erfurt
Axel-Erfurt / Tascam US122L.md
Last active January 10, 2025 16:25
Tascam US122L in pipewire

Tascam US122L in Linux with pipewire

You can use the Tascam US122L in Linux (pipewire) with simple commands

create Output:

pactl load-module module-alsa-sink device=usbstream:CARD=US122L sink_name=US122L sink_properties=device.description=US122L_Out

create Input:

#EXTM3U
#EXTINF:0,Frasier
https://service-stitcher.clusters.pluto.tv/v1/stitch/embed/hls/channel/62cebf042ffc6d0007c4e59a/master.m3u8?deviceId=channel&deviceModel=web&deviceVersion=1.0&appVersion=1.0&deviceType=rokuChannel&deviceMake=rokuChannel&deviceDNT=1&advertisingId=channel&embedPartner=rokuChannel&appName=rokuchannel&is_lat=1&bmodel=bm1&content=channel&platform=web&tags=ROKU_CONTENT_TAGS&coppa=false&content_type=livefeed&rdid=channel&genre=ROKU_ADS_CONTENT_GENRE&content_rating=ROKU_ADS_CONTENT_RATING&studio_id=viacom&channel_id=channel
#EXTINF:1,Cheers
https://service-stitcher.clusters.pluto.tv/v1/stitch/embed/hls/channel/611e7f224676bf00076a4d8d/master.m3u8?deviceId=channel&deviceModel=web&deviceVersion=1.0&appVersion=1.0&deviceType=rokuChannel&deviceMake=rokuChannel&deviceDNT=1&advertisingId=channel&embedPartner=rokuChannel&appName=rokuchannel&is_lat=1&bmodel=bm1&content=channel&platform=web&tags=ROKU_CONTENT_TAGS&coppa=false&content_type=livefeed&rdid=channel&genre=ROKU_ADS_CONTENT_GENRE&content_rati
@Axel-Erfurt
Axel-Erfurt / CSV_Viewer_Gtk3.py
Last active January 30, 2024 19:37
CSV Viewer Gtk3 Python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("Gdk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from sys import argv
import pandas as pd
@Axel-Erfurt
Axel-Erfurt / gtk4_videoplayer.py
Last active March 25, 2024 10:29
Play Video using the new Gtk.Video
#!/usr/bin/env python3
import sys
import gi
gi.require_version("Gtk", "4.0")
gi.require_version("Gdk", "4.0")
gi.require_version("Adw", "1")
from gi.repository import Gtk, Gdk, Adw, Gio, GLib
from subprocess import check_output, STDOUT
@Axel-Erfurt
Axel-Erfurt / pw_meta.py
Last active December 2, 2024 14:50
set pipewire buffer and sample rate from systray icon
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import gi
gi.require_versions({'Gtk': '3.0', 'AyatanaAppIndicator3': '0.1', 'GLib': '2.0'})
from gi.repository import Gtk, GLib
from gi.repository import AyatanaAppIndicator3 as appindicator
from subprocess import check_output
buffer_sizes = [32, 64, 128, 256, 512, 1024, 2048, 4096]
@Axel-Erfurt
Axel-Erfurt / Gtk3_PDF_Viewer.py
Created May 21, 2022 18:56
View PDF in python Gtk3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import gi
gi.require_version('EvinceView', '3.0')
gi.require_version('EvinceDocument', '3.0')
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
from gi.repository import Gtk, Gdk
from gi.repository import EvinceDocument
from gi.repository import EvinceView
@Axel-Erfurt
Axel-Erfurt / PyQt6_PDFViewer.py
Created March 26, 2022 20:33
Show PDF with PyQt6 QWebengineView
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from PyQt6.QtCore import QUrl
from PyQt6.QtWidgets import QApplication, QMainWindow, QWidget
from PyQt6.QtWebEngineWidgets import QWebEngineView #, QWebEngineSettings
from os import path
class MainWindow(QMainWindow):
def __init__(self):
#EXTM3U
#EXTINF:-1 tvg-name="Canal 26" tvg-logo="https://i.imgur.com/xDjOUuz.png" group-title="Argentina",Canal 26
https://live-edge01.telecentro.net.ar/live/smil:c26.smil/playlist.m3u8
#EXTINF:-1 tvg-name="LN+ Ⓨ" tvg-logo="https://i.imgur.com/vJYzGt1.png" group-title="Argentina",LN+ Ⓨ
https://youtu.be/ns8-5XKA0Ww
#EXTINF:-1 tvg-name="ABC" tvg-logo="https://i.imgur.com/5CVl5EF.png" group-title="Australia",ABC
https://c.mjh.nz/101002210221/
#EXTINF:-1 tvg-name="TVSN" tvg-logo="https://i.imgur.com/p3QCBOo.png" group-title="Australia",TVSN
https://tvsn-i.akamaihd.net/hls/live/261837/tvsn/tvsn_750.m3u8
#EXTINF:-1 tvg-name="ABC Me" tvg-logo="https://i.imgur.com/gBh54wY.png" group-title="Australia",ABC Me