question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mpv window doesn't spawn when launched via webtorrent or play-with-mpv apps

See original GitHub issue

When I manually run mpv it opens up normally, while when I run applications like webtorrent or play-with-mpv the window of mpv won’t spawn and it keeps running in background (while I can hear the audio). I don’t have any issues when the same application launched with vlc option.

[farid@unknown ~/.config/qtile]$ ls -la ~/.config/mpv/
total 8
drwx------  2 farid farid 4096 Jan  2 00:20 .
drwxr-xr-x 49 farid farid 4096 Jan  2 00:20 ..
[farid@unknown ~]$

qtile version:

[farid@unknown ~]$ qtile -v
0.19.1.dev10+gda78ea40
[farid@unknown ~]$ pacman -Qi qtile-git
Name            : qtile-git
Version         : 0.19.0.r10.gda78ea40-1
Description     : A full-featured, pure-Python tiling window manager. (git version)
Architecture    : x86_64
URL             : http://www.qtile.org
Licenses        : MIT
Groups          : None
Provides        : qtile
Depends On      : gdk-pixbuf2  glibc  pango  python-cairocffi  python-cffi  python-xcffib
Optional Deps   : alsa-utils: volume widget [installed]
                  canto-daemon: canto widget
                  cmus: cmus widget
                  jupyter_console: interaction with qtile via Jupyter
                  khal: khal_calendar widget
                  libpulse: for pulse_volume and pulseaudio_ffi widget [installed]
                  librsvg: for SVG support in some widgets widgets or wallpapers [installed]
                  lm_sensors: sensors widget [installed]
                  moc: moc widget
                  python-dbus-next: for utils, notifications and several widgets [installed]
                  python-iwlib: wlan widget [installed]
                  python-keyring: imapwidget widget
                  python-mpd2: mpd2widget widget
                  python-psutil: graph, net and memory widget [installed]
                  python-pywlroots: Wayland backend [installed]
                  python-setproctitle: change process name to qtile
                  python-xdg: launchbar widget [installed]
Required By     : None
Optional For    : None
Conflicts With  : qtile
Replaces        : None
Installed Size  : 3.59 MiB
Packager        : Unknown Packager
Build Date      : Thu 30 Dec 2021 04:17:57 PM +04
Install Date    : Thu 30 Dec 2021 04:18:08 PM +04
Install Reason  : Explicitly installed
Install Script  : Yes
Validated By    : None

config.py:


from typing import List  # noqa: F401

from libqtile import bar, layout, widget
from libqtile import qtile, hook
from libqtile.config import Click, Drag, Group, Key, Match, Screen
from libqtile.lazy import lazy
from libqtile.utils import guess_terminal
import subprocess
import os


mod = "mod4"
terminal = "alacritty"

