You are not logged in.
^ Works beautifully
...testing for audio and having a narrow window would be nice though.
EDIT: I tried with a one-liner by using
if $(file --mime-type -b <filename>) | grep audio;then...
...the smaller the window, the smaller the control bar
Last edited by damo (2017-03-16 03:39:52)
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
@damo OK you've convinced me (don't need grep):
[[ $(file --mime-type --brief "$1") = audio* ]] &&...
This seems to work for all audio files except 'opus' which return a mime-type of application/octet-stream for some reason.
Even so, to shrink the window only for files which we've successfully identified as audio still might be worth doing.
EDIT: above code is bash-only.
Did you find the control bar too small at a window size of 450x250?
Last edited by johnraff (2017-03-16 07:13:47)
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
....
Did you find the control bar too small at a window size of 450x250?
It was tiny, on a 1920x1080 HiDP screen res.
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
My screen's 1440x900 where 450x250 isn't particularly small to me.
Would 500x300 be a usable compromise? Still too small?
The default 640x480 looks huge here.
Bash-free mime test:
case "$(file --mime-type --brief "$1")" in
audio*)
geom="$audio_size";;
*)
geom='';;
esac
Last edited by johnraff (2017-03-16 07:35:45)
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
The default 640x480 looks huge here.
640x480 is what man mpv says is the default, but xwininfo reported 960x479 which makes more sense.
The amazing mpv also allows dimensions as a percentage of screen width though.
@damo how does --geometry='35%x25%' look for you?
It's a pity the control bar is scaled to use only part of the window, or it could be smaller still for audio.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
...
@damo how does --geometry='35%x25%' look for you?
It's a pity the control bar is scaled to use only part of the window, or it could be smaller still for audio.
Nice find - works for me
Another approach might be to use different profiles (conffiles) for audio or video?
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
It's a pity the control bar is scaled to use only part of the window, or it could be smaller still for audio.
again something that will change in later versions.
also, if the audio has embedded coverart, the window will autoresize.
this example is audio only, no embedded artwork.
i made the window smaller, but much smaller than that, the font becomes unreadable.
and it seems to insist on the original 16:9(?) aspect ratio.
i don't think mpv will ever become a good default audio player.
but definitely good as a fallback, until $USER installs what they desire.
Last edited by ohnonot (2021-07-02 08:33:01)
Offline
johnraff wrote:It's a pity the control bar is scaled to use only part of the window, or it could be smaller still for audio.
again something that will change in later versions.
also, if the audio has embedded coverart, the window will autoresize.this example is audio only, no embedded artwork.
i made the window smaller, but much smaller than that, the font becomes unreadable.
and it seems to insist on the original 16:9(?) aspect ratio.
http://dt.iki.fi/stuff/mpv.pngi don't think mpv will ever become a good default audio player.
but definitely good as a fallback, until $USER installs what they desire.
The scaling of the control bar (as well as its fonts) can be controlled by setting special scaling parameters in the config or on the command line.
Offline
The scaling of the control bar (as well as its fonts) can be controlled by setting special scaling parameters in the config or on the command line.
I didn't find fonts, but these options got the control bar bigger, and centered, good for audio (with no image):
--lua-opts=osc-scaleforcedwindow=3,osc-valign=0
(click the image to see that it's not really cropped)
Anyway, I'll throw that into bl-mpv in bunsen-configs for now. No-one is obliged to use it, and it will be easy enough to improve later by upgrading bunsen-configs.
ie
#!/bin/sh
# wrapper for mpv to enable use as alternative for bl-media-player
audio_size='35%x25%' # window for playing audio
audio_osc='osc-scaleforcedwindow=3,osc-valign=0' # arrange the on-screen-controller
hash mpv || {
echo "$0: Install mpv to use this script" >&2
exit 1
}
if [ -n "$1" ]
then
if [ "$#" -gt 1 ]
then
title='mpv' # $title is only needed for terminal
else
title="mpv: ${1##*/}"
fi
case "$(file --mime-type --brief "$1")" in
audio*)
geom="$audio_size"
luaopts="$audio_osc";;
*)
geom=''
luaopts='';;
esac
# uncomment the next line to run mpv in a terminal
# x-terminal-emulator -T "$title" -e mpv "$@"
# comment out the next line if you use x-terminal-emulator
mpv --no-terminal --force-window --geometry="$geom" --lua-opts="$luaopts" "$@"
else
mpv --no-terminal --force-window --idle --title='mpv - ${filename:Drop media files here}'
fi
exit
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
OK late to the party, I use a Custom Action in Thunar:
Basic:
Name: MPV
Description: media files
Command: mpv %f --no-border --geometry=60:60
Icon: the MPV icon (From Applications)
Appearance Conditions:
File Pattern: *
Appears if selection contains: Tick Audio and Video Files
Thunar has a direct link to my video folder.
EDIT: === Above is to get a border-less MPV running ===
Since MPV is my only player here a double click on a files starts it with a window.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline