Ejemplo n.º 1
0
    def create_groups_keys(self):
        modifier = [GROUPS_KEY]
        swap_modifier = [GROUPS_KEY, SWAP_GROUP_KEY]
        screen_modifier = [MOVEMENT_KEY]

        move_next = Key(modifier, NEXT_GROUP, lazy.screen.next_group())
        move_prev = Key(modifier, PREV_GROUP, lazy.screen.prev_group())

        swap_next = Key(swap_modifier, NEXT_GROUP,
                        Functions.window_to_next_group())
        swap_prev = Key(swap_modifier, PREV_GROUP,
                        Functions.window_to_prev_group())

        move_next_screen = Key(screen_modifier, NEXT_GROUP, lazy.next_screen())
        move_prev_screen = Key(screen_modifier, PREV_GROUP, lazy.next_screen())

        self.keys += [
            move_next, move_prev, swap_next, swap_prev, move_next_screen,
            move_prev_screen
        ]
Ejemplo n.º 2
0
        if [1 for w in group.windows if w.urgent]:
            qtile.current_screen.set_group(group)
            break


# }}}

# NOTE: nice run menus:
#/usr/bin/rofi -modi run,drun -show drun run
# rofi -show combi -modi combi -combi-modi window,run,ssh

keys = [  # {{{
    # Custom commands
    Key([mod, "shift"], "r", raiseFloatingWindows, desc="raise floating"),
    Key([mod], "o", moveToNextScreen, desc="move to next screen"),
    Key([mod], "p", lazy.next_screen(), desc="go to next screen"),
    Key([mod],
        "e",
        lazy.spawn(
            'rofi -p "Go to" -show combi -modi combi -combi-modi window'),
        desc="window list"),
    Key([mod], "r", lazy.spawn('mymenu.sh'), desc="shortcuts menu"),
    Key([mod], "z", lazy.spawn('synapse'), desc="launcher"),
    Key([mod], "d", lazy.spawn('doNotDisturb'), desc="toggle notifications"),
    Key([mod],
        "l",
        lazy.spawn('mate-screensaver-command -l'),
        desc="lock screen"),
    Key([mod, "control"],
        "l",
        lazy.spawn('mate-session-save --shutdown-dialog'),
Ejemplo n.º 3
0
    Key([mod], "k", lazy.layout.up(), desc='Swap Up In Current Window Stack'),
    Key([mod],
        "j",
        lazy.layout.down(),
        desc='Swap Down In Current Window Stack'),
    Key([mod, "shift"],
        "k",
        lazy.layout.shuffle_up(),
        desc='Move Current Window Up In Stack'),
    Key([mod, "shift"],
        "j",
        lazy.layout.shuffle_down(),
        desc='Move Current Window Down In Stack'),
    Key([mod], "Tab", lazy.next_layout(), desc='Toggle Layouts'),
    Key([mod], "h", lazy.prev_screen(), desc='Switch Focus to Left'),
    Key([mod], "l", lazy.next_screen(), desc='Switch Focus to Right')
]

##### GROUPS #####

group_names = [("Web", {
    'layout': 'monadtall'
}), ("Term", {
    'layout': 'monadtall'
}), ("School", {
    'layout': 'monadtall'
}), ("Game", {
    'layout': 'max'
}), ("Music", {
    'layout': 'monadtall'
}), ("Chat", {
Ejemplo n.º 4
0
 EzKey(
     "M-S-<Up>",
     lazy.layout.shuffle_up().when(layout=layout_names["monadtall"]),
     lazy.layout.move_up().when(layout=layout_names["treetab"]),
 ),
 # Grow/shrink windows
 EzKey(
     "M-A-<Left>", lazy.layout.shrink_main().when(layout=layout_names["monadtall"])
 ),
 EzKey(
     "M-A-<Right>", lazy.layout.grow_main().when(layout=layout_names["monadtall"])
 ),
 EzKey("M-A-<Down>", lazy.layout.shrink().when(layout=layout_names["monadtall"])),
 EzKey("M-A-<Up>", lazy.layout.grow().when(layout=layout_names["monadtall"])),
 # Move focus/windows between screens
 EzKey("M-<period>", lazy.next_screen()),
 EzKey("M-<comma>", lazy.prev_screen()),
 EzKey("M-S-<period>", window_to_next_screen()),
 EzKey("M-S-<comma>", window_to_previous_screen()),
 EzKey("M-C-<Right>", focus_next_group()),
 EzKey("M-C-<Left>", focus_previous_group()),
 # Various window controls
 EzKey("M-S-c", lazy.window.kill()),
 EzKey("M-C-c", lazy.window.center()),
 EzKey("M-S-<space>", lazy.layout.reset()),
 EzKey("M-f", lazy.window.toggle_fullscreen()),
 EzKey("M-S-f", lazy.window.toggle_floating()),
 EzKey("M-<space>", lazy.layout.flip()),
 EzKey("M-<Tab>", lazy.spawn(SWITCHER)),
 EzKey("M-S-<Tab>", float_to_front()),
 EzKey("M-b", lazy.hide_show_bar()),
Ejemplo n.º 5
0
        "l",
        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.
Ejemplo n.º 6
0
                         Key([], 't', lazy.function(
                             theme_factory.switch_light),
                             lazy.ungrab_all_chords()),
                     ],
                     mode='qtile.theme'),
            # Key([mod], 'F1', lazy.spawn(TermCmd(
            # 'bash -c "cat %r; read -n 10 -rs -p \'Press any key to quit\'"' %
            # (HOME + '/.config/qtile/keybindings.md'))),
            # desc='Show keybindings'),
        ],
        mode='qtile'),
    # NOTE: Session
    Key([mod, 'control'], 'F5', lazy.restart(), desc='Restart qtile'),

    # NOTE: Screen
    Key([mod], 'comma', lazy.next_screen(), desc='Focus next screen'),
    # Key([mod], 'period', lazy.prev_screen(), desc='Focus previous screen'),

    # NOTE: Workspace
    Key([mod, 'control'], 'Left', lazy.screen.prev_group()),
    Key([mod, 'control'], 'Right', lazy.screen.next_group()),

    # NOTE: Layout
    Key([mod_alt], 'Tab', lazy.group.next_window()),
    Key([mod_alt, 'shift'], 'Tab', lazy.group.prev_window()),
    Key([mod], 'Down', lazy.layout.down()),
    Key([mod], 'Up', lazy.layout.up()),
    Key([mod], 'Left', lazy.layout.left()),
    Key([mod], 'Right', lazy.layout.right()),
    Key([mod, 'control'], 'Down',
        lazy.layout.section_down().when('treetab')),
