Exemple #1
0

#############
# VARIABLES #
#############

terminal = 'alacritty'
dmenu = 'rofi -show drun'
browser = 'firefox'
file_manager = 'pcmanfm-qt'
resource_monitor = terminal + ' -e htop'
screen_locker = 'dm-tool switch-to-greeter'

# dictionary containing all the matches for our apps
matches = dict(
    firefox=Match(wm_class=['firefox']),
    bpytop=AndMatch(
        title=['BpyTOP'],
        wm_class=terminal[0].upper() + terminal[1:]
    ),
    deezer=Match(wm_class=['Deezer']),
    discord=AndMatch(wm_class='discord', role='browser-window'),
    lutris=Match(wm_class=['Lutris']),
    minecraft=Match(wm_class=['minecraft-launcher']),
    steam=Match(title=['Steam'], wm_class=['Steam', 'Zenity']),
    teams=Match(wm_class=['Microsoft Teams - Preview']),
    pavucontrol=Match(wm_class=['Pavucontrol']),
)


##########
Exemple #2
0
groups = []

# throwaway groups for random stuff
for i in ['1', '2', '3', '4', '5']:
    groups.append(Group(i))
    keys.append(
        Key([mod], i, lazy.group[i].toscreen())
    )
    keys.append(
        Key([mod, win], i, lazy.window.togroup(i))
    )