keys = [
    # Switch between windows
    Key([mod], "Left", lazy.layout.left(), desc="Move focus to left"),
    Key([mod], "Right", lazy.layout.right(), desc="Move focus to right"),
    Key([mod], "Down", lazy.layout.down(), desc="Move focus down"),
    Key([mod], "Up", lazy.layout.up(), desc="Move focus up"),
    Key([mod], "space", lazy.layout.next(),
        desc="Move window focus to other window"),

    # Move windows between left/right columns or move up/down in current stack.
    # Moving out of range in Columns layout will create new column.
    Key([mod, "shift"], "Left", lazy.layout.shuffle_left(),
        desc="Move window to the left"),
    Key([mod, "shift"], "Right", lazy.layout.shuffle_right(),
        desc="Move window to the right"),
    Key([mod, "shift"], "Down", lazy.layout.shuffle_down(),
        desc="Move window down"),
    Key([mod, "shift"], "Up", lazy.layout.shuffle_up(), desc="Move window up"),

    # Grow windows. If current window is on the edge of screen and direction
    # will be to screen edge - window would shrink.
    Key([mod, "control"], "Left", lazy.layout.grow_left(),
        desc="Grow window to the left"),
    Key([mod, "control"], "Right", lazy.layout.grow_right(),
        desc="Grow window to the right"),
    Key([mod, "control"], "Down", lazy.layout.grow_down(),
        desc="Grow window down"),
    Key([mod, "control"], "Up", lazy.layout.grow_up(), desc="Grow window up"),
    Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),

    Key([mod, "mod1"], "Left", lazy.layout.grow(),
        desc="Grow window"),
    Key([mod, "mod1"], "Right", lazy.layout.shrink(),
        desc="Shrink window"),
    Key([mod, "mod1"], "Up", lazy.layout.maximize(),
        desc="Maximize window"),
    Key([mod, "mod1"], "Down", lazy.layout.normalize(),
        desc="Normalize window"),

    # Toggle between split and unsplit sides of stack.
    # Split = all windows displayed
    # Unsplit = 1 window displayed, like Max layout, but still with
    # multiple stack panes
    Key([mod, "shift"], "Return", lazy.layout.toggle_split(),
        desc="Toggle between split and unsplit sides of stack"),
    Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),

    # Toggle between different layouts as defined below
    Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
    Key([mod], "w", lazy.window.kill(), desc="Kill focused window"),
    Key([mod, "shift"], "f", lazy.window.toggle_floating(), desc="Toggle floating window mode"),
    Key([mod], "f", lazy.window.toggle_fullscreen(), desc="Toggle fullscreen window mode"),

    Key([mod, "control"], "r", lazy.restart(), desc="Restart Qtile"),
    Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
    Key(["mod1", "control"], "r", lazy.spawn("reboot"), desc="Reboot host"),
    Key(["mod1", "control"], "p", lazy.spawn("poweroff"), desc="Shutdown host"),
    Key(["mod1", "control"], "s", lazy.spawn("systemctl suspend"), desc="Shutdown host"),
    Key([], "Print", lazy.spawn('scrot -s "%Y-%m-%d_%H%M%S_$wx$h_scrot.png" -e "mv $f ~/Screenshots/ -f"'), desc="Take Screnshot"),
    Key([mod], "s", lazy.spawn("switch-audio-source gui"), desc="Spawn a GUI for audio source selection"),
    Key([mod], "h", lazy.hide_show_bar("top")),
    Key([mod], "d", lazy.spawn("dpms"), desc="Spawn a GUI for DPMS setup"),
    Key([mod], "r", lazy.spawn("rofi -show combi"), desc="Spawn a command using a prompt widget"),
]

groups = [Group(i) for i in "123456789"]

for i in groups:
    keys.extend([
        # mod1 + letter of group = switch to group
        Key([mod], i.name, lazy.group[i.name].toscreen(),
            desc="Switch to group {}".format(i.name)),

        # mod1 + shift + letter of group = switch to & move focused window to group
        #Key([mod, "shift"], i.name, lazy.window.togroup(i.name, switch_group=True),
        #    desc="Switch to & move focused window to group {}".format(i.name)),
        # Or, use below if you prefer not to switch to that group.
        # # mod1 + shift + letter of group = move focused window to group
         Key([mod, "shift"], i.name, lazy.window.togroup(i.name), desc="move focused window to group {}".format(i.name)),
    ])

layout_theme = {"border_width": 2,
                "border_focus": "#1793d1",
                "margin": 2,
                "border_normal": "#312e30",
               }

layouts = [
    layout.Columns(**layout_theme, insert_position = 1, fair = True, margin_on_single = -1),
    layout.MonadTall(**layout_theme, single_border_width=0, single_margin=0, new_client_position='bottom'),
    ##layout.Bsp(**layout_theme),
    #layout.Max(**layout_theme),
    # layout.Floating(**layout_theme),
    # Try more layouts by unleashing below layouts.
    # layout.Stack(num_stacks=2),
    # layout.Bsp(),
    # layout.Matrix(),
    # layout.MonadTall(),
    # layout.MonadWide(),
    # layout.RatioTile(),
    # layout.Tile(),
    # layout.TreeTab(),
    # layout.VerticalTile(),
    # layout.Zoomy(),
]

colors = [
          '#dddfff',
          '#202124',
          '#444444',
          '#999999',
          '#ff6673',
          '#bd2c40',
          '#dddddd'
]


widget_defaults = dict(
    font='FiraCode Nerd Font',
    fontsize = 14,
    padding = 2,
    background = colors[1],
    foreground = colors[6],
)


extension_defaults = widget_defaults.copy()

