From 6aaea9cf4b283d41016e60735f52c8feb3cd0c9e Mon Sep 17 00:00:00 2001 From: Justine Smithies Date: Tue, 22 Aug 2023 19:46:15 +0100 Subject: Initial commit --- .config/qtile/groups.py | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .config/qtile/groups.py (limited to '.config/qtile/groups.py') diff --git a/.config/qtile/groups.py b/.config/qtile/groups.py new file mode 100644 index 0000000..3f13d52 --- /dev/null +++ b/.config/qtile/groups.py @@ -0,0 +1,58 @@ +# Justine Smithies +# https://github.com/justinesmithies/qtile-wayland-dotfiles + +# Groups configuration + +from libqtile.config import Key, Group +from libqtile.command import lazy +from keys import mod, keys +from workspaces import workspaces +from screens import connected_monitors +from libqtile.config import ScratchPad, DropDown +from os import environ + +# Get terminal from environment variables +terminal = environ.get("TERMINAL") + +groups = [] +for workspace in workspaces: + matches = workspace["matches"] if "matches" in workspace else None + layouts = workspace["layout"] if "layout" in workspace else None + groups.append(Group(workspace["name"], matches=matches, layout=layouts)) + keys.append(Key([mod], workspace["key"], lazy.group[workspace["name"]].toscreen())) + keys.append(Key([mod, "shift"], workspace["key"], lazy.window.togroup(workspace["name"]))) + +for i in range(connected_monitors): + keys.extend([Key([mod, "mod1"], str(i), lazy.window.toscreen(i))]) + +# Append a scratchpad group + +conf = { + "warp_pointer": False, + "on_focus_lost_hide": False, + "opacity": 0.80, +} + +groups.append( + ScratchPad( + "scratchpad", [ + # Define a drop down terminal + # it is placed in the upper third of the screen by default + DropDown( + "term", + terminal + " -a 'Terminal'", + height=0.50, + width=0.50, + x=0.25, + y=0.2, + **conf + ), + + ] + ) +) + +# Define keys to toggle the dropdown terminals +keys.extend([ + Key([mod, "shift"], "Return", lazy.group["scratchpad"].dropdown_toggle("term")), +]) -- cgit v1.2.3