2023-07-26 09:56:26 +00:00
|
|
|
# mpv docs:
|
|
|
|
# - <https://mpv.io/manual/master>
|
|
|
|
# - <https://github.com/mpv-player/mpv/wiki>
|
|
|
|
# curated mpv mods/scripts/users:
|
|
|
|
# - <https://github.com/stax76/awesome-mpv>
|
2023-07-26 12:36:01 +00:00
|
|
|
{ pkgs, ... }:
|
2022-11-22 05:28:41 +00:00
|
|
|
|
2022-10-21 15:43:57 +00:00
|
|
|
{
|
2023-04-24 07:22:33 +00:00
|
|
|
sane.programs.mpv = {
|
2023-07-26 12:36:01 +00:00
|
|
|
package = pkgs.wrapMpv pkgs.mpv-unwrapped {
|
|
|
|
scripts = with pkgs.mpvScripts; [
|
2023-07-27 05:47:21 +00:00
|
|
|
mpris
|
2023-07-27 11:45:28 +00:00
|
|
|
# uosc
|
|
|
|
pkgs.mpv-uosc-latest
|
2023-07-26 12:36:01 +00:00
|
|
|
];
|
|
|
|
};
|
2023-04-24 07:22:33 +00:00
|
|
|
persist.plaintext = [ ".config/mpv/watch_later" ];
|
2023-07-26 12:36:01 +00:00
|
|
|
fs.".config/mpv/input.conf".symlink.text = ''
|
|
|
|
# let volume keys be interpreted by the system.
|
|
|
|
# this is important for sxmo.
|
|
|
|
VOLUME_UP ignore
|
|
|
|
VOLUME_DOWN ignore
|
|
|
|
'';
|
2023-05-08 21:41:02 +00:00
|
|
|
fs.".config/mpv/mpv.conf".symlink.text = ''
|
2023-07-26 12:36:01 +00:00
|
|
|
save-position-on-quit=yes
|
|
|
|
keep-open=yes
|
|
|
|
|
|
|
|
# use uosc instead (for On Screen Controls)
|
|
|
|
osc=no
|
|
|
|
# uosc provides its own seeking/volume indicators, so you also don't need this
|
|
|
|
osd-bar=no
|
|
|
|
# uosc will draw its own window controls if you disable window border
|
|
|
|
border=no
|
2023-04-24 07:22:33 +00:00
|
|
|
'';
|
2023-07-26 09:56:26 +00:00
|
|
|
fs.".config/mpv/script-opts/osc.conf".symlink.text = ''
|
|
|
|
# make the on-screen controls *always* visible
|
|
|
|
# unfortunately, this applies to full-screen as well
|
|
|
|
# - docs: <https://mpv.io/manual/master/#on-screen-controller-visibility>
|
2023-07-26 12:36:01 +00:00
|
|
|
# if uosc is installed, this file is unused
|
2023-07-26 09:56:26 +00:00
|
|
|
visibility=always
|
|
|
|
'';
|
2023-07-26 12:36:01 +00:00
|
|
|
fs.".config/mpv/script-opts/uosc.conf".symlink.text = let
|
|
|
|
play_pause_btn = "cycle:play_arrow:pause:no=pause/yes=play_arrow";
|
2023-07-28 00:34:49 +00:00
|
|
|
rev_btn = "command:replay_10:seek -10";
|
2023-07-26 12:36:01 +00:00
|
|
|
fwd_btn = "command:forward_30:seek 30";
|
|
|
|
in ''
|
|
|
|
# docs:
|
|
|
|
# - <https://github.com/tomasklaen/uosc>
|
|
|
|
# - <https://superuser.com/questions/1775550/add-new-buttons-to-mpv-uosc-ui>
|
|
|
|
timeline_style=bar
|
|
|
|
timeline_persistency=paused,audio
|
|
|
|
controls_persistency=paused,audio
|
|
|
|
volume_persistency=audio
|
|
|
|
volume_opacity=0.75
|
|
|
|
|
|
|
|
# speed_persistency=paused,audio
|
|
|
|
# vvv want a close button?
|
|
|
|
top_bar=always
|
|
|
|
top_bar_persistency=paused
|
|
|
|
|
|
|
|
controls=menu,<video>subtitles,<has_many_audio>audio,<has_many_video>video,<has_many_edition>editions,<stream>stream-quality,space,${rev_btn},${play_pause_btn},${fwd_btn},space,speed:1.0,gap,<video>fullscreen
|
|
|
|
|
|
|
|
text_border=6.0
|
|
|
|
font_bold=yes
|
|
|
|
background_text=ff8080
|
|
|
|
foreground=ff8080
|
|
|
|
|
|
|
|
ui_scale=1.0
|
|
|
|
'';
|
2023-07-26 09:56:26 +00:00
|
|
|
|
|
|
|
mime.priority = 200; # default = 100; 200 means to yield to other apps
|
|
|
|
mime.associations."audio/flac" = "mpv.desktop";
|
|
|
|
mime.associations."audio/mpeg" = "mpv.desktop";
|
|
|
|
mime.associations."audio/x-vorbis+ogg" = "mpv.desktop";
|
|
|
|
mime.associations."video/mp4" = "mpv.desktop";
|
|
|
|
mime.associations."video/quicktime" = "mpv.desktop";
|
|
|
|
mime.associations."video/webm" = "mpv.desktop";
|
|
|
|
mime.associations."video/x-matroska" = "mpv.desktop";
|
2023-04-24 07:22:33 +00:00
|
|
|
};
|
2022-10-21 15:43:57 +00:00
|
|
|
}
|
|
|
|
|