screens = [
    Screen(
        top=bar.Bar(
            [
                widget.GroupBox(
                       margin_y = 3,
                       margin_x = 0,
                       padding_y = 5,
                       padding_x = 5,
                       borderwidth = 3,
                       rounded = False,
                       disable_drag = True,
                       highlight_method = "line",
                       active = colors[0],
                       background = colors[1],
                       highlight_color = colors[2],
                       inactive = colors[3],
                       invert_mouse_wheel = True,
                       ),
                widget.Sep(padding=8, foreground=colors[3]),
                widget.CurrentLayoutIcon(scale = 0.7),
                #widget.WindowName(),
                #widget.TaskList(),
                widget.Spacer(),
                widget.Net(format=' {down}    {up}'),
                widget.Sep(padding=8, foreground=colors[3]),
                widget.CPU(format='CPU: {load_percent}%'),
                widget.Sep(padding=8, foreground=colors[3]),
                widget.Memory(format='RAM:{MemUsed: .0f} MB'),
                widget.Sep(padding=8, foreground=colors[3]),
                widget.NvidiaSensors(format='GPU: {temp}°C', threshold=70),
                widget.Sep(padding=8, foreground=colors[3]),
                widget.GenPollText(update_interval=1, func=lambda: subprocess.check_output(os.path.expanduser("~/.config/qtile/statusbar/network.sh")).decode(), mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(os.path.expanduser('~/.config/qtile/statusbar/network.sh ShowInfo')), 'Button3': lambda: qtile.cmd_spawn('nm-connection-editor')}),
                widget.Sep(padding=8, foreground=colors[3]),
                widget.Clock(format=' %a %Y.%m.%d %H:%M', **widget_defaults),
                widget.Sep(padding=8, foreground=colors[3]),
                widget.GenPollText(update_interval=0.1, func=lambda: subprocess.check_output(os.path.expanduser("~/.config/qtile/statusbar/keyboard_layout.sh")).decode(), mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(os.path.expanduser('~/.config/qtile/statusbar/keyboard_layout.sh next'))}),
                widget.Systray(),
            ],
            size = 20,
        ),
    ),
]

# Drag floating layouts.
mouse = [
    Drag([mod], "Button1", lazy.window.set_position_floating(),
         start=lazy.window.get_position()),
    Drag([mod], "Button3", lazy.window.set_size_floating(),
         start=lazy.window.get_size()),
    Click([mod], "Button2", lazy.window.bring_to_front())
]

dgroups_key_binder = None
dgroups_app_rules = []  # type: List
main = None  # WARNING: this is deprecated and will be removed soon
follow_mouse_focus = True
bring_front_click = True
cursor_warp = False
floating_layout = layout.Floating(float_rules=[
    # Run the utility of `xprop` to see the wm class and name of an X client.
    *layout.Floating.default_float_rules,
    Match(wm_class='confirmreset'),  # gitk
    Match(wm_class='makebranch'),  # gitk
    Match(wm_class='maketag'),  # gitk
    Match(wm_class='ssh-askpass'),  # ssh-askpass
    Match(title='branchdialog'),  # gitk
    Match(title='pinentry'),  # GPG key password entry
])
auto_fullscreen = True
#focus_on_window_activation = "focus"
focus_on_window_activation = "smart"
auto_minimize = True

@hook.subscribe.startup_once
def autostart():
    home = os.path.expanduser('~/.config/qtile/autostart.sh')
    subprocess.call([home])

# XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this
# string besides java UI toolkits; you can see several discussions on the
# mailing lists, GitHub issues, and other WM documentation that suggest setting
# this string if your java app doesn't work correctly. We may as well just lie
# and say that we're a working one by default.
#
# We choose LG3D to maximize irony: it is a 3D non-reparenting WM written in
# java that happens to be on java's whitelist.
wmname = "LG3D"

https://user-images.githubusercontent.com/35117097/147859940-c39beb62-cdc4-451a-99b5-33a908755f89.mp4

qtile.log

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:36 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
elParaguayocommented, Jan 5, 2022

Great. Thanks for confirming.

1reaction
elParaguayocommented, Jan 2, 2022

I’m referring to the error message in your first video clip which shows that qtile crashes because it can’t parse the window name. That error stops a window being created but you’ll still hear the audio.

Read more comments on GitHub >

github_iconTop Results From Across the Web

a mangled title in the mpv window makes all GNOME ... - GitHub
We do the check when operating with specific attributes/APIs. this means that the data can be invalid but when pushed to certain APIs...
Read more >
Why Play With MPV doesn't work on my PC (Pop!_OS 21.04)
But i simply cannot start the play-with-mpv server at the Step 5 of the guide! The Terminal says the command "play-with-mpv" doesn't ......
Read more >
Youtube-dl: Command-line program to download videos
I set this up recently (the 'Play with MPV' method) after noting that viewing YouTube in the browser had a far greater CPU...
Read more >
/g/ - /fwt/ - Friendly Windows Thread - Technology - 4chan
fwt/ - Friendly Windows Thread - "/g/ - Technology" is 4chan's imageboard for discussing computer hardware and software, programming, ...
Read more >
Hydrus Manual
On the Windows and Linux builds, an MPV window is embedded to play video and audio ... it is easy to launch any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found