Skip to content

Instantly share code, notes, and snippets.

View toggle-redshift-on-play-kill-restart.lua
-- Toggle redshift when viewing videos with mpv
-- When pausing redshift is reenabled (and disabled again when continuing)
-- If running
if os.execute("pgrep -x redshift >/dev/null") ~= 0 then
rs_enabled = true
else
rs_enabled = false
end
@CreamyCookie
CreamyCookie / auto_update_tags_in_files.py
Last active Sep 23, 2020
QuodLibet Plugin that automatically stores ratings and playcounts in the respective files
View auto_update_tags_in_files.py
# Copyright 2016 Joschua Gandert
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
from traceback import format_exc
View smoothed_duration_weighted_average_rating.py
from dataclasses import dataclass
def hyperbolic_smoother(x, n = 10.0):
"""n determines how strongly smaller values will be magnified"""
return (n + 1) * x / (n * x + 1)
@dataclass
class Track:
View toggle-redshift-on-play.lua
-- Toggle redshift when viewing videos with mpv
-- When pausing redshift is reenabled (and disabled again when continuing)
-- This script assumes that redshift is running
rs_enabled = true
function rs_toggle()
os.execute("pkill -x -USR1 redshift")
end