Exemplo n.º 1
0
def append_groups_keys(array):
    for monitor_index, group_name, spawn in array:
        group_object = Group(name=group_name)

        if spawn is not None:
            group_object.spawn = spawn

        groups.append(group_object)

        keys.append(
            Key([mod], group_name,
                lazy.group[group_name].toscreen(monitor_index, toggle=False),
                lazy.to_screen(monitor_index)))

        keys.append(
            Key([mod, "shift"], group_name, lazy.window.togroup(group_name)))
Exemplo n.º 2
0
def init_groups():
    global num_screens
    global mod

    pinned_groups = ['1234567890'] if num_screens == 1 else ['12345', '67890']
    all_groups = ''.join(pinned_groups)
    groups = [Group(i) for i in all_groups]
    group_keys = []

    for j, names in enumerate(pinned_groups):
        group_keys += [
            Key([mod], i, lazy.to_screen(j),
                lazy.group[i].toscreen(toggle=False)) for i in names
        ]

    group_keys += [
        Key([mod, 'shift'], i, lazy.window.togroup(i)) for i in all_groups
    ]

    return pinned_groups, groups, group_keys
Exemplo n.º 3
0
def my_keys():
    return [
        # Launch terminal
        Key([mod], 'Return', lazy.spawn(my_term)),

        # Toggle between different layouts as defined below
        Key([mod], 'Tab', lazy.next_layout()),
        Key([mod, 'shift'], 'Tab', lazy.prev_layout()),

        # Kill a window
        Key([mod, 'shift'], 'w', lazy.window.kill()),

        # Kill and restart qtile
        Key([mod, 'control'], 'q', lazy.shutdown()),
        Key([mod, 'control'], 'r', lazy.restart()),

        # Switch keyboard focus from monitors
        Key([mod], 'q', lazy.to_screen(1)),
        Key([mod], 'w', lazy.to_screen(0)),

        # Switch window focus to other pane(s) of stack
        Key([mod], 'space', lazy.layout.next()),

        # Switch between windows in current stack pane
        Key([mod], 'j', lazy.layout.down()),
        Key([mod], 'k', lazy.layout.up()),
        Key([mod], 'l', lazy.layout.right()),
        Key([mod], 'h', lazy.layout.left()),
        Key([mod], 'Up', lazy.window.bring_to_front()),
        Key([mod], 'Down', lazy.window.toggle_minimize()),

        # Move windows in pane
        Key([mod, 'shift'], 'j', lazy.layout.shuffle_down()),
        Key([mod, 'shift'], 'k', lazy.layout.shuffle_up()),
        Key([mod, 'shift'], 'l', lazy.layout.shuffle_right()),
        Key([mod, 'shift'], 'h', lazy.layout.shuffle_left()),

        # Swap panes of split stack
        Key([mod, 'shift'], 'space', lazy.layout.rotate(), lazy.layout.flip()),
        Key([mod, 'shift'], 'Return', lazy.layout.toggle_split()),

        # Window size controls
        Key([mod, 'control'], 'l', lazy.layout.grow_right(),
            lazy.layout.grow(), lazy.layout.increase_ratio(),
            lazy.layout.delete()),
        Key([mod, 'control'], 'h', lazy.layout.grow_left(),
            lazy.layout.shrink(), lazy.layout.decrease_ratio(),
            lazy.layout.add()),
        Key([mod, 'control'], 'k', lazy.layout.grow_up(), lazy.layout.grow(),
            lazy.layout.decrease_nmaster()),
        Key([mod, 'control'], 'j', lazy.layout.grow_down(),
            lazy.layout.shrink(), lazy.layout.increase_nmaster()),

        # Toggle fullscreen and floating
        Key([mod, 'shift'], 'f', lazy.window.toggle_floating()),
        Key([mod, 'shift'], 'm', lazy.window.toggle_fullscreen()),

        # Toggle maximized and normalize pane sizes
        Key([mod], 'm', lazy.window.toggle_maximize()),
        Key([mod], 'n', lazy.layout.normalize()),

        # Open file manager
        Key([mod], 'e', lazy.spawn(my_filemanager)),

        # Rofi commands
        Key([mod], 's', lazy.spawn('rofi -show drun')),
        Key(['mod1'], 'Tab', lazy.spawn('rofi -show windowcd')),

        # Launch Utilities
        Key([mod], 'r', lazy.spawncmd()),
        Key([mod], 'c', lazy.spawn('galculator')),

        # DropDown
        Key([mod], 'd', lazy.group['scratchpad'].dropdown_toggle('term')),
        Key([mod], 'o', lazy.group['scratchpad'].dropdown_toggle('mpd')),
        Key([mod], 'i', lazy.group['scratchpad'].dropdown_toggle('mutt')),
        Key([mod], 'u', lazy.group['scratchpad'].dropdown_toggle('top')),
    ]
Exemplo n.º 4
0
    name, kwargs, _, letter = group_t
#    keys.append(Key([mod], str(i), lazy.group[name].toscreen()))        # Switch to another group
    keys.append(Key([mod], letter, bring_group_to_front(name)))# Send current window to another group
    keys.append(Key([mod, "shift"], letter, bring_group_to_screen(i-1)))        # Switch to another group
    keys.append(Key([mod, "control"], letter, lazy.window.togroup(name))) # Send current window to another group


def current_window_to_screen_lazy_callback(screen_num:int):
    def callback(qtile):
        qtile.current_window.toscreen(screen_num)
    return lazy.function(callback)

for i,key in enumerate("zxc"):
    keys.extend([
        # alt + letter of group = switch to group
        Key([mod], key, lazy.to_screen(i)),

        # alt + shift + letter of group = switch to & move focused window to group
        # Key([mod, "shift"], key, lazy.window.toscreen(i))
    ])

layout_theme = {"border_width": 2,
                "margin": 5,
                "border_focus": "e1acff",
                "border_normal": "1D2330"
                }

layouts = [
    layout.bsp.Bsp(**layout_theme),
    layout.TreeTab(
         font = "Ubuntu",
Exemplo n.º 5
0
    Key([mod], "d", lazy.spawn(terminal), desc="Launch terminal"),

    # Toggle between different layouts as defined below
    Key([mod], "s", lazy.next_layout(), desc="Toggle between layouts"),

    # Close window
    Key([mod], "q", lazy.window.kill(), desc="Kill focused window"),

    # Restart qtile
    Key([mod, "control"], "w", lazy.restart(), desc="Restart qtile"),

    # Shutdown qtile
    Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown qtile"),

    ### Switch focus to specific monitor
    Key([mod, "control"], "z", lazy.to_screen(0), desc="Focus to monitor 1"),
    Key([mod, "control"], "x", lazy.to_screen(1), desc="Focus to monitor 2"),

    ### Switch focus of monitors
    Key([mod, "control"],
        "s",
        lazy.next_screen(),
        desc="Move focus to next monitor"),
    Key([mod, "control"],
        "a",
        lazy.prev_screen(),
        desc="Move focus to prev monitor"),
]

groups = [Group(i) for i in "123456789"]
Exemplo n.º 6
0
        lazy.layout.grow_right(),
        desc="Grow focused Window right",
    ),
    Key([mod, ctrl],
        "j",
        lazy.layout.grow_down(),
        desc="Grow focused Window down"),
    Key([mod, ctrl], "k", lazy.layout.grow_up(),
        desc="Grow focused Window up"),
])

keys.extend([
    # Switch focus between monitors
    Key([mod], "comma", lazy.prev_screen(), desc="Move focus to prev Screen"),
    Key([mod], "period", lazy.next_screen(), desc="Move focus to next Screen"),
    Key([mod], "F1", lazy.to_screen(0), desc="Move focus to 1st Screen"),
    Key([mod], "F2", lazy.to_screen(1), desc="Move focus to 2nd Screen"),
])

