Commit aebdd4b96ab7e35730f48a60d545016a8298d1eb Parent: 3b425f791066bcea44962e73079e2cf7249dab96 Author: mcol <mcol@posteo.net> Date: 2022-09-09 07:14:02 +0100 Committer: mcol <mcol@posteo.net> Committed: 2022-09-09 07:14:02 +0100 misc changes
wayland.py Modified
@@ -7,12 +7,10 @@ import subprocess from libqtile import hook, qtile -from libqtile.backend import base from libqtile.backend.wayland import InputConfig from libqtile.backend.wayland.xdgwindow import XdgWindow from libqtile.backend.wayland.xwindow import XWindow from libqtile.lazy import lazy -from libqtile.log_utils import logger IS_XEPHYR = int(os.environ.get("QTILE_XEPHYR", 0)) mod = "mod1" if IS_XEPHYR else "mod4" @@ -82,8 +80,16 @@ @hook.subscribe.client_managed def _(win): + # Some other miscellaneous rules if win.name == "Firefox — Sharing Indicator": win.place(win.x + win.borderwidth, 0, win.width, win.height, 0, None) + return + + wm_class = win.get_wm_class() or [] + if win.name == "Navigator" and "libreoffice-startcenter" in wm_class: + x = qtile.current_screen.x + win.place(x, 240, 450, 600, win.borderwidth, win.bordercolor) + return @hook.subscribe.startup_once @@ -103,6 +109,29 @@ hook.subscribe.shutdown(p.terminate) +@hook.subscribe.screen_change +def _(*_): + # Temporary hacky fix for the dell monitor on my desk which for some mysterious + # reason doesn't advertise that it supports any HD mode. Qtile does support setting + # custom modes via the protocol, but neither kanshi nor wdisplays do. So instead, + # I'll detect if that monitor is present and set the desired custom mode here. + for output in qtile.core.outputs: + wlr_output = output.wlr_output + # Not only does this monitor not report modes correctly, it ALSO doesn't report + # a make or model. + if wlr_output.make == wlr_output.model == "<Unknown>": + if wlr_output.current_mode.width == 1024: + break + else: + return + + wlr_output.set_custom_mode(1920, 1080, 0) + # Lastly, while cmd_reconfigure_screens will be fired right after this hook, as it + # gets subscribed to this hook right after the config is loaded, the backend doesn't + # get a change to actually apply the mode, so let's flush it. + qtile.core.flush() + + if IS_XEPHYR: # To adapt to whatever window size it was given @hook.subscribe.startup_once
startup.sh Modified
@@ -29,7 +29,7 @@ # Services kanshi & - pkill wlsunset; wlsunset -t 1000 -T 6700 -l 55.7 -L -3.1 & + wlsunset & swayidle & mpDris2 & sway-mpris-idle-inhibit &
config.py Modified
@@ -110,9 +110,6 @@ my_keys.extend(keys_scratchpad) my_keys.extend(keys_power_menu) -# reload("fullscreen_state") -# from fullscreen_state import toggle_fullscreen_state - def float_to_front(qtile: Qtile) -> None: """Bring all floating windows of the group to front""" @@ -126,7 +123,6 @@ # Window management ([mod, "control"], "q", lazy.window.kill(), "Close window"), ([mod], "f", lazy.window.toggle_fullscreen(), "Toggle fullscreen"), - # ([mod], "g", lazy.function(toggle_fullscreen_state), "Toggle fullscreen state"), ([mod, "shift"], "space", lazy.window.toggle_floating(), "Toggle floating"), ([mod, "shift"], "s", lazy.window.static(), "Make window static"), ( @@ -369,6 +365,7 @@ Match(wm_class="file_progress"), Match(wm_class="imv"), Match(wm_class="lxappearance"), + Match(wm_class="nm-connection-editor"), Match(wm_class="matplotlib"), Match(wm_class="mpv"), Match(wm_class="notification"), @@ -624,29 +621,6 @@ groupboxes[0].bar.draw() -@hook.subscribe.screen_change -def _(*_): - # Temporary hacky fix for the dell monitor on my desk which for some mysterious - # reason doesn't advertise that it supports any HD mode. Qtile does support setting - # custom modes via the protocol, but neither kanshi nor wdisplays do. So instead, - # I'll detect if that monitor is present and set the desired custom mode here. - for output in qtile.core.outputs: - wlr_output = output.wlr_output - # Not only does this monitor not report modes correctly, it ALSO doesn't report - # a make or model. - if wlr_output.make == wlr_output.model == "<Unknown>": - if wlr_output.current_mode.width == 1024: - break - else: - return - - wlr_output.set_custom_mode(1920, 1080, 0) - # Lastly, while cmd_reconfigure_screens will be fired right after this hook, as it - # gets subscribed to this hook right after the config is loaded, the backend doesn't - # get a change to actually apply the mode, so let's flush it. - qtile.core.flush() - - bar_border_width = [0, 3, 0, 3] bar_border_color = ["000000", colours[5], "000000", colours[5]]