groups.extend([
    Group('sublime', persist=False, layout='max', init=False,
        matches=[Match(wm_class=['Sublime2', 'sublime2'])]),
    Group('gvim', layout='max', init=False, persist=False,
        matches=[Match(wm_class=['Gvim', 'gvim'])]),
    Group('music', layout='max', persist=False, init=False,
        matches=[Match(wm_class=['Clementine', 'Viridian'])]),
    Group('chrome', layout='stack', persist=False, init=False,
        spawn='google-chrome',
        matches=[Match(wm_class=['google-chrome', 'Google-chrome'])]),
    Group('firefox', layout='stack', persist=False, init=False,
        spawn='firefox',
        matches=[Match(wm_class=['Firefox', 'Navigator'])]),
    Group('io', layout='pidgin', persist=False, init=False,
        matches=[Match(wm_class=['Pidgin'], role=['Buddy List'])]),
    Group('nx', persist=False, layout='max', init=False,
        matches=[Match(wm_class=['NXClient'])]),
    Group('mail', persist=False, layout='max',
Exemple #3
0
layouts = [
    layout.MonadTall(
        change_ratio=0.04,
        min_ratio=0.26,
        max_ratio=0.74,
        **layout_theme | {"margin": 4},
    ),
    layout.Max(**layout_theme | {"margin": 0}),
    layout.Stack(num_stacks=2, **layout_theme),
    layout.Tile(shift_windows=True, **layout_theme),
]
floating_layout = layout.Floating(
    float_rules=[
        *layout.Floating.default_float_rules,
        Match(wm_class="ssh-askpass"),
        Match(wm_class="optifine-InstallerFrame"),
        Match(wm_class="authy desktop"),
        Match(wm_class="pinentry-gtk-2"),
        Match(wm_class="lxpolkit"),
        Match(wm_class="org.gnome.Characters"),
        Match(wm_class="zoom", title="Settings"),
        Match(title="Picture in picture"),
        Match(wm_class="redshift-gtk"),
        Match(role="GtkFileChooserDialog"),
        Match(wm_class="confirmreset"),
        Match(wm_class="makebranch"),
        Match(wm_class="maketag"),
        Match(title="branchdialog"),
        Match(title="pinentry"),
        Match(title="zoom_linux_float_video_window"),
          lazy.window.bring_to_front(),
          desc="Bring to front"),
    # Click([], "Button3", lazy.function(open_menu), desc="Bring to front"),
]

dgroups_key_binder = None
dgroups_app_rules = []  # type: List
main = None
follow_mouse_focus = True
bring_front_click = False
cursor_warp = False

floating_layout = layout.Floating(
    float_rules=[
        *layout.Floating.default_float_rules,
        Match(wm_class='makebranch'),
        Match(wm_class='URxvt'),
        Match(wm_class='maketag'),
        Match(wm_class='Yad'),
        Match(wm_class='feh'),
        Match(title='branchdialog'),
        Match(title='pinentry'),
        Match(wm_class='ssh-askpass')
    ],
    **layout_defaults,
)
auto_fullscreen = True
focus_on_window_activation = "focus"

app_rules = {
    "Chromium": "1",
Exemple #5
0
groups = [Group(name, **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

#######################################
# Spawn Applications in specific Groups
#######################################

groups = [
    Group("General", matches=[Match(wm_class=["Vivaldi-stable"])]),
    Group("Term", matches=[Match(title=['~'])]),
    Group("Developement", matches=[Match(wm_class=["jetbrains-studio"])]),
    Group("Music", matches=[Match(wm_class=["Deadbeef"])]),
    Group("Games",
          matches=[Match(wm_class=["Steam"]),
                   Match(wm_class=["Lutris"])]),
    Group("VM", matches=[Match(wm_class=["Virt-manager"])]),
    Group("Other", matches=[Match(wm_class=["Barrier"])]),
]

##### DEFAULT THEME SETTINGS FOR LAYOUTS #####
layout_theme = {
    "border_width": 1,
    "margin": 6,
    "border_focus": "#e78aba",
Exemple #6
0
    Key([], 'XF86AudioLowerVolume', lazy.spawn(Commands.volume_down)),
    Key([], 'XF86AudioMute', lazy.spawn(Commands.volume_toggle)),
    # Key([], 'XF86TouchpadToggle', lazy.spawn(Commands.trackpad_toggle)),

    # TODO: What does the PrtSc button map to?
    #Key([mod, 'shift'], 'p', lazy.spawn(Commands.mathpix)),
    Key([mod, 'shift'], 'p', lazy.spawn(Commands.screenshot)),
    Key([mod], 'p', lazy.spawn(Commands.chpix)),
    Key([mod, 'shift'], 'd', lazy.spawn(Commands.screen_display)),
]

# Groups
group_setup = (
    ('', {  # fa-globe
        'layout': 'max',
        'matches': [Match(wm_class=('Opera' ))],
    }),
    ('', {  # fa-code
        'layout': 'max',
        'matches': [Match(wm_class=('Mathpix-snipping-tool',))],
    }),
    ('', {
            'layout': 'max',
            'matches': [Match(wm_class=('Sakura','Xfce4-terminal'))],
    }),  # fa-terminal
    ('', {
            'layout': 'max',
            'matches': [Match(wm_class=('Chromium',))],
             }),
    ('', {  # fa-windows
        'layout': 'max',
Exemple #7
0
# Keybiding for float
# for key, x, y in [("Left", -10, 0),
#                   ("Right", 10, 0),
#                   ("Up", 0, -10),
#                   ("Down", 0, 10)]:
#     keys.append(Key([MOD, "control"], key, lazy.window.move_floating(x, y)))
#     keys.append(Key([MOD, "shift"], key, lazy.window.resize_floating(x, y)))
#     keys.append(Key([MOD, "mod1"], key, lazy.window.move_to_screen_edge(key)))

# Groups
activities = {
    'm':
    Group('main'),
    'w':
    Group('web', matches=[Match(wm_class=["firefox"])]),
    'e':
    Group('editor'),
    'u':
    Group('music', matches=[Match(wm_class=["Spotify"])]),
    'c':
    Group('chat',
          matches=[Match(wm_instance_class=["Microsoft Teams - Preview"])])
}

groups = [g for g in activities.values()]
for k, g in activities.items():
    keys.extend([
        # mod1 + letter of group = switch to group
        Key([MOD],
            k,
Exemple #8
0
    Click([mod], "Button2", lazy.window.bring_to_front())
]


# OTHER STUFF

dgroups_key_binder = None
dgroups_app_rules = []  # type: List
main = None
follow_mouse_focus = True
bring_front_click = False
cursor_warp = False
floating_layout = layout.Floating(
        float_rules=[
    *layout.Floating.default_float_rules,
    Match(wm_class='confirmreset'),  # gitk
    Match(wm_class='makebranch'),  # gitk
    Match(wm_class='maketag'),  # gitk
    Match(wm_class='ssh-askpass'),  # ssh-askpass
    Match(title='branchdialog'),  # gitk
    Match(title='pinentry'),  # GPG key password entry
    Match(wm_class='confirm'),  # gitk
    Match(wm_class='dialog'),  # gitk
    Match(wm_class='download'),  # gitk
    Match(wm_class='error'),  # ssh-askpass
    Match(title='file_progress'),  # gitk
    Match(title='notification'),  # GPG key password entry
    Match(wm_class='splash'),  # ssh-askpass
    Match(wm_class='toolbar'),  # ssh-askpass
    ],
    border_focus=colors["fg3"][0],
Exemple #9
0

keys.extend(
    []
)

####################################################
######   ЁЯМ┐ЁЯНАЁЯРМЁЯРгЁЯРЩЁЯРвЁЯРЛЁЯР╕ЁЯРзЁЯРмЁЯР▓ЁЯРАЁЯРШЁЯРЭЁЯРе  ###########
######         тЩИтЩЙтЩКтЩЛтЩМтЩНтЩОтЩПтЩРтЩС      ###########
######          сЪа сЪв сЪж сЪи сЪ▒ сЪ│ сЪ╖ сЪ╣ сЫП сЫТ      ###########
######            яКТ яБм яЖЖ яЖ╗ яЖИ яЖИ яДо яГл       ###########
######         явд явз явк явн яв░ яв│ яв╢ яв╣ яв╝ яв┐       ###########
####################################################
####################################################
workspaces = [
    {"name": "явд", "key": "1", "matches": [Match(wm_class="firefox")]},
    {
        "name": "явз",
        "key": "2",
        "matches": [
            Match(wm_class="Thunderbird"),
            Match(wm_class="transmission"),
            Match(wm_class="gnome-calendar"),
        ],
    },
    {
        "name": "явк",
        "key": "3",
        "matches": [
            Match(wm_class="joplin"),
            Match(wm_class="libreoffice"),
Exemple #10
0
    Key([mod], "n", lazy.layout.normalize()),
    Key([mod], "o", lazy.layout.maximize()),
    Key([mod, "shift"], "space", lazy.layout.flip()),
    Key([], "XF86AudioRaiseVolume", lazy.spawn("amixer -q set Master 5%+")),
    Key([], "XF86AudioLowerVolume", lazy.spawn("amixer -q set Master 5%-")),
    Key([], "XF86AudioMute", lazy.spawn("amixer -q set Master toggle")),
    Key([], "XF86AudioPlay", lazy.spawn("playerctl play-pause")),
    Key([], "XF86AudioPrev", lazy.spawn("playerctl previous")),
    Key([], "XF86AudioNext", lazy.spawn("playerctl next")),
    Key([], "XF86MonBrightnessUp", lazy.spawn("xbacklight -inc 10")),
    Key([], "XF86MonBrightnessDown", lazy.spawn("xbacklight -dec 10")),
    Key([mod, "shift"], "e", lazy.window.togroup('idea'))
]

groups = [
    Group("1", matches=[Match(wm_class=["Emacs"])]),
    Group("2", matches=[Match(wm_class=["google-chrome", "Firefox"])]),
    Group("3"),
    Group("4", matches=[Match(wm_class=["Spotify", "Slack"])]),
    Group("5"),
    Group("6"),
    Group("7"),
    Group("8"),
    Group("9"),
]

for i in groups:
    # mod1 + letter of group = switch to group
    keys.append(Key([mod], i.name, lazy.group[i.name].toscreen()))

    # mod1 + shift + letter of group = switch to & move focused window to group
Exemple #11
0
layout_conf = {
    'border_focus': colors['focus'][0],
    'border_width': 1,
    'margin': 4
}

layouts = [
    layout.Max(),
    layout.MonadTall(**layout_conf),
    layout.MonadWide(**layout_conf),
    layout.Bsp(**layout_conf),
    layout.Matrix(columns=2, **layout_conf),
    layout.RatioTile(**layout_conf),
    layout.Columns(),
    layout.Tile(),
    layout.TreeTab(),
    layout.VerticalTile(),
    layout.Zoomy(),
]

floating_layout = layout.Floating(float_rules=[
    *layout.Floating.default_float_rules,
    Match(wm_class='confirmreset'),
    Match(wm_class='makebranch'),
    Match(wm_class='maketag'),
    Match(wm_class='ssh-askpass'),
    Match(title='branchdialog'),
    Match(title='pinentry'),
],
                                  border_focus=colors["color4"][0])
Exemple #12
0
def init_groups():
    return [
            Group("!nfo",
                layout='columns',
                layouts=[
                    Columns(**l),
                    Stack(**l),
                ],
                label='!'),
            Group(">kek",
                layout='max',
                layouts=[
                    Max(**l),
                    MonadWide(**l),
                ],
                matches=[
                    Match(title='weechat'),
                ],
                label="@"),
            Group("H4XX",
                layout='max',
                layouts=[
                    Max(**l),
                    Columns(**l),
                    MonadWide(**l),
                ],
                matches=[
                    Match(wm_class='sublime_text'),
                ],
                label="#"),
            Group("$RIPTZ",
                layout='columns',
                layouts=[
                    Columns(**l),
                    RatioTile(**l, ratio_increment=1, fancy=True),
                    Stack(**l),
                    ],
                label="$"),
            Group(".conf",
                layout='columns',
                layouts=[
                    Columns(**l),
                    RatioTile(**l, ratio_increment=1, fancy=True),
                    Stack(**l),
                    ],
                label="%"),
            Group("X_x",
                layout='max',
                layouts=[
                    Max(**l),
                    ],
                label="🖻🖻^"),
            Group("browse",
                layout='monadtall',
                layouts=[
                    MonadTall(**l),
                    MonadWide(**l),
                    ],
                matches=[
                    Match(wm_class='qutebrowser'),
                ],
                label="ð‘™©ð‘™©ð‘™©ð‘™©&"),
            Group(':D',
                layout='columns',
                layouts=[
                    Columns(**l),
                ],
                label='*'),
            Group('/3/',
                layout='max',
                layouts=[
                    Max(**l)
                    ],
                matches=[
                    Match(wm_class='Blender'),
                ],
                label='9'),
            Group('/gd/',
                layout='max',
                layouts=[
                    Max(**l)
                    ],
                matches=[
                    Match(wm_class=[
                        'gimp',
                        'krita',
                        'mypaint',
                        ])
                ],
                label='0'),
            ScratchPad('scratch', [
                    DropDown('term', TERMUX),
                ]),
    ]
Exemple #13
0
cursor_warp = True

floating_layout_theme = {
    'border_focus': colors_custom[3][0],
    'border_normal': colors_standard[0][0],
    'border_width': 2
}

floating_layout = layout.Floating(
    **floating_layout_theme,
    float_rules=[
        # Run the utility of `xprop` to see the wm class and name of an X client.

        # Default rules
        *layout.Floating.default_float_rules,
        Match(title='branchdialog'),
        Match(title='pinentry'),
        Match(wm_class='confirm'),
        Match(wm_class='confirmreset'),
        Match(wm_class='dialog'),
        Match(wm_class='download'),
        Match(wm_class='error'),
        Match(wm_class='file_progress'),
        Match(wm_class='makebranch'),
        Match(wm_class='maketag'),
        Match(wm_class='notification'),
        Match(wm_class='splash'),
        Match(wm_class='ssh-askpass'),
        Match(wm_class='toolbar'),
        Match(wm_type='pop-up'),
Exemple #14
0
@hook.subscribe.client_new
def set_floating(window):
    if (window.window.get_wm_transient_for()
            or window.window.get_wm_type() in floating_types):
        window.floating = True

floating_types = ["notification", "toolbar", "splash", "dialog"]


follow_mouse_focus = True
bring_front_click = False
cursor_warp = False
floating_layout = layout.Floating(float_rules=[
    # Run the utility of `xprop` to see the wm class and name of an X client.
    *layout.Floating.default_float_rules, 
    Match(wm_class='confirmreset'),  # gitk
    Match(wm_class='makebranch'),  # gitk
    Match(wm_class='maketag'),  # gitk
    Match(wm_class='ssh-askpass'),  # ssh-askpass
    Match(title='branchdialog'),  # gitk
    Match(title='pinentry'),  # GPG key password entry
    Match(wm_class='Arcolinux-welcome-app.py'),
    Match(wm_class='Arcolinux-tweak-tool.py'),
    Match(wm_class='Arcolinux-calamares-tool.py'),
    Match(wm_class='confirm'),
    Match(wm_class='dialog'),
    Match(wm_class='download'),
    Match(wm_class='error'),
    Match(wm_class='file_progress'),
    Match(wm_class='notification'),
    Match(wm_class='splash'),
Exemple #15
0
 def match(self, match: config.Match) -> bool:
     """Compare this window against a Match instance."""
     return match.compare(self)
Exemple #16
0
# throwaway groups for random stuff
for i in ['1', '2', '3', '4', '5', '6', '7', '8', '9']:
    groups.append(Group(i))
    keys.append(Key([mod], i, lazy.group[i].toscreen()))
    keys.append(Key([mod, "shift"], i, lazy.window.togroup(i)))

groups.append(Group("X"))

# groups with special jobs. I usually navigate to these via my app_or_group
# function.
groups.extend([
    Group('music',
          spawn='clementine',
          layout='max',
          persist=False,
          matches=[Match(wm_class=['Clementine', 'Viridian'])]),
    Group('www',
          spawn='google-chrome',
          layout='max',
          persist=False,
          matches=[
              Match(wm_class=['Firefox', 'google-chrome', 'Google-chrome'])
          ]),
])

border_args = dict(border_width=1, )

layouts = [
    layout.Wmii(),
    layout.Stack(num_stacks=2, **border_args),
    layout.Max(),
Exemple #17
0
]

for i in range(len(group_names)):
    groups.extend([
        Group(
            name=group_names[i],
            label=group_labels[i],
            layout=group_layouts[i],
        )
    ])

groups[1] = Group(name="2",
                  label="",
                  layout="max",
                  matches=[
                      Match(wm_class=["code"]),
                  ])

groups[3] = Group(name="4",
                  label="",
                  layout="max",
                  matches=[
                      Match(wm_class=["scrcpy"]),
                  ])

groups[8] = Group(name="9",
                  label="",
                  layout="max",
                  matches=[
                      Match(wm_class=["netease-cloud-music"]),
                      Match(wm_class=["xdman-Main"]),
Exemple #18
0
def init_float_rules():
    return [
        # Run the utility of `xprop` to see the wm class and name of an X client.
        Match(wm_type='utility'),
        Match(wm_type='notification'),
        Match(wm_type='toolbar'),
        Match(wm_type='splash'),
        Match(wm_type='dialog'),
        Match(wm_class='file_progress'),
        Match(wm_class='confirm'),
        Match(wm_class='dialog'),
        Match(wm_class='download'),
        Match(wm_class='error'),
        Match(wm_class='notification'),
        Match(wm_class='splash'),
        Match(wm_class='toolbar'),
        Match(wm_class='confirmreset'),  # gitk
        Match(wm_class='makebranch'),  # gitk
        Match(wm_class='maketag'),  # gitk
        Match(wm_class='ssh-askpass'),  # ssh-askpass
        Match(title='branchdialog'),  # gitk
        Match(title='pinentry'),  # GPG key password entry
    ]
Exemple #19
0
    Key([], "XF86AudioNext", lazy.spawn("playerctl next")),

    # Brightness control
    Key([], "XF86MonBrightnessDown", lazy.spawn("sudo xbacklight -set 1")),
    Key([], "XF86MonBrightnessUp", lazy.spawn("sudo xbacklight -set 100")),

    # Quick-pause for games
    Key([mod, "control"], "m", lazy.spawn("/home/ibb/bin/toggle-game-pause")),
]

groups = [
    Group("a", label="a "),  # Chrome
    Group("s", label="s "),  # Slack
    Group("d", label="d "),  # Terminal
    Group("f", label="f "),  # Games
    Group("j", label="j ", matches=[Match(wm_class="zoom")]),  # Zoom
    Group("k", label="k "),  # Misc
    Group("l", label="l "),  # Misc
]

for i in groups:
    keys.extend([
        # mod1 + letter of group = switch to group
        Key([mod], i.name, lazy.group[i.name].toscreen()),

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

layouts = [
Exemple #20
0
  #   Split: All windows displayed
  #   Unsplit: 1 window displayed, like Max layout, but w/ mult stack panes
  Key([mod, "control"], "space", lazy.layout.toggle_split()),
  Key([mod], "Return", lazy.spawn("urxvt")),
  # Toggle between different layouts as defined below
  Key([mod], "Tab", lazy.next_layout()),
  Key([mod, "shift"], 'w', lazy.window.kill()),
  Key([mod, "control"], 'r', lazy.restart()),
  Key([mod, "control"], 'q', lazy.shutdown()),
  Key([mod], 'd', lazy.spawncmd()),
]

# Define apps used to chat for ease of configurability
chat_apps = ["org.telegram.desktop", "com.discordapp.Discord"]
chat_apps_matches = [
  Match(wm_class=[chat_apps[0]]),
  Match(wm_class=[chat_apps[1]]),
  Match(wm_class=["org.kde.Platform"])
]

# Define groups
groups = [
  Group("dev", layout="max", matches=[Match(wm_class=["Emacs"])]),
  Group("sys"),
  Group("www", matches=[Match(wm_class=["Firefox"])]),
  Group("med"),
  Group("gfx"),
  Group("cht", matches=chat_apps_matches, spawn=chat_apps)
]
# Add keybinds for groups
for i, word in enumerate(groups, start=1):
Exemple #21
0
groups = []

# throwaway groups for random stuff
for i in ['a', 's', 'd', 'f', 'u', 'i', 'o', 'p']:
    groups.append(Group(i))
    keys.append(Key([mod], i, lazy.group[i].toscreen()))
    keys.append(Key([mod, "mod1"], i, lazy.window.togroup(i)))

# groups with special jobs. I usually navigate to these via my app_or_group
# function.
groups.extend([
    Group('music',
          spawn='clementine',
          layout='max',
          persist=False,
          matches=[Match(wm_class=['Clementine', 'Viridian'])]),
    Group('www',
          spawn='firefox-bin',
          layout='max',
          matches=[
              Match(wm_class=['Firefox', 'google-chrome', 'Google-chrome'])
          ]),
    Group('io',
          layout='pidgin',
          persist=False,
          matches=[Match(wm_class=['Pidgin'], role=['Buddy List'])]),
    Group('java',
          persist=False,
          matches=[Match(wm_class=['sun-awt-X11-XFramePeer', 'GroupWise'])]),
])
Exemple #22
0
         "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
cursor_warp = False
floating_layout = layout.Floating(
    float_rules=[
        # Run the utility of `xprop` to see the wm class and name of an X client
        *layout.Floating.default_float_rules,
        Match(wm_class='gsimplecal'),
        Match(wm_class='crx_nngceckbapebfimnlniiiahkandclblb'
              ),  # bitwarden extension
    ],
    **layout_theme)
auto_fullscreen = True
focus_on_window_activation = "smart"
reconfigure_screens = True

# 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
Exemple #23
0
# Behavior of the _NET_ACTIVATE_WINDOW message sent by applications
# urgent: urgent flag is set for the window
# focus: automatically focus the window
# smart: automatically focus if the window is in the current group
# never: never automatically focus any window that requests it
focus_on_window_activation = "smart"

# Controls whether or not focus follows the mouse around as it moves across windows in a layout
follow_mouse_focus = True

# The default floating layout to use. This allows you to set custom floating rules among other things if you wish
floating_layout = layout.Floating(float_rules=[
    # Run the utility of `xprop` to see the wm class and name of an X client.
    *layout.Floating.default_float_rules,
    Match(wm_class='confirmreset'),  # gitk
    Match(wm_class='makebranch'),  # gitk
    Match(wm_class='maketag'),  # gitk
    Match(wm_class='ssh-askpass'),  # ssh-askpass
    Match(title='branchdialog'),  # gitk
    Match(title='pinentry'),  # GPG key password entry
])


# ================================================================
# =========================== Programs ===========================
# ================================================================
# Programs
terminal = "termite -t Termite"
explorer =  terminal + " -e vifm -t Vifm"
browser = "qutebrowser"
Exemple #24
0
    # Save screen to screenshots folder
    Key([mod], "Print",
        lazy.spawn("/usr/bin/escrotum " + home + "/Pictures/Screenshots/screenshot_%d_%m_%Y_%H_%M_%S.png"),
        desc='Save screen to screenshots folder'
        ),
    # Capture region of screen to clipboard
    Key([mod, "shift"], "s",
        lazy.spawn("/usr/bin/escrotum -Cs"),
        desc='Capture region of screen to clipboard'
        ),
]

# Groups with matches

workspaces = [
    {"name": " ₁", "key": "1", "matches": [Match(wm_class='firefox')], "layout": "monadtall"},
    {"name": " ₂", "key": "2", "matches": [Match(wm_class='kitty'), Match(wm_class='ranger')], "layout": "monadtall"},
    {"name": " ₃", "key": "3", "matches": [Match(wm_class='vim')], "layout": "monadtall"},
    {"name": " ₄", "key": "4", "matches": [Match(wm_class='telegram-desktop'), Match(wm_class='weechat')], "layout": "monadtall"},
    {"name": " ₅", "key": "5", "matches": [Match(wm_class='gimp-2.10')], "layout": "monadtall"},
    {"name": "阮 ₆", "key": "6", "matches": [Match(wm_class='spotify')], "layout": "monadtall"},
    {"name": " ₇", "key": "7", "matches": [Match(wm_class='libreoffice')], "layout": "monadtall"},
    {"name": " ₈", "key": "8", "matches": [Match(wm_class='newsboat')], "layout": "monadtall"},
    {"name": " ₉", "key": "9", "matches": [Match(wm_class='neomutt')], "layout": "monadtall"},
]

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))
Exemple #25
0
    # COLUMNS LAYOUT STACK OR SPLIT
    Key([mod], "w", lazy.layout.toggle_split()),

    # TOGGLE FLOATING LAYOUT
    Key([mod, "shift"], "t", lazy.window.toggle_floating()),
]

###############################################################################
# => GROUPS
###############################################################################
groups = []

group_matches = [
    # workspace 1
    [Match(wm_class=[])],
    # workspace 2
    [
        Match(wm_class=[
            "Atom",
            "Subl3",
            "Spyder",
            "RStudio",
            "TeXstudio",
            "texstudio",
            "atom",
            "subl3",
            "octave-gui",
            "brackets",
            "code-oss",
            "code",
Exemple #26
0
###########
# Imports #
###########
import re

from libqtile        import layout
from libqtile.config import Match

###########
# Layouts #
###########
layouts = [
    layout.Columns(name="Col", border_focus_stack='#d75f5f', margin=10),
    layout.MonadTall(name="Tall", margin=5),
    layout.MonadWide(name="Wide", margin=5),
    layout.Tile(name="Tile", margin=5),
    layout.TreeTab(name="Tab", margin=5),
]

floating_layout = layout.Floating(float_rules=[
    # Run the utility of `xprop` to see the wm class and name of an X client.
    *layout.Floating.default_float_rules,
    Match(wm_class='confirmreset'),  # gitk
    Match(wm_class='makebranch'),  # gitk
    Match(wm_class='maketag'),  # gitk
    Match(wm_class='ssh-askpass'),  # ssh-askpass
    Match(title='branchdialog'),  # gitk
    Match(title='pinentry'),  # GPG key password entry
    Match(wm_class=re.compile('dialog-.*')), # Custom dialogs
])
Exemple #27
0
         "Button3",
         lazy.window.set_size_floating(),
         start=lazy.window.get_size()),
    Click(['mod4'], "Button2", lazy.window.bring_to_front())
]

dgroups_key_binder = simple_key_binder('mod4', '123qw')
dgroups_app_rules = []  # type: List
main = None  # WARNING: this is deprecated and will be removed soon
follow_mouse_focus = True
bring_front_click = False
cursor_warp = False
floating_layout = layout.Floating(float_rules=[
    # Run the utility of `xprop` to see the wm class and name of an X client.
    *layout.Floating.default_float_rules,
    Match(wm_class='confirmreset'),  # gitk
    Match(wm_class='makebranch'),  # gitk
    Match(wm_class='maketag'),  # gitk
    Match(wm_class='ssh-askpass'),  # ssh-askpass
    Match(title='branchdialog'),  # gitk
    Match(title='pinentry'),  # GPG key password entry
])
auto_fullscreen = True
focus_on_window_activation = "smart"

# 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.
#
Exemple #28
0
         "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
main = None  # WARNING: this is deprecated and will be removed soon
follow_mouse_focus = True
bring_front_click = False
cursor_warp = False
floating_layout = layout.Floating(float_rules=[
    # Run the utility of `xprop` to see the wm class and name of an X client.
    *layout.Floating.default_float_rules,
    Match(wm_class="confirmreset"),  # gitk
    Match(wm_class="makebranch"),  # gitk
    Match(wm_class="maketag"),  # gitk
    Match(wm_class="ssh-askpass"),  # ssh-askpass
    Match(title="branchdialog"),  # gitk
    Match(title="pinentry"),  # GPG key password entry
])
auto_fullscreen = True
focus_on_window_activation = "smart"


@hook.subscribe.startup_once
def autostart():
    home = os.path.expanduser("~/.config/qtile/autostart.sh")
    subprocess.call([home])
Exemple #29
0
    Systray,
    Net,
    Volume,
    Clock,
    KeyboardLayout,
    WindowCount,
    #    CapsNumLockIndicator,
    #    Chord,
    QuickExit,
)

mod = "mod4"
terminal = guess_terminal()

groups = [
    Group("WEB", layout='monadtall', matches=[Match(wm_class=["chromium"])]),
    Group(
        "RED",
        layout='monadwide',
    ),
    Group("DEV", layout='matrix', matches=[Match(wm_class=["nemo"])]),
    Group(
        "ZOO",
        layout='zoomy',
    ),
    Group("MAX", layout='max', matches=[Match(wm_class=["etl"])]),
]

#----- Play around Groups
# MOD4 + index Number : Switch to Group[index]
# MOD4 + shift + index Number : Send active window to another Group
Exemple #30
0
class Floating(Layout):
    """
    Floating layout, which does nothing with windows but handles focus order
    """

    default_float_rules = [
        Match(wm_type="utility"),
        Match(wm_type="notification"),
        Match(wm_type="toolbar"),
        Match(wm_type="splash"),
        Match(wm_type="dialog"),
        Match(wm_class="file_progress"),
        Match(wm_class="confirm"),
        Match(wm_class="dialog"),
        Match(wm_class="download"),
        Match(wm_class="error"),
        Match(wm_class="notification"),
        Match(wm_class="splash"),
        Match(wm_class="toolbar"),
        Match(func=lambda c: c.has_fixed_size()),
        Match(func=lambda c: c.has_fixed_ratio()),
    ]

    defaults = [
        ("border_focus", "#0000ff", "Border colour(s) for the focused window."),
        ("border_normal", "#000000", "Border colour(s) for un-focused windows."),
        ("border_width", 1, "Border width."),
        ("max_border_width", 0, "Border width for maximize."),
        ("fullscreen_border_width", 0, "Border width for fullscreen."),
    ]

    def __init__(
        self, float_rules: list[Match] | None = None, no_reposition_rules=None, **config
    ):
        """
        If you have certain apps that you always want to float you can provide
        ``float_rules`` to do so. ``float_rules`` are a list of
        Match objects::

            from libqtile.config import Match
            Match(title=WM_NAME, wm_class=WM_CLASS, role=WM_WINDOW_ROLE)

        When a new window is opened its ``match`` method is called with each of
        these rules.  If one matches, the window will float.  The following
        will float GIMP and Skype::

            from libqtile.config import Match
            float_rules=[Match(wm_class="skype"), Match(wm_class="gimp")]

        The following ``Match`` will float all windows that are transient windows for a
        parent window:

            Match(func=lambda c: bool(c.is_transient_for()))

        Specify these in the ``floating_layout`` in your config.

        Floating layout will try to center most of floating windows by default,
        but if you don't want this to happen for certain windows that are
        centered by mistake, you can use ``no_reposition_rules`` option to
        specify them and layout will rely on windows to position themselves in
        correct location on the screen.
        """
        Layout.__init__(self, **config)
        self.clients: list[Window] = []
        self.focused = None
        self.group = None

        if float_rules is None:
            float_rules = self.default_float_rules

        self.float_rules = float_rules
        self.no_reposition_rules = no_reposition_rules or []
        self.add_defaults(Floating.defaults)

    def match(self, win):
        """Used to default float some windows"""
        return any(win.match(rule) for rule in self.float_rules)

    def find_clients(self, group):
        """Find all clients belonging to a given group"""
        return [c for c in self.clients if c.group is group]

    def to_screen(self, group, new_screen):
        """Adjust offsets of clients within current screen"""
        for win in self.find_clients(group):
            if win.maximized:
                win.maximized = True
            elif win.fullscreen:
                win.fullscreen = True
            else:
                # If the window hasn't been floated before, it will be configured in
                # .configure()
                if win.float_x is not None and win.float_y is not None:
                    # By default, place window at same offset from top corner
                    new_x = new_screen.x + win.float_x
                    new_y = new_screen.y + win.float_y
                    # make sure window isn't off screen left/right...
                    new_x = min(new_x, new_screen.x + new_screen.width - win.width)
                    new_x = max(new_x, new_screen.x)
                    # and up/down
                    new_y = min(new_y, new_screen.y + new_screen.height - win.height)
                    new_y = max(new_y, new_screen.y)

                    win.x = new_x
                    win.y = new_y
            win.group = new_screen.group

    def focus_first(self, group=None):
        if group is None:
            clients = self.clients
        else:
            clients = self.find_clients(group)

        if clients:
            return clients[0]

    def focus_next(self, win):
        if win not in self.clients or win.group is None:
            return

        clients = self.find_clients(win.group)
        idx = clients.index(win)
        if len(clients) > idx + 1:
            return clients[idx + 1]

    def focus_last(self, group=None):
        if group is None:
            clients = self.clients
        else:
            clients = self.find_clients(group)

        if clients:
            return clients[-1]

    def focus_previous(self, win):
        if win not in self.clients or win.group is None:
            return

        clients = self.find_clients(win.group)
        idx = clients.index(win)
        if idx > 0:
            return clients[idx - 1]

    def focus(self, client):
        self.focused = client

    def blur(self):
        self.focused = None

    def on_screen(self, client, screen_rect):
        if client.x < screen_rect.x:  # client's left edge
            return False
        if screen_rect.x + screen_rect.width < client.x + client.width:  # right
            return False
        if client.y < screen_rect.y:  # top
            return False
        if screen_rect.y + screen_rect.width < client.y + client.height:  # bottom
            return False
        return True

    def compute_client_position(self, client, screen_rect):
        """recompute client.x and client.y, returning whether or not to place
        this client above other windows or not"""
        above = True

        if client.has_user_set_position() and not self.on_screen(client, screen_rect):
            # move to screen
            client.x = screen_rect.x + client.x
            client.y = screen_rect.y + client.y
        if not client.has_user_set_position() or not self.on_screen(client, screen_rect):
            # client has not been properly placed before or it is off screen
            transient_for = client.is_transient_for()
            if transient_for is not None:
                # if transient for a window, place in the center of the window
                center_x = transient_for.x + transient_for.width / 2
                center_y = transient_for.y + transient_for.height / 2
                above = False
            else:
                center_x = screen_rect.x + screen_rect.width / 2
                center_y = screen_rect.y + screen_rect.height / 2

            x = center_x - client.width / 2
            y = center_y - client.height / 2

            # don't go off the right...
            x = min(x, screen_rect.x + screen_rect.width - client.width)
            # or left...
            x = max(x, screen_rect.x)
            # or bottom...
            y = min(y, screen_rect.y + screen_rect.height - client.height)
            # or top
            y = max(y, screen_rect.y)

            client.x = int(round(x))
            client.y = int(round(y))
        return above

    def configure(self, client, screen_rect):
        if client.has_focus:
            bc = self.border_focus
        else:
            bc = self.border_normal

        if client.maximized:
            bw = self.max_border_width
        elif client.fullscreen:
            bw = self.fullscreen_border_width
        else:
            bw = self.border_width

        # 'sun-awt-X11-XWindowPeer' is a dropdown used in Java application,
        # don't reposition it anywhere, let Java app to control it
        cls = client.get_wm_class() or ""
        is_java_dropdown = "sun-awt-X11-XWindowPeer" in cls
        if is_java_dropdown:
            client.paint_borders(bc, bw)
            client.cmd_bring_to_front()

        # alternatively, users may have asked us explicitly to leave the client alone
        elif any(m.compare(client) for m in self.no_reposition_rules):
            client.paint_borders(bc, bw)
            client.cmd_bring_to_front()

        else:
            above = False

            # We definitely have a screen here, so let's be sure we'll float on screen
            if client.float_x is None or client.float_y is None:
                # this window hasn't been placed before, let's put it in a sensible spot
                above = self.compute_client_position(client, screen_rect)

            client.place(
                client.x,
                client.y,
                client.width,
                client.height,
                bw,
                bc,
                above,
                respect_hints=True,
            )
        client.unhide()

    def add(self, client):
        self.clients.append(client)
        self.focused = client

    def remove(self, client):
        if client not in self.clients:
            return

        next_focus = self.focus_next(client)
        if client is self.focused:
            self.blur()
        self.clients.remove(client)
        return next_focus

    def get_windows(self):
        return self.clients

    def info(self):
        d = Layout.info(self)
        d["clients"] = [c.name for c in self.clients]
        return d

    def cmd_next(self):
        # This can't ever be called, but implement the abstract method
        pass

    def cmd_previous(self):
        # This can't ever be called, but implement the abstract method
        pass