Ejemplo n.º 7
0
mod = "mod4"
terminal =guess_terminal()

keys = [

# 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], "period", lazy.layout.next(), desc="Move window focus to other window"),

# Switch between screens
    
    Key([mod], "space", lazy.next_screen(), desc="Move screen focus to other screen"),

# Move windows between left/right columns or move up/down in current stack.

    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"),
    Key([mod, "shift"], "j", lazy.layout.shuffle_down(), desc="Move window down"),
    Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"),

# Super + function keys

    Key([mod], "q", lazy.window.kill(), desc="Kill focused window"),
    Key([mod], "f", lazy.window.toggle_fullscreen(), desc="Toggle full screen"),

# Resize up, down, left, right
Ejemplo n.º 8
0
            "green":      '#b8bb26', #4
            "yellow":     '#fabd2f', #5
            "blue":       '#83a598', #6
            "magenta":    '#d3869b', #7
            "cyan":       '#8ec07c', #8
            "white":      '#ebdbb2', #9
        }
colors = init_colors("gruvbox")

keys = [
    # Switch between windows
    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], "Tab",   lazy.next_screen()),

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

    # Resize windows
    Key([mod, "control"], "h", lazy.layout.grow_left()),
    Key([mod, "control"], "l", lazy.layout.grow_right()),
    Key([mod, "control"], "j", lazy.layout.grow_down()),
    Key([mod, "control"], "k", lazy.layout.grow_up()),

    # Toggle between split and unsplit sides of stack.
    Key([mod, "shift"], "Return", lazy.layout.toggle_split()),
