Skip to content

Instantly share code, notes, and snippets.

@Artefact2
Artefact2 / dbvol.lua
Last active January 14, 2024 10:51
Decibel volume controls for mpv
-- Override mpv's default volume keybinds with decibel controls
-- Put this file (dbvol.lua) in ~/.config/mpv/scripts/
-- WARNING: positive gain values may cause clipping
-- Author: Romain "Artefact2" Dal Maso <romain.dalmaso@artefact2.com>
-- Released under the WTFPLv2
function round(n)
-- https://stackoverflow.com/a/58411671
return n + (2^52 + 2^51) - (2^52 + 2^51)
#!/usr/bin/sh
# disable some processes from showing
systemctl -t service --plain --no-legend --no-pager list-unit-files --state enabled,disabled | grep -Fv -e freedesktop -e systemd | sed 's/\..*//' > /tmp/sysunits &
systemctl list-unit-files -t service --no-legend --user --state enabled,disabled | sed 's/\..*//' > /tmp/usrunits &
action=$(dmenu <<EOF
start
stop
restart