diff options
author | Justine Smithies <justine@smithies.me.uk> | 2023-08-22 19:46:15 +0100 |
---|---|---|
committer | Justine Smithies <justine@smithies.me.uk> | 2023-08-22 19:46:15 +0100 |
commit | 6aaea9cf4b283d41016e60735f52c8feb3cd0c9e (patch) | |
tree | ffc170bb7f267247b60908ac9125fcc02175afd9 /.config/qtile/groups.py | |
parent | 86c0c3694c93025dfec23f27266905c12f446a4e (diff) |
Initial commit
Diffstat (limited to '.config/qtile/groups.py')
-rw-r--r-- | .config/qtile/groups.py | 58 |
1 files changed, 58 insertions, 0 deletions
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")), +]) |