Ejemplo n.º 9
0
        "m",
        lazy.function(toggle_max_layout()),
        desc="Toggle max layout"),
    Key([mod],
        "t",
        lazy.to_layout_index(MONAD_TALL_LAYOUT.index),
        desc="Change to monadtall"),
    # Key([mod, "shift"], "t", lazy.to_layout_index(TREE_TAB_LAYOUT.index), desc="Toggle between layouts"),

    # Groups
    Key(["control"], "Tab", lazy.screen.toggle_group()),
    Key([mod], "bracketright", lazy.function(go_next_group(1))),
    Key([mod], "bracketleft", lazy.function(go_next_group(-1))),

    # Screen
    Key([mod], "backslash", lazy.next_screen(), desc="Move to next scren"),
    Key([mod, "mod1"],
        "backslash",
        lazy.spawn(
            "xrandr --output  DP-0 --auto --output HDMI-0 --auto --right-of DP-0"
        ),
        desc="Refresh screens"),
    Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"),
    Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),

    # Brightness
    Key([],
        "XF86MonBrightnessUp",
        lazy.spawn("xbacklight -inc 5"),
        desc="Increate Brightness"),
    Key([],
Ejemplo n.º 10
0
from libqtile.config import Click, Drag, Group, Key, Match, Screen
from libqtile.lazy import lazy

# Config depandency library
from os import getenv
import subprocess

mod = "mod4"            # Windows key as mod key
home = getenv("HOME")   # Set Home directory
terminal = "alacritty"      # Set terminal emulator
shell = " -e fish"      # Set Shell

keys = [
    # Switch focus of monitors
    Key([mod], "period",
        lazy.next_screen(), desc='Move focus to next monitor'),
    Key([mod], "comma",
        lazy.prev_screen(), desc='Move focus to prev monitor'),

    # 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 up/down
    Key([mod, "shift"], "h", lazy.layout.shuffle_left(),
        desc="Move window to the left"),
    Key([mod, "shift"], "l", lazy.layout.shuffle_right(),
Ejemplo n.º 11
0
    # Move windows up or down in current stack
    Key([mod, "control"], "k", 
        lazy.layout.shuffle_down(),
        lazy.layout.rotate()),
    Key([mod, "control"], "j", 
        lazy.layout.shuffle_up(),
        lazy.layout.rotate()),

    # Resize Windows
    Key([mod, "control"], "i", lazy.layout.shrink()),
    Key([mod, "control"], "o", lazy.layout.grow()),

    # Move focus to different monitor
    Key([mod], "period", lazy.prev_screen()),
    Key([mod], "comma", lazy.next_screen()),

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

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

    # Toggle Floating
    Key([mod], "t", lazy.window.toggle_floating()),

    # Toggle Fullscreen
    Key([mod, "shift"], "t", lazy.window.toggle_floating()),

    # Swap panes of split stack
Ejemplo n.º 12
0
 # will be to screen edge - window would shrink.
 Key([mod, "control"],
     "h",
     lazy.layout.grow_left(),
     desc="Grow window to the left"),
 Key([mod, "control"],
     "l",
     lazy.layout.grow_right(),
     desc="Grow window to the right"),
 Key([mod, "control"],
     "j",
     lazy.layout.grow_down(),
     desc="Grow window down"),
 Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"),
 Key([mod], "comma", lazy.prev_screen(), desc="Focus to the left screen"),
 Key([mod], "period", lazy.next_screen(), desc="Focus to the right screen"),
 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 focused window"),
Ejemplo n.º 13
0
def get_asdf():
    keys = [
        # 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",
        ),
        Key([mod, "shift"],
            "j",
            lazy.layout.shuffle_down(),
            desc="Move window down"),
        Key([mod, "shift"],
            "k",
            lazy.layout.shuffle_up(),
            desc="Move window up"),
        Key([mod, "shift"],
            "f",
            lazy.window.toggle_floating(),
            desc="toggle floating"),
        Key([mod],
            "f",
            lazy.window.toggle_fullscreen(),
            desc="toggle fullscreen"),
        # Grow windows. If current window is on the edge of screen and direction
        # will be to screen edge - window would shrink.
        Key(
            [mod, "control"],
            "h",
            lazy.layout.grow_left(),
            desc="Grow window to the left",
        ),
        Key(
            [mod, "control"],
            "l",
            lazy.layout.grow_right(),
            desc="Grow window to the right",
        ),
        Key([mod, "control"],
            "j",
            lazy.layout.grow_down(),
            desc="Grow window down"),
        Key([mod, "control"],
            "k",
            lazy.layout.grow_up(),
            desc="Grow window up"),
        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.spawn("rofi -show combi"),
            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], "w", lazy.window.kill(), desc="Kill focused window"),
        Key([mod], "b", lazy.spawn(browser), desc="Launch Qutebrowser"),
        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"),
            desc="Spawn a command using a prompt widget",
        ),
        KeyChord(
            ["control"],
            "e",
            [
                Key(
                    [],
                    "e",
                    lazy.spawn("emacsclient -c -a 'emacs'"),
                    desc="Launch Emacs",
                ),
                Key(
                    [],
                    "b",
                    lazy.spawn("emacsclient -c -a 'emacs' --eval '(ibuffer)'"),
                    desc="Launch ibuffer inside Emacs",
                ),
                Key(
                    [],
                    "d",
                    lazy.spawn(
                        "emacsclient -c -a 'emacs' --eval '(dired nil)'"),
                    desc="Launch dired inside Emacs",
                ),
                Key(
                    [],
                    "i",
                    lazy.spawn("emacsclient -c -a 'emacs' --eval '(erc)'"),
                    desc="Launch erc inside Emacs",
                ),
                Key(
                    [],
                    "m",
                    lazy.spawn("emacsclient -c -a 'emacs' --eval '(mu4e)'"),
                    desc="Launch mu4e inside Emacs",
                ),
                Key(
                    [],
                    "n",
                    lazy.spawn("emacsclient -c -a 'emacs' --eval '(elfeed)'"),
                    desc="Launch elfeed inside Emacs",
                ),
                Key(
                    [],
                    "s",
                    lazy.spawn("emacsclient -c -a 'emacs' --eval '(eshell)'"),
                    desc="Launch the eshell inside Emacs",
                ),
                Key(
                    [],
                    "v",
                    lazy.spawn(
                        "emacsclient -c -a 'emacs' --eval '(+vterm/here nil)'"
                    ),
                    desc="Launch vterm inside Emacs",
                ),
            ],
        ),
        # Monitor Switches
        Key([mod],
            "period",
            lazy.next_screen(),
            desc="Move focus to next monitor"),
        Key([mod],
            "comma",
            lazy.prev_screen(),
            desc="Move focus to prev monitor"),
        ## Treetab controls
        Key(
            [mod, "shift"],
            "h",
            lazy.layout.move_left(),
            desc="Move up a section in treetab",
        ),
        Key(
            [mod, "shift"],
            "l",
            lazy.layout.move_right(),
            desc="Move down a section in treetab",
        ),
    ]

    # Idea taken from Augusto Nicola's Dotfiles => https://github.com/AugustoNicola/dotfiles
    group_names = [
        ("SYS", {
            "label": "ﬦ",
            "layout": "columns"
        }),
        ("DEV", {
            "label": "",
            "layout": "columns"
        }),
        ("WWW", {
            "label": "",
            "layout": "columns"
        }),
        ("DIS", {
            "label": "ﭮ",
            "layout": "columns"
        }),
        ("TEAMS", {
            "label": "",
            "layout": "columns"
        }),
        ("DOC", {
            "label": "",
            "layout": "columns"
        }),
        ("MUS", {
            "label": "",
            "layout": "columns"
        }),
        ("VID", {
            "label": "嗢",
            "layout": "columns"
        }),
        ("VBOX", {
            "label": "",
            "layout": "columns"
        }),
    ]

    groups = [
        Group(name, init=True, persist=True, **kwargs)
        for name, kwargs in group_names
    ]

    for i, (name, kwargs) in enumerate(group_names, 1):
        keys.append(
            Key([mod], str(i),
                lazy.group[name].toscreen()))  # Switch to another group
        keys.append(Key(
            [mod, "shift"], str(i),
            lazy.window.togroup(name)))  # Send current window to another group

    return keys, groups
Ejemplo n.º 14
0
browser = getenv("BROWSER")
bin_dir = expanduser("~/.dotfiles/bin")
rofi_scripts_dir = expanduser("~/.dotfiles/rofi/scripts")

# KEYS
win_cmds = WindowCommands()
rofi = Rofi(rofi_scripts_dir)

keys = bind_keys(
    # Navigation
    ("M-h", lazy.layout.left(), "Move focus left"),
    ("M-j", lazy.layout.down(), "Move focus down"),
    ("M-k", lazy.layout.up(), "Move focus up"),
    ("M-l", lazy.layout.right(), "Move focus right"),

    ("M-i", lazy.next_screen(), "Focus next screen"),
    ("M-u", lazy.next_urgent(), "Focus next urgent window"),

    ("M-<Tab>", lazy.next_layout(), "Select next layout"),

    # Positioning
    ("M-S-h", lazy.layout.shuffle_left(), "Shuffle window left"),
    ("M-S-j", lazy.layout.shuffle_down(), "Shuffle window down"),
    ("M-S-k", lazy.layout.shuffle_up(), "Shuffle window up"),
    ("M-S-l", lazy.layout.shuffle_right(), "Shuffle window right"),

    # Windows
    ("M-f", lazy.window.toggle_floating(), "Toggle floating"),
    ("M-m", win_cmds.toggle_maximized(layout="mono"), "Toggle mono layout"),
    ("M-S-m", win_cmds.toggle_maximized(layout="max"), "Toggle max layout"),
    # ("M-S-n", win_cmds.to_inactive_group(), "Move window to first inactive group"),
Ejemplo n.º 15
0
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"),

    # Move windows up or down in current stack
    Key([mod, "control"],
        "k",
        lazy.layout.shuffle_down(),
        desc="Move window down in current stack "),
    Key([mod, "control"],
        "j",
        lazy.layout.shuffle_up(),
        desc="Move window up in current stack "),
    Key([mod], "h", lazy.prev_screen(), desc="Switch to previous monitor"),
    Key([mod], "l", lazy.next_screen(), desc="Switch to next monitor"),

    # 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 fullscreen
    Key([mod, "control"],
Ejemplo n.º 16
0
    Key([mod], "j", lazy.layout.down(), desc="Move focus down"),
    Key([mod], "k", lazy.layout.up(), desc="Move focus up"),
    Key([mod], "plus", lazy.layout.increase_ratio(), desc="Increase number of master windows"),
    Key([mod], "minus", lazy.layout.decrease_ratio(), desc="Decrease number of master windows"),
    Key(["mod1"], "Tab", lazy.layout.next(), desc="Move window focus to other window"),
    Key([mod], "m", lazy.layout.swap_main(), desc="Promote to master"),

    Key([mod], "comma", lazy.screen.prev_group(), desc="Go to next group"),
    Key([mod], "period", lazy.screen.next_group(), desc="Go to next group"),
    Key([mod], "BackSpace", lazy.screen.toggle_group(), desc="Go to previous group"),
    Key([mod, "shift"], "comma", window_to_offset_group(-1), desc="Move window and go to prev group"),
    Key([mod, "shift"], "period", window_to_offset_group(1), desc="Move window and go to next group"),
    Key([mod, "control", "shift"], "comma", window_to_offset_group(-1, False), desc="Move window to prev group"),
    Key([mod, "control", "shift"], "period", window_to_offset_group(1, False), desc="Move window to next group"),
    Key([mod, "mod1"], "comma", lazy.prev_screen(), desc="Go to prev screen"),
    Key([mod, "mod1"], "period", lazy.next_screen(), desc="Go to next screen"),
    Key([mod, "shift", "mod1"], "comma", window_to_offset_screen(-1), desc="Move window and to prev screen"),
    Key([mod, "shift", "mod1"], "period", window_to_offset_screen(1), desc="Move window and to next screen"),
    Key([mod, "control", "shift", "mod1"], "comma", window_to_offset_screen(-1, False), desc="Move window to prev screen"),
    Key([mod, "control", "shift", "mod1"], "period", window_to_offset_screen(1, False), desc="Move window to next screen"),

    Key([mod, "shift"], "h", lazy.layout.shuffle_left(), desc="Move window left"),
    Key([mod, "shift"], "l", lazy.layout.shuffle_right(), desc="Move window right"),
    Key([mod, "shift"], "j", lazy.layout.shuffle_down(), desc="Move window down"),
    Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"),
    Key([mod], "l", lazy.layout.grow_main(), desc="Grow window"),
    Key([mod], "h", lazy.layout.shrink_main(), desc="Shrink window"),

    Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
    Key([mod], "space", lazy.next_layout(), desc="Toggle between layouts"),
    Key([mod, "shift"], "space", lazy.hide_show_bar("top"), desc="Toggle bar"),
Ejemplo n.º 17
0
    # 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(TERM), desc="Launch terminal"),
    Key([MOD, "shift"], "n", lazy.spawn("xcwd-term")),

    Key([MOD], "f", lazy.next_layout()),
    Key([MOD], "s", lazy.function(lambda qtile: qtile.cmd_to_layout_index(0))),
    Key([MOD], "t", lazy.function(goto_next_empty_group)),
    Key([MOD, "shift"], "t", lazy.function(followto_next_empty_group)),
    Key([MOD], "space", lazy.function(swap_screens)),

    # Swap between monitors
    Key([MOD], "o", lazy.next_screen()),
    Key([MOD, "shift"], "o", lazy.function(send_to_next_screen)),

    # Some spawn commands
    Key([MOD], "b", lazy.spawn("firefox")),

    Key([MOD], "w", lazy.window.kill()),

    Key([MOD, "control"], "r", lazy.restart()),
    Key([MOD, "control"], "q", lazy.spawn("my-exit")),
    Key([MOD], "r", lazy.spawn("rofi -show combi")),
]

# setup hostname specific keys
if os.uname()[1] == 'trailer':
    keys.extend([
Ejemplo n.º 18
0
def move_group_to_next_screen():
    group = lazy.group.currentGroup()
    lazy.next_screen()
    lazy.group[group].toscreen()
Ejemplo n.º 19
0
 def keys_screens():
     return [
         Key("M-o", lazy.next_screen()),
         Key("M-S-o", lazy.function(swap_to_other_screen()))
     ]
Ejemplo n.º 20
0
keys = [
    ## KEY_START
    Key([mod], "1", lazy.group[""].toscreen(), desc=" ... Switch to group "),
    Key([mod], "2", lazy.group[""].toscreen(), desc=" ... Switch to group "),
    Key([mod], "3", lazy.group[""].toscreen(), desc=" ... Switch to group "),
    Key([mod], "4", lazy.group[""].toscreen(), desc=" ... Switch to group "),
    Key([mod], "5", lazy.group[""].toscreen(), desc=" ... Switch to group "),
    Key([mod], "6", lazy.group[""].toscreen(), desc=" ... Switch to group "),
    Key([mod, "shift"], "1", lazy.window.togroup(""), desc=" ... Move to group "),
    Key([mod, "shift"], "2", lazy.window.togroup(""), desc=" ... Move to group "),
    Key([mod, "shift"], "3", lazy.window.togroup(""), desc=" ... Move to group "),
    Key([mod, "shift"], "4", lazy.window.togroup(""), desc=" ... Move to group "),
    Key([mod, "shift"], "5", lazy.window.togroup(""), desc=" ... Move to group "),
    Key([mod, "shift"], "6", lazy.window.togroup(""), desc=" ... Move to group "),
    Key([mod], "a", lazy.next_screen(), desc=' ... Move focus to other monitor'),
    Key([mod], "Left", lazy.layout.left(), desc=' ... Move focus to left'),
    Key([mod], "Right", lazy.layout.right(), desc=' ... Move focus to right'),
    Key([mod], "Down", lazy.layout.down(), desc=' ... Move focus down'),
    Key([mod], "Up", lazy.layout.up(), desc=' ... Move focus up'),
    Key([mod, "shift"], "Left", lazy.layout.shuffle_left(), desc=' ... Move window to the left'),
    Key([mod, "shift"], "Right", lazy.layout.shuffle_right(), desc=' ... Move window to the right'),
    Key([mod, "shift"], "Down", lazy.layout.shuffle_down(), desc=' ... Move window down'),
    Key([mod, "shift"], "Up", lazy.layout.shuffle_up(), desc=' ... Move window up'),
    Key([mod], "z", lazy.window.toggle_minimize(), desc=' ... Minimise window'),
    Key([mod], "s", lazy.window.toggle_floating(), desc=' ... Toggle floating'),
    Key([mod, "control"], "Up", lazy.layout.grow(), desc=' ... Grow window'),
    Key([mod, "control"], "Down", lazy.layout.shrink(), desc=' ... Shrink window'),
    Key([mod], "x", lazy.window.kill(), desc=' ... Kill focused window'),
    Key([mod], "b", lazy.hide_show_bar(position='all'), desc=' ... Toggle bars'),
    Key([mod], "Pause", lazy.spawn("dpower"), desc=' ... Power Menu'),
Ejemplo n.º 21
0
    # Volume (hold shift for lighter adjustments)
    Key("<XF86AudioLowerVolume>", lazy.spawn("amixer -c 0 -q set Master 5%-")),
    Key("S-<XF86AudioLowerVolume>",
        lazy.spawn("amixer -c 0 -q set Master 1%-")),
    Key("<XF86AudioRaiseVolume>", lazy.spawn("amixer -c 0 -q set Master 5%+")),
    Key("S-<XF86AudioRaiseVolume>",
        lazy.spawn("amixer -c 0 -q set Master 1%+")),
    Key("<XF86AudioMute>", lazy.spawn("amixer -D pulse set Master 1+ toggle")),

    # Brightness (hold shift for lighter adjustments)
    Key("<XF86MonBrightnessUp>", lazy.spawn("light -A 5")),
    Key("S-<XF86MonBrightnessUp>", lazy.spawn("light -A 1")),
    Key("<XF86MonBrightnessDown>", lazy.spawn("light -U 5")),
    Key("S-<XF86MonBrightnessDown>", lazy.spawn("light -U 1")),

    # Multi-screen test (not very convincing)
    Key("M-<Escape>", lazy.next_screen()),
    Key("M-p", lazy.spawn("sh -c ~/scripts/monitor_layout.sh")),
    Key("M-S-p", lazy.spawn("sh -c ~/scripts/rotate_secondary_display.sh")),
]

mouse = [
    Drag("M-1",
         lazy.window.set_position_floating(),
         start=lazy.window.get_position()),
    Drag("M-3", lazy.window.set_size_floating(), start=lazy.window.get_size()),
    Click("M-2", lazy.window.bring_to_front()),
    Click("M-S-1", lazy.window.toggle_floating()),
]
Ejemplo n.º 22
0
    # Move windows up or down in current stack
    Key([mod, 'shift'], 'Left', lazy.layout.shuffle_down()),
    Key([mod, 'shift'], 'Right', lazy.layout.shuffle_up()),

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

    # Increase / decrease master window size
    Key([mod], 'equal', lazy.layout.increase_ratio()),
    Key([mod], 'minus', lazy.layout.decrease_ratio()),

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

    # Toggle between screeens
    Key([mod], 'grave', lazy.next_screen()),

    # Media keys
    Key([], 'XF86AudioRaiseVolume', lazy.spawn('pactl set-sink-volume 1 +5%')),
    Key([], 'XF86AudioLowerVolume', lazy.spawn('pactl set-sink-volume 1 -5%')),
    Key([], 'XF86AudioMute', lazy.spawn('pactl set-sink-mute 1 toggle')),
    Key([], 'XF86AudioPlay', lazy.spawn('playerctl play-pause')),
    Key([], 'XF86AudioNext', lazy.spawn('playerctl next')),
    Key([], 'XF86AudioPrev', lazy.spawn('playerctl previous')),

    # 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.spawncmd()),
    Key([mod], 'Return', lazy.spawn('alacritty')),
Ejemplo n.º 23
0
import os
import re
import subprocess
from libqtile import qtile
from libqtile.config import Key, Screen, Group, Drag, Click
from libqtile.lazy import lazy
from libqtile import layout, bar, widget, hook

from typing import List  # noqa: F401

mod = 'mod4'

keys = [
    # Switch between windows in current stack pane
    Key([mod], 'period', lazy.next_screen()),
    Key([mod], 'k', lazy.layout.down()),
    Key([mod], 'j', lazy.layout.up()),

    # Keybinds for basic desktop management
    Key([mod], 'c', lazy.window.kill()),
    Key([mod], 'x', lazy.spawn('flameshot gui')),
    Key([mod], 'z', lazy.spawn('copyq toggle')),
    Key([mod], 'Tab', lazy.next_layout()),
    Key([mod, 'control'], 'r', lazy.restart()),
    Key([mod, 'control'], 'q', lazy.shutdown()),
    Key([mod, 'shift'], 'j', lazy.layout.shuffle_up()),
    Key([mod, 'shift'], 'k', lazy.layout.shuffle_down()),
    Key([mod], 'h', lazy.layout.grow()),
    Key([mod], 'l', lazy.layout.shrink()),
    Key([mod, 'shift'], 'q', lazy.shutdown()),
    Key([mod], 'space', lazy.widget['keyboardlayout'].next_keyboard()),
Ejemplo n.º 24
0
    Key([mod], "l", lazy.layout.right()),

    # Swap windows
    Key([mod, "shift"], "h", lazy.layout.shuffle_left()),
    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"], "semicolon", lazy.layout.flip()),

    # Change windows sizes
    Key([mod], "equal", lazy.layout.grow()),
    Key([mod], "minus", lazy.layout.shrink()),
    Key([mod, "shift"], "equal", lazy.layout.normalize()),
    Key([mod, "shift"], "minus", lazy.layout.maximize()),
    Key([mod], "bracketleft", lazy.prev_screen()),
    Key([mod], "bracketright", lazy.next_screen()),

    # Toggle between different layouts as defined below
    Key([mod], "t", lazy.group.setlayout('monadtall')),
    Key([mod], "y", lazy.group.setlayout('monadwide')),
    Key([mod], "m", lazy.group.setlayout('max')),
    Key([mod], "s", lazy.window.toggle_floating(), desc="Toggle floating"),
    Key([mod], "f", lazy.window.toggle_fullscreen(), desc="Toggle fullscreen"),
    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"),

    # brightness
    Key([], "XF86MonBrightnessUp", lazy.spawn("light -A 5")),
    Key([], "XF86MonBrightnessDown", lazy.spawn("light -U 5")),
    Key(["shift"], "XF86MonBrightnessUp", lazy.spawn("light -A 20")),
Ejemplo n.º 25
0
    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"]

for i in groups:
    keys.extend([
        # mod1 + letter of group = switch to group
        Key([mod],
            i.name,
            lazy.group[i.name].toscreen(),
Ejemplo n.º 26
0
def init_keys():
    keys = [
        Key([mod], "Left", lazy.screen.prev_group(skip_managed=True)),
        Key([mod], "Right", lazy.screen.next_group(skip_managed=True)),

        Key([mod, "shift"], "Left", lazy.function(window_to_previous_column_or_group)),
        Key([mod, "shift"], "Right", lazy.function(window_to_next_column_or_group)),

        Key([mod, "control"], "Up", lazy.layout.grow_up()),
        Key([mod, "control"], "Down", lazy.layout.grow_down()),
        Key([mod, "control"], "Left", lazy.layout.grow_left()),
        Key([mod, "control"], "Right", lazy.layout.grow_right()),

        Key([mod, "mod1"], "Left", lazy.prev_screen()),
        Key([mod, "mod1"], "Right", lazy.next_screen()),

        Key([mod, "shift", "mod1"], "Left", lazy.function(window_to_previous_screen)),
        Key([mod, "shift", "mod1"], "Right", lazy.function(window_to_next_screen)),

        Key([mod], "t", lazy.function(switch_screens)),

        Key([mod], "Up", lazy.group.prev_window()),
        Key([mod], "Down", lazy.group.next_window()),

        Key([mod, "shift"], "Up", lazy.layout.shuffle_up()),
        Key([mod, "shift"], "Down", lazy.layout.shuffle_down()),

        Key([mod], "space", lazy.next_layout()),

        Key([mod], "f", lazy.window.toggle_floating()),
        Key([mod, "shift"], "f", lazy.window.toggle_fullscreen()),
        Key([mod], "b", lazy.window.bring_to_front()),
        Key([mod], "s", lazy.layout.toggle_split()),

        Key([mod], "semicolon", lazy.spawn("splatmoji copypaste")),
        Key([mod], "r", lazy.spawn("rofi -show")),
        Key([mod], "u", lazy.spawn(browser)),
        Key([mod], "Return", lazy.spawn(terminal)),
        Key([mod], "BackSpace", lazy.window.kill()),

        Key([mod, "shift"], "r", lazy.restart()),
        Key([mod, "shift"], "q", lazy.shutdown()),
        Key([mod], "v", lazy.validate_config()),

        Key([], "Print", lazy.spawn("gnome-screenshot -i")),
        Key([mod], "Print", lazy.spawn("gnome-screenshot -p")),
        Key([], "Scroll_Lock", lazy.spawn(screenlocker)),
        Key([mod], "Delete", lazy.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")),
        Key([mod], "Prior", lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ +5%")),
        Key([mod], "Next", lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ -5%")),
        Key([mod], "Insert", lazy.spawn("spotify-dbus playpause")),
        Key([mod], "End", lazy.spawn("spotify-dbus next")),
        Key([mod], "Home", lazy.spawn("spotify-dbus previous")),
    ]
    if DEBUG:
        keys += [
            Key([mod], "Tab", lazy.layout.next()),
            Key([mod, "shift"], "Tab", lazy.layout.previous()),
            Key([mod, "shift"], "f", lazy.layout.flip()),
            Key([mod, "shift"], "s", lazy.group["scratch"].dropdown_toggle("term"))
        ]
    return keys
Ejemplo n.º 27
0
        "Tab",
        lazy.prev_layout(),
        desc="cambiar layout anterior"),
    Key([mod], "w", lazy.window.kill(), desc="Cerrar ventana"),

    # Reiniciar Qtile, Ejecutar comando
    Key([mod, ctrl], "r", lazy.restart(), desc="Reiniciar qtile"),

    # Flip Layout
    Key([mod], "t", lazy.flip()),

    # Explorador de archivos
    Key([mod], "e", lazy.spawn("pcmanfm-qt")),

    # Switch focus of monitors
    Key([mod], "period", lazy.next_screen()),
    Key([mod], "comma", lazy.prev_screen()),

    # rofi
    Key([mod], 'q', lazy.spawn("rofi -show drun")),
    Key([mod], 'r', lazy.spawn("rofi -show run")),
    Key([mod, shift], 'q', lazy.spawn("rofi -show")),
    #Key([mod], "r", lazy.spawncmd(), desc="ejecucion"),

    # Audios de teclado/notebook
    Key([], "XF86AudioLowerVolume",
        lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ -5%")),
    Key([], "XF86AudioRaiseVolume",
        lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ +5%")),
    Key([], "XF86AudioMute",
        lazy.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")),
Ejemplo n.º 28
0
    # Window controls
    Key(M, "j", lazy.layout.down()),
    Key(M, "k", lazy.layout.up()),
    Key(M_Sft, "j", lazy.layout.shuffle_down()),
    Key(M_Sft, "k", lazy.layout.shuffle_up()),
    Key(M, "o", lazy.layout.grow_main()),
    Key(M, "u", lazy.layout.shrink_main()),
    Key(M_Sft, "o", lazy.layout.grow()),
    Key(M_Sft, "u", lazy.layout.shrink()),
    Key(M, "Delete", lazy.window.disable_floating()),
    Key(M, "f", lazy.window.toggle_fullscreen()),

    # Workspaces and screens
    Key(M, "h", lazy.screen.prev_group()),
    Key(M, "l", lazy.screen.next_group()),
    Key(M, "Tab", lazy.next_screen()),
    Key(M_Ctl, "Tab", lazy.next_layout()),
    Key(M_Sft, "Tab", lazy.function(window_to_next_screen)),

    # Media key stuff
    Key([], media_keys["bright_down"], run_script(dec_backlight)),
    Key([], media_keys["bright_up"], run_script(inc_backlight)),

    # Run scripts
    Key(M_Sft, "p", run_script(screenshot)),
    Key(M_Sft, "e", run_script(emojiCmd)),
    Key(M, "F12", run_script(change_wallpaper)),
]

##############################
####    PROGRAM BINDINGS  ####
Ejemplo n.º 29
0
    Key(
        [],
        "XF86AudioStop",
        lazy.spawn(
            "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop"
        ),
        desc="Stop song",
    ),
    # ---
    # | Windows management
    # ---
    EzKey("M-S-c", lazy.window.kill(), desc="Kill focused window"),
    Key([mod], "Tab", lazy.layout.next(),
        desc="Alt-tab switch to next window"),
    Key([mod], "f", lazy.next_layout(), desc="Toggle max layout"),
    Key([mod], "o", lazy.next_screen(), desc="Next screen"),
    # ---
    # | Qtile management
    # ---
    # - Reload
    Key([mod, ctrl], "r", lazy.reload_config(), desc="Reload the config"),
    # - Logout
    Key([mod, ctrl], "q", lazy.shutdown(), desc="Shutdown Qtile"),
    # - Spawn
    Key([mod],
        "r",
        lazy.spawncmd(),
        desc="Spawn a command using a prompt widget"),
]

# AZERTY keys to replace 1234567890
Ejemplo n.º 30
0
    # will be to screen edge - window would shrink.
    # Key([mod, "control"], "h", lazy.layout.grow_left(),
    #     desc="Grow window to the left"),
    # Key([mod, "control"], "l", lazy.layout.grow_right(),
    #     desc="Grow window to the right"),
    Key([mod, "control"],
        "j",
        lazy.layout.grow_down(),
        desc="Grow window down"),
    Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"),
    Key([mod, "control"], "l", lazy.layout.grow()),
    Key([mod, "control"], "h", lazy.layout.shrink()),
    Key([mod, "control"], "o", lazy.layout.maximize()),
    Key([mod, "control"], "space", lazy.layout.flip()),
    Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
    Key([mod, "mod1"], "space", lazy.next_screen()),
    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], "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"),
    Key([mod],
        "r",
        lazy.spawncmd(),
        desc="Spawn a command using a prompt widget"),
    Key([], "XF86AudioRaiseVolume",
        lazy.spawn("amixer -c 0 -q set Master 2dB+")),
    Key([], "XF86AudioLowerVolume",
        lazy.spawn("amixer -c 0 -q set Master 2dB-")),