{ pkgs, lib, config, inputs, ... }: { home-manager.users.tzlil = { home.packages = with pkgs; [ ffmpeg gimp transmission xdg-utils xdg-user-dirs ]; xdg = { enable = true; mime.enable = true; mimeApps = { enable = true; defaultApplications = { "application/pdf" = ["${pkgs.zathura}/share/applications/org.pwmt.zathura.desktop"]; "image/png" = ["${pkgs.swayimg}/share/applications/swayimg.desktop"]; "image/jpeg" = ["${pkgs.swayimg}/share/applications/swayimg.desktop"]; }; }; userDirs = { createDirectories = true; desktop = "${config.home-manager.users.tzlil.home.homeDirectory}/desktop"; download = "${config.home-manager.users.tzlil.home.homeDirectory}/downloads"; }; #portal = { # enable = true; # extraPortals = with pkgs; [ # xdg-desktop-portal-wlr # xdg-desktop-portal-gtk # ]; #}; }; programs = { mpv = { enable = true; scripts = with pkgs.mpvScripts; [ mpris thumbnail (pkgs.callPackage ./youtube-quality.nix {}) ]; config = { sub-auto = "fuzzy"; ytdl-raw-options = "write-auto-sub=,sub-lang=en"; profile = "gpu-hq"; hwdec = "vdpau"; screenshot-template = "%F - [%P]v%#01n"; ytdl-format = "bestvideo[height<=?1080]+bestaudio/best"; }; bindings = { # yank video link "Shift+Y" = "run ${ pkgs.writeShellScript "yank-mpv" " ${pkgs.wl-clipboard}/bin/wl-copy $1" } \${path}"; # yank video link with timestamp "Ctrl+y" = "run ${pkgs.writeShellScript "yank-mpv-timestamp" " url=$1 timepos=\${2%.*} url+=$([[ $1 = *\?* ]] && echo \\& || echo \\?)t=$(( timepos / 3600 ))h$(( timepos / 60 ))m$(( timepos % 60 ))s ${pkgs.wl-clipboard}/bin/wl-copy $url "} \${path} \${=time-pos}"; }; }; zathura = { enable = true; options = { selection-clipboard = "clipboard"; }; }; }; }; }