keys.extend([
    # Switch between layouts
    Key([mod], "space", lazy.next_layout(), desc="Switch Laouts"),
    Key([mod, shift], "space", lazy.prev_layout(), desc="Switch Laouts"),
    Key([mod, alt],
        "space",
        lazy.to_layout_index(0),
        desc="Switch to default Layout"),
    Key([mod], "equal", lazy.layout.normalize(),
        desc="Reset all window sizes"),
    # Toggle between split and unsplit sides of stack.
    # Split = all windows displayed
Exemplo n.º 7
0
    Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),

    # 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, "shift"], "c", lazy.window.kill(), desc='Kill active window'),
    Key([mod], "w", lazy.to_screen(0), desc='Keyboard focus to monitor 1'),
    Key([mod], "e", lazy.to_screen(1), desc='Keyboard focus to monitor 2'),
    Key([mod], "period", lazy.next_screen(),
        desc='Move focus to next monitor'),
    Key([mod], "comma", lazy.prev_screen(), desc='Move focus to prev monitor'),

    # Auto Keys
    Key([], "XF86AudioMute", lazy.spawn("amixer -q set Master toggle")),
    Key([], "XF86AudioLowerVolume",
        lazy.spawn("amixer -c 0 sset Master 1- unmute")),
    Key([], "XF86AudioRaiseVolume",
        lazy.spawn("amixer -c 0 sset Master 1+ unmute")),
    Key([mod, "control"], "r", lazy.restart(), desc="Restart Qtile"),
    Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
    #Key([mod], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"),
    Key([mod],
Exemplo n.º 8
0
    Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
    Key([mod, "shift"], "t", 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, "shift"], "q", lazy.window.kill(), desc="Kill focused window"),

    Key([mod, "shift"], "r", lazy.reload_config(), desc="Reload the config"),
    Key([mod, "shift"], "e", lazy.shutdown(), desc="Shutdown Qtile"),
    Key([mod], "r", lazy.spawncmd(),
        desc="Spawn a command using a prompt widget"),

    # Switch focus of monitors
    # monitor 1 - laptop screen
    # monitor 2 - external HDMI
    Key([mod], "comma", lazy.to_screen(0), desc="Keyboard focus to monitor 1"),
    Key([mod], "period", lazy.to_screen(1), desc="Keyboard focus to monitor 2"),

    # App launchers
    Key([mod], "d", lazy.spawn(scripts + "/rofi-launch.sh"), desc="Launch Rofi drun"),

    # Switch keyboard layout
    Key([mod, "shift"], "space", lazy.spawn(scripts + "/kbd-layout-switcher.sh"), desc="Change keyboard layout"),

    # Media keys
    Key([], "XF86MonBrightnessDown", lazy.spawn("light -U 10")),
    Key([], "XF86MonBrightnessUp", lazy.spawn("light -A 10")),
    Key([], "XF86AudioRaiseVolume", lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ +10%")),
    Key([], "XF86AudioLowerVolume", lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ -10%")),
    Key([], "XF86AudioMute", lazy.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")),
    Key([], "XF86AudioMicMute", lazy.spawn("pactl set-source-mute @DEFAULT_SOURCE@ toggle")),
Exemplo n.º 9
0
     desc="Launch Password Manager"),
 Key([
     meta,
 ],
     "Left",
     lazy.screen.prev_group(),
     desc="Go to then group on the left"),
 Key([
     meta,
 ],
     "Right",
     lazy.screen.next_group(),
     desc="Go to then group on the right"),
 Key([
     meta,
 ], "h", lazy.to_screen(0), desc="Go to left screen"),
 Key([
     meta,
 ], "l", lazy.to_screen(1), desc="Go to right screen"),
 Key([
     meta,
     shift,
 ],
     "h",
     lazy.layout.shuffle_left(),
     desc="Move window left"),
 Key([
     meta,
     shift,
 ],
     "l",
Exemplo n.º 10
0
        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, "shift"], "c", lazy.window.kill(), desc="Kill focused window"),
    Key([mod],
        "t",
        lazy.window.toggle_floating(),
        desc="Toggle tiled/floating"),
    Key([mod], "f", lazy.window.toggle_fullscreen(), desc="Toggle fullscreen"),
    Key([mod, "control"], "r", lazy.restart(), desc="Restart qtile"),
    Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown qtile"),
    Key([mod], "r", lazy.spawn(launcher), desc="Open rofi"),
    Key([mod], "w", lazy.to_screen(0), desc="Focus screen 0"),
    Key([mod], "e", lazy.to_screen(1), desc="Focus screen 1"),
    Key([mod, "shift"],
        "w",
        lazy.window.toscreen(0),
        desc="Move window to screen 0"),
    Key([mod, "shift"],
        "e",
        lazy.window.toscreen(1),
        desc="Move window to screen 1"),
]

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

for i in groups:
    keys.extend([
Exemplo n.º 11
0
    """
    def cb(qtile: Qtile):
        screens = qtile.screens

        if n < len(screens):
            # find what group it is on
            gp = screens[n].group.name

            if qtile.current_window:
                qtile.current_window.togroup(gp, switch_group=False)

    return lazy.function(cb)


keys.extend(
    add_key([mod, ""], k, "Go to screen {}".format(ii), lazy.to_screen(ii))
    for ii, k in enumerate(('w', 'e', 'r'))
)

keys.extend(
    add_key([mod, "shift"], k, "Go to screen {}".format(ii), send_to_screen(ii))
    for ii, k in enumerate(('w', 'e', 'r'))
)

# # Auto bind the key to switch to group
# from libqtile.dgroups import simple_key_binder
# dgroups_key_binder = simple_key_binder(mod)


# Default theme
myDefault_themes = dict(
Exemplo n.º 12
0
        lazy.layout.shrink(),
        desc="Decrease window size"),
    Key([mod, "control"], "k", lazy.layout.grow(),
        desc="Increase window size"),
    # Toggle between different layouts as defined below
    Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
    # Orientation of workspace
    Key([mod], "v", lazy.layout.flip(), desc="Flip layout"),
    Key([mod], "f", lazy.window.toggle_fullscreen(), desc="Fullscreen"),
    # Floating mode
    Key([mod, "shift"],
        "space",
        lazy.window.toggle_floating(),
        desc="Toggle floating"),
    # Movement between screens
    Key([mod], "w", lazy.to_screen(0), desc="Switch to screen 0."),
    Key([mod], "e", lazy.to_screen(1), desc="Switch to screen 1."),
]

# ========== Workspace configuration ==========
# Workspaces names, keybinds and default layouts
workspaces = [
    ["1", {
        "label": "",
        "layout": "stack"
    }],
    ["2", {
        "label": "",
        "layout": "monadtall"
    }],
    ["3", {
Exemplo n.º 13
0
    # Switch between groups
    ([_mod], ['t'], lazy.screen.prev_group(),
        'Move to the group on the left'),
    ([_mod, 'control'], 'Left', lazy.screen.prev_group(),
        'Move to the group on the left'),
    ([_mod], ['n'], lazy.screen.next_group(),
        'Move to the group on the right'),
    ([_mod, 'control'], 'Right', lazy.screen.next_group(),
        'Move to the group on the right'),
    ([_alt], 'Tab', lazy.screen.toggle_group(),
        'Move to the last visited group'),

    # Screens
    # Switch focus of monitors
    ([_mod, 'control'], 'quotedbl', lazy.to_screen(0),
        'Set focus to monitor 1'),
    ([_mod, 'control'], 'guillemotleft', lazy.to_screen(1),
        'Set focus to monitor 2'),
    ([_mod], 'g', lazy.next_screen(), 'Set focus to next monitor'),
    ([_mod], 'h', lazy.prev_screen(), 'Set focus to prev monitor'),
    # Move to specific monitor
    ([_mod, 'control', 'shift'], 'quotedbl',
        [lazy.window.toscreen(0),
         lazy.to_screen(0)],
        'Move to monitor 1'),
    ([_mod, 'control', 'shift'], 'guillemotleft',
        [lazy.window.toscreen(1),
         lazy.to_screen(1)],
        'Move to monitor 2')]
Exemplo n.º 14
0
    Key("M-S-<Left>",
        lazy.layout.shuffle_left(),
        desc="Move window up in current stack "),
    Key("M-S-<Right>",
        lazy.layout.shuffle_right(),
        desc="Move window down in current stack "),
    Key("M-<Tab>",
        lazy.layout.flip(),
        desc="Switch window focus to other pane(s) of stack"),
    Key("M-<KP_Add>", lazy.layout.grow(), desc="Expand window"),
    Key("M-<KP_Subtract>", lazy.layout.shrink(), desc="Shrink window"),
    Key("M-<End>", lazy.window.toggle_floating(), desc="Toggles floating"),
    # TODO: promote (swap with master)

    # Layout navigation
    Key("M-A-<Left>", lazy.to_screen(0), desc="Move focus to screen 0"),
    Key("M-A-<Right>", lazy.to_screen(1), desc="Move focus to screen 1"),
    Key("M-<Up>", lazy.layout.up(), desc="Move focus up in stack pane"),
    Key("M-<Down>", lazy.layout.down(), desc="Move focus down in stack pane"),
    Key("M-<Left>", lazy.layout.left(), desc="Move focus down in stack pane"),
    Key("M-<Right>", lazy.layout.right(), desc="Move focus up in stack pane"),
    # TODO: Move between screens with M-<Left> and M-<Right>, when appropriate

    # Applications
    Key("M-p", lazy.spawn("rofi -show drun -show-icons"), desc="Desktop Apps"),
    Key("M-S-p", lazy.spawn("rofi -show run"), desc="Prompt"),
    Key("M-A-p", lazy.spawn("rofi -show ssh"), desc="SSH Menu"),
    Key("M-C-p", lazy.spawn("Scripts/pass-qr.sh"), desc="pass and QR-code"),
    Key("M-n",
        lazy.spawn("Scripts/notifications-panel.sh"),
        desc="Notification Panel"),
Exemplo n.º 15
0
 Key([mod],
     "space",
     lazy.layout.next(),
     desc='Switch window focus to other pane(s) of stack'),
 Key([mod],
     "Return",
     lazy.spawn(myTerm),
     desc='Launches My terminal with URXVT'),
 Key([mod], "Tab", lazy.next_layout(), desc='Toggle through layouts'),
 Key([mod], "w", lazy.window.kill(), desc='Kill active window'),
 Key([mod, "control"], "r", lazy.restart(), desc='Restart Qtile'),
 Key([mod, "control"], "q", lazy.shutdown(), desc='Shutdown Qtile'),
 Key([mod], "r", lazy.spawncmd(), desc='Run command bar'),
 Key([mod, "shift"],
     "m",
     lazy.to_screen(0),
     desc='Keyboard focus to monitor1'),
 Key([mod, "shift"],
     "n",
     lazy.to_screen(1),
     desc='Keyboard focus to monitor2'),
 Key([mod], "f", lazy.spawn(myTerm + " -e ranger"), desc='File Manager'),
 Key([mod],
     "n",
     lazy.layout.normalize(),
     desc='Normalize window size ratios'),
 Key([mod],
     "m",
     lazy.layout.maximize(),
     desc='Toggle window betwwen minimin and maximum sizes'),
 Key([mod],
Exemplo n.º 16
0
        desc="Move window left in current stack "),
    Key([mod, "shift"],
        key_down,
        lazy.layout.shuffle_down(),
        desc="Move window down in current stack "),
    Key([mod, "shift"],
        key_up,
        lazy.layout.shuffle_up(),
        desc="Move window up in current stack "),
    Key([mod, "shift"],
        key_right,
        lazy.layout.shuffle_right(),
        desc="Move window right in current stack "),

    # Toggle screen
    Key([mod], "o", lazy.to_screen(0)),
    Key([mod], "p", lazy.to_screen(1)),

    # Switch window focus to other pane(s) of stack
    # Key([mod], "space", lazy.layout.next(),
    #     desc="Switch window focus to other pane(s) of stack"),

    # Swap panes of split stack
    # Key([mod, "shift"], "space", lazy.layout.rotate(),
    #     desc="Swap panes of split stack"),

    # 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(),
Exemplo n.º 17
0
from typing import List  # noqa: F401
from os import path
from libqtile import bar, layout, widget, hook
from libqtile.config import Click, Drag, Group, Key, Match, Screen
from libqtile.lazy import lazy

mod = "mod4"
terminal = "alacritty"
scripts = {
    "autostart": path.expanduser("~/.config/qtile/scripts/autostart.sh"),
    "lock_screen": path.expanduser("~/.config/qtile/scripts/lock.sh"),
}

keys = [
    # Change screen focus
    Key([mod], "a", lazy.to_screen(0), desc="Focus primary screen"),
    Key([mod], "s", lazy.to_screen(1), desc="Focus secondary screen"),
    # Switch between windows
    Key([mod], "h", lazy.layout.left(), desc="Move focus to left"),
    Key([mod], "l", lazy.layout.right(), desc="Move focus to right"),
    Key([mod], "j", lazy.layout.down(), desc="Move focus down"),
    Key([mod], "k", 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"], "h", lazy.layout.shuffle_left(),
        desc="Move window to the left"),
    Key([mod, "shift"], "l", lazy.layout.shuffle_right(),
        desc="Move window to the right"),
Exemplo n.º 18
0
def get_keys() -> List[Key]:
    """Returns a list of Key bindings"""
    my_keys = [
        # Switch between windows in current stack pane
        Key([MOD], "j", lazy.layout.down()),
        Key([MOD], "k", lazy.layout.up()),

        # Move windows up or down in current stack
        Key([MOD, "shift"], "j", lazy.layout.shuffle_down()),
        Key([MOD, "shift"], "k", lazy.layout.shuffle_up()),

        # change window size
        Key([MOD], "h", lazy.layout.grow()),
        Key([MOD], "l", lazy.layout.shrink()),

        # Toggle floating
        Key([MOD], "n", lazy.window.toggle_floating()),
        Key([MOD, 'shift'], "m", lazy.window.toggle_fullscreen()),

        # Switch window focus to other pane(s) of stack
        Key([MOD], "space", lazy.layout.next()),

        # Toggle between different layouts as defined below
        Key([MOD], "Tab", lazy.next_layout()),

        # Close Windows
        Key([MOD], "q", lazy.window.kill()),

        # Restart and Shutdown Qtile
        Key([MOD, "shift"], "r", lazy.restart()),
        Key([MOD, "shift"], "q", lazy.shutdown()),

        # Screen focus
        Key([ALT], "h", lazy.to_screen(0)),
        Key([ALT], "l", lazy.to_screen(1)),

        # screen brightness
        Key([], "XF86MonBrightnessUp", lazy.spawn("xbacklight -inc 10")),
        Key([], "XF86MonBrightnessDown", lazy.spawn("xbacklight -dec 10")),

        # Audio Control
        Key([], "XF86AudioRaiseVolume",
            lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ +10%")),
        Key([], "XF86AudioLowerVolume",
            lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ -10%")),
        Key([], "XF86AudioMute",
            lazy.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")),
        Key([], "XF86AudioPlay", lazy.spawn("playerctl play-pause")),
        Key([], "XF86AudioNext", lazy.spawn("playerctl next")),
        Key([], "XF86AudioPrev", lazy.spawn("playerctl previous")),

        # Key bindings for applications
        Key([MOD], "Return", lazy.spawn(f"{TERM}")),
        Key([MOD], "w", lazy.spawn("firefox")),
        Key([CTRL], "space", lazy.spawn("dmenu_run -h 30")),
        Key([ALT], "Tab", lazy.spawn("rofi -show window")),
        Key([MOD], "m", lazy.spawn("spotify")),
        Key([MOD], "f", lazy.spawn("pcmanfm")),
        Key([MOD], "z", lazy.spawn(f"{TERM} -e nvim /home/ben/.zshrc")),
        Key([MOD], "F3",
            lazy.spawn(f"{TERM} -e nvim /home/ben/.config/qtile/config.py")),
        Key([MOD], "F1", lazy.spawn("sgtk-menu -f -a")),
        Key([MOD, "shift"], "l", lazy.spawn("slock")),
        Key([MOD], "p", lazy.spawn("/home/ben/scripts/power.sh")),
        Key([MOD, "shift"], "b", lazy.spawn("/home/ben/scripts/bluetooth.sh")),
        Key([MOD, "shift"], "v", lazy.spawn("/opt/cisco/anyconnect/bin/vpnui"))
    ]
    return my_keys
Exemplo n.º 19
0
    Key([mod], "x", lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ 125%")),
    Key([], "XF86AudioPrev", lazy.spawn("playerctl previous")),
    Key([], "XF86AudioPlay", lazy.spawn("playerctl play-pause")),
    Key([], "XF86AudioNext", lazy.spawn("playerctl next")),
    Key([], "Print",
        lazy.spawn(f"flameshot full -c -p {HOME}/Pictures/screenshots/")),
    Key(["shift"], "Print", lazy.spawn("flameshot gui")),
    Key([mod], "e", lazy.spawn("pcmanfm")),
    Key([mod], "g", lazy.spawn("chromium")),
    Key([mod], "p", lazy.spawn("pavucontrol")),
    Key([mod], "d",
        lazy.spawn(
            "rofi -combi-modi window,drun -theme android_notification -font \"iosevkasemibold 12\" -show combi -icon-theme \"Paper\" -show-icons"
        )),
    Key([mod, "shift"], "x", lazy.spawn("i3lock-fancy && systemctl suspend")),
    Key([mod], "q", lazy.to_screen(0)),
    Key([mod], "a", lazy.to_screen(1))
]
column_layout = layout.Columns(border_width=3, margin=8)
groups = [
    Group("term",
          layouts=[column_layout],
          matches=[Match(wm_class="Alacritty")]),
    Group("web",
          matches=[
              Match(wm_class="firefox"),
              Match(wm_class="qutebrowser"),
              Match(wm_class="brave-browser"),
              Match(wm_class="chromium"),
              Match(wm_class="Pale moon")
          ],
Exemplo n.º 20
0
# groups = [
#             Group("a"),
#             Group("b")
# ]

if DEBUG: print("------ MONITOR CONFIG DONE ----------")
#--------------------------------------------------------------------------------------------------
# make group shortcuts find screens as per monitor configuration
# -------------------------------------------------------------------------------------------------

cont = 0
for monitor_index in GROUP_NAME_LIST:
    for n in GROUP_NAME_LIST[monitor_index]:
        cont += 1
        keys.append(
            Key([mod], str(cont), lazy.to_screen(monitor_index),
                lazy.group[n].toscreen()))
        keys.append(Key([mod, "shift"], str(cont), lazy.window.togroup(n)))

##### DEFAULT THEME SETTINGS FOR LAYOUTS #####
layout_theme = {
    "border_width": 2,
    "margin": 4,
    "border_focus": "AD69AF",
    "border_normal": "1D2330"
}

##### THE LAYOUTS #####
layouts = [
    layout.Max(),
    layout.Stack(num_stacks=2),
Exemplo n.º 21
0
        start=lazy.window.get_position(),
    ),
    Drag(
        [mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()
    ),
]

for g in groups:
    keys.extend(
        [
            # mod + number of group = switch to group
            Key(
                [mod],
                g.name,
                lazy.group[g.name].toscreen(int(g.screen_affinity), toggle=True),
                lazy.to_screen(int(g.screen_affinity)),
                desc="Switch to group {}".format(g.name),
            ),
            # # mod + shift + number 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 + number of group = move focused window to group
            Key(
                [mod, "shift"],
                g.name,
                lazy.window.togroup(g.name),
Exemplo n.º 22
0
    Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
    Key([mod],
        "p",
        lazy.spawncmd(),
        desc="Spawn a command using a prompt widget"),
    Key([mod],
        "m",
        lazy.layout.maximize(),
        desc="toggle maximize and minimize windows"),
    Key([mod], "f", lazy.window.toggle_fullscreen(), desc="toggle fullscreen"),
    Key([mod, "shift"],
        "f",
        lazy.window.toggle_floating(),
        desc="toggle floating"),
    # Switch focus to a specific monitor in a multiple monitor layout
    Key([mod], "w", lazy.to_screen(0), desc="Switch focus to Monitor 1"),
    Key([mod], "e", lazy.to_screen(1), desc="Switch focus to Monitor 2"),
    Key([mod], "r", lazy.to_screen(2), desc="Switch focus to Monitor 3"),
]

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
Exemplo n.º 23
0
    Key([mod, "shift"], "k", lazy.layout.shuffle_up()),
    Key([mod, "shift"], "h", lazy.layout.shuffle_left()),
    Key([mod, "shift"], "l", lazy.layout.shuffle_right()),
    Key([mod, "mod4"], "j", lazy.layout.flip_down()),
    Key([mod, "mod4"], "k", lazy.layout.flip_up()),
    Key([mod, "mod4"], "h", lazy.layout.flip_left()),
    Key([mod, "mod4"], "l", lazy.layout.flip_right()),
    Key([mod, "control"], "j", lazy.layout.grow_down()),
    Key([mod, "control"], "k", lazy.layout.grow_up()),
    Key([mod, "control"], "h", lazy.layout.grow_left()),
    Key([mod, "control"], "l", lazy.layout.grow_right()),
    Key([mod, "shift"], "n", lazy.layout.normalize()),
    Key([mod], "o", lazy.layout.maximize()),

    # Change to other screen
    Key([mod], "u",      lazy.to_screen(0)),
    Key([mod], "i",      lazy.to_screen(1)),
    
    # Change the volume if our keyboard has keys
    Key(
        [], "XF86AudioRaiseVolume",
        lazy.spawn("amixer -c 0 -q set Master 2dB+")
    ),
    Key(
        [], "XF86AudioLowerVolume",
        lazy.spawn("amixer -c 0 -q set Master 2dB-")
    ),
    Key(
        [], "XF86AudioMute",
        lazy.spawn("amixer -c 0 -q set Master toggle")
    ),
Exemplo n.º 24
0
        desc="Move window down in current stack "),
    Key([mod, "control"],
        "j",
        lazy.layout.shuffle_up(),
        desc="Move window up in current stack "),
    Key([mod, "control"],
        "h",
        lazy.layout.shuffle_left(),
        desc="Move window right in current stack "),
    Key([mod, "control"],
        "l",
        lazy.layout.shuffle_right(),
        desc="Move window left in current stack "),

    # Actions for the monitors
    Key([mod], "a", lazy.to_screen(0), desc="Move focus to monitor 1"),
    Key([mod], "s", lazy.to_screen(1), desc="Move focus to monitor 2"),

    # Swap panes of split stack
    Key([mod, "shift"],
        "space",
        lazy.layout.rotate(),
        desc="Swap panes of split stack"),

    # Multiple stack panes
    Key([mod, "shift"],
        "Return",
        lazy.layout.toggle_split(),
        desc="Toggle between split and unsplit sides of stack"),

    # Launch guess terminal
Exemplo n.º 25
0
    # Change window focus
    Key([mod], "Up", lazy.layout.up()),
    Key([mod], "Down", lazy.layout.down()),
    Key([mod], "Left", lazy.layout.left()),
    Key([mod], "Right", lazy.layout.right()),
    Key([mod], "k", lazy.layout.up()),
    Key([mod], "j", lazy.layout.down()),
    Key([mod], "h", lazy.layout.left()),
    Key([mod], "l", lazy.layout.right()),
    Key([mod, "mod1"], "h", lazy.layout.previous()),  # Stack
    Key([mod, "mod1"], "l", lazy.layout.next()),  # Stack

    # Switch focus to a physical monitor (dual/triple set up)
    Key([mod], "period", lazy.next_screen()),
    Key([mod], "comma", lazy.prev_screen()),
    Key([mod], "a", lazy.to_screen(0)),
    Key([mod], "b", lazy.to_screen(1)),
    Key([mod], "c", lazy.to_screen(2)),

    # Move windows to different physical screens
    Key([mod, "shift"], "comma", lazy.function(window_to_previous_screen)),
    Key([mod, "shift"], "period", lazy.function(window_to_next_screen)),
    Key([mod], "t", lazy.function(switch_screens)),

    # Resize layout
    Key(
        [mod, "control"],
        "l",
        lazy.layout.grow_right(),
        lazy.layout.grow(),
        lazy.layout.increase_ratio(),
Exemplo n.º 26
0
    # Resize windows in Mondad-* views
    Key([mod], "equal", lazy.layout.grow(), desc="Increase size of current window"),
    Key([mod], "minus", lazy.layout.shrink(), desc="Decrease size of current window"),
    Key([mod, "shift"], "equal", lazy.layout.grow_main(), desc="Increase size of master window"),
    Key([mod, "shift"], "minus", lazy.layout.shrink_main(), desc="Decrease size of master window"),
    Key([mod], "0", lazy.layout.normalize(), desc="Reset secondary window sizes"),

    # Swap current window with master in Monad views
    Key([mod], "Return", lazy.layout.swap_main(), desc="Swap current window with master"),

    # Flip master region in Monad views (e.g., from left to right)
    Key([mod, "shift"], "Return", lazy.layout.flip(), desc="Flip the master region"),


    # Moving between (Physical) Screens
    Key([mod], "h", lazy.to_screen(0), desc="Move to Left Screen"),
    Key([mod], "l", lazy.to_screen(1), desc="Move to Right Screen"),

    # Working with Floating Windows
    Key([mod], "f", lazy.window.toggle_floating(), desc="Toggle Float"),
    Key([alt], "Tab", lazy.group.next_window(), lazy.window.bring_to_front(), desc="Alt-tab btwn Windows"),

    # Qtile System Commands
    Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
    Key([mod], "w", lazy.window.kill(), desc="Kill focused window"),
    Key([mod, "control"], "r", lazy.restart(), desc="Restart qtile"),
    Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown qtile"),

    # Launch Rofi
    Key([mod], "space", lazy.spawn("rofi -show drun"), desc="Launch an Application"),
Exemplo n.º 27
0
term = "alacritty"

keys = [
    Key([mod], "h", lazy.layout.left()),
    Key([mod], "l", lazy.layout.right()),
    Key([mod], "j", lazy.layout.down()),
    Key([mod], "k", lazy.layout.up()),
    Key([mod, control], "h", lazy.layout.swap_left()),
    Key([mod, control], "l", lazy.layout.swap_right()),
    Key([mod, control], "j", lazy.layout.shuffle_down()),
    Key([mod, control], "k", lazy.layout.shuffle_up()),
    Key([mod, shift], "l", lazy.layout.grow()),
    Key([mod, shift], "h", lazy.layout.shrink()),
    Key([mod], "equal", lazy.layout.normalize()),
    Key([mod], "c", lazy.window.kill(), desc="Kill focused window"),
    Key([mod], "q", lazy.to_screen(0), desc="Keyboard focus to monitor 1"),
    Key([mod], "w", lazy.to_screen(1), desc="Keyboard focus to monitor 2"),
    Key([mod], "Return", lazy.spawn(term)),
    # Toggle between different layouts as defined below
    Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
    Key([mod, control], "f", lazy.window.toggle_floating()),
    Key([mod, alt], "m", lazy.to_layout_index(1)),
    Key([mod, alt], "s", lazy.to_layout_index(0)),
    Key([mod, control], "r", lazy.restart(), desc="Restart qtile"),
    Key([mod, control], "q", lazy.shutdown(), desc="Shutdown qtile"),
    Key([mod], "r", lazy.spawn("rofi -show drun")),
    Key([mod, control], "space", lazy.spawn("rofimoji")),
    Key([mod], "m",
        lazy.spawn(
            os.path.expanduser("~/.config/rofi/rofi-layouts-changer.sh"))),
    Key([], "Print", lazy.spawn("gnome-screenshot")),
Exemplo n.º 28
0
# determine what applications are best to start with xinit and which are best to
# here
#@hook.subscribe.startup_once
#def autostart():
#    home = os.path.expanduser('~/.config/qtile/autostart.sh')
#    subprocess.call([home])

mod = "mod1"
terminal = guess_terminal()

keys = [
    # Switch between windows in current stack pane
    Key([mod], "k", lazy.layout.down(), desc="Move focus down in stack pane"),
    Key([mod], "j", lazy.layout.up(), desc="Move focus up in stack pane"),
    # Screen Swap
    Key([mod], "period", lazy.to_screen(0)),
    Key([mod], "comma", lazy.to_screen(1)),

    # RESIZE UP, DOWN, LEFT, RIGHT
    Key(
        [mod, "control"],
        "l",
        lazy.layout.grow_right(),
        lazy.layout.grow(),
        lazy.layout.increase_ratio(),
        lazy.layout.delete(),
    ),
    Key(
        [mod, "control"],
        "Right",
        lazy.layout.grow_right(),
Exemplo n.º 29
0
    Group(
        all_groups[-1],
        matches=[Match(wm_class=["Mail", "Signal"])],
        layout="treetab",
    )
] + [ScratchPad(
    "scratchpad",
    [
        DropDown("term", TERMINAL),
    ],
)])

keys.append(Key([mod], "t", lazy.group["scratchpad"].dropdown_toggle("term")))
for j, names in enumerate(groups_by_screen):
    keys.extend([
        Key([mod], i, lazy.to_screen(j), lazy.group[i].toscreen(toggle=False))
        for i in names
    ])

    keys.extend(
        [Key([mod, "shift"], i, lazy.window.togroup(i)) for i in all_groups])

layout_theme = {
    "border_width": 0,
    "margin": 6,
    # "border_focus": "881111",
    # "border_normal": "1D2330",
    "single_margin": 0,
    # "single_border_width": 0,
}