diff options
author | jakob.stendahl <jakob.stendahl@infomedia.dk> | 2024-02-10 19:50:03 +0100 |
---|---|---|
committer | jakob.stendahl <jakob.stendahl@infomedia.dk> | 2024-02-10 19:50:03 +0100 |
commit | da1d7be98a50c8190719994a687cb5af0092f7a9 (patch) | |
tree | b71d6349bffffed6206048c8f0dd345b836f6f4a /linux/qtile/config/config.py.m4 | |
parent | 665eaea830886d8b9aa655e526714e125ce1efce (diff) | |
download | dotfiles-da1d7be98a50c8190719994a687cb5af0092f7a9.tar.gz dotfiles-da1d7be98a50c8190719994a687cb5af0092f7a9.zip |
qtile
Diffstat (limited to 'linux/qtile/config/config.py.m4')
-rw-r--r-- | linux/qtile/config/config.py.m4 | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/linux/qtile/config/config.py.m4 b/linux/qtile/config/config.py.m4 new file mode 100644 index 0000000..d32becd --- /dev/null +++ b/linux/qtile/config/config.py.m4 @@ -0,0 +1,117 @@ +# Copyright (c) 2010 Aldo Cortesi +# Copyright (c) 2010, 2014 dequis +# Copyright (c) 2012 Randall Ma +# Copyright (c) 2012-2014 Tycho Andersen +# Copyright (c) 2012 Craig Barnes +# Copyright (c) 2013 horsik +# Copyright (c) 2013 Tao Sauvage +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +import subprocess, os +from libqtile import bar, layout, qtile, hook, extension, widget +from libqtile.config import Click, Drag, Group, Key, Match, Screen +from libqtile.lazy import lazy +from libqtile.utils import guess_terminal, send_notification + +from qtile_extras.widget import UPowerWidget +from qtile_extras.resources import wallpapers +from libqtile.log_utils import logger + +os.environ["PATH"] += os.pathsep + os.path.expanduser('/var/lib/flatpak/exports/share') +os.environ["PATH"] += os.pathsep + os.path.expanduser('/var/lib/flatpak/exports/share/applications') + +mod = "mod4" +mod1 = "mod1" +terminal = guess_terminal() + +m4_include(`linux/qtile/config/keys.m4.py')m4_dnl + +# Add key bindings to switch VTs in Wayland. +# We can't check qtile.core.name in default config as it is loaded before qtile is started +# We therefore defer the check until the key binding is run by using .when(func=...) +for vt in range(1, 8): + keys.append( + Key( + ["control", "mod1"], + f"f{vt}", + lazy.core.change_vt(vt).when(func=lambda: qtile.core.name == "wayland"), + desc=f"Switch to VT{vt}", + ) + ) + +# 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 +follow_mouse_focus = True +bring_front_click = False +floats_kept_above = True +cursor_warp = False +auto_fullscreen = True +focus_on_window_activation = "smart" +reconfigure_screens = True + +m4_include(`linux/qtile/config/screen.m4.py')m4_dnl +m4_include(`linux/qtile/config/group.m4.py')m4_dnl +m4_include(`linux/qtile/config/layout.m4.py')m4_dnl + +# 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 +follow_mouse_focus = True +bring_front_click = True +floats_kept_above = True +cursor_warp = True +auto_fullscreen = True +focus_on_window_activation = "smart" +reconfigure_screens = True + +# If things like steam games want to auto-minimize themselves when losing +# focus, should we respect this or not? +auto_minimize = True + +# When using the Wayland backend, this can be used to configure input devices. +wl_input_rules = None + +# 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" + +@hook.subscribe.startup_once +def autostart(): + home = os.path.expanduser('~/.config/qtile/autostart.sh') + subprocess.Popen([home]) |