Skip to content

Instantly share code, notes, and snippets.

-- 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
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:
@CreamyCookie
CreamyCookie / auto_update_tags_in_files.py
Last active September 23, 2020 17:39
QuodLibet Plugin that automatically stores ratings and playcounts in the respective files
# 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
-- 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