I hate this

This commit is contained in:
Michał Gdula 2023-04-19 11:04:08 +01:00
parent a9846b4ecd
commit 8c7569868d
416 changed files with 1549 additions and 208 deletions

View file

@ -0,0 +1,14 @@
import os
import subprocess
from libqtile import hook
@hook.subscribe.startup_once
def autostart():
home = os.path.expanduser('~/.config/qtile/autostart.sh')
subprocess.Popen([home])
@hook.subscribe.startup
def runner():
import subprocess
subprocess.Popen(['xsetroot', '-cursor_name', 'left_ptr'])

View file

@ -0,0 +1,149 @@
# ----------------------------------------
# Importing
# ----------------------------------------
# Used to control windows and window
# placement
from libqtile.command import lazy
from libqtile.config import EzKey, EzDrag, EzClick
import os
@lazy.window.function
def float_to_front(window):
if window.floating:
window.cmd_bring_to_front()
# ----------------------------------------
# Default apps
# ----------------------------------------
# I mostly use Rofi to launch apps so not
# too important to me
TERMINAL = "alacritty"
SCREENSHOT = "flameshot gui"
LAUNCHER = "rofi -show drun\
-theme-str '#window {\
anchor: center; location: center;\
y-offset: 0; x-offset: 0;\
}'"
BROWSER = "firefox"
# ----------------------------------------
# Modifier keys
# ----------------------------------------
# Used to move and control window
# placement within Qtile
EzKey.modifier_keys = {
"M": "mod4", # Windows
"A": "mod1", # Alt
"S": "shift", # Shift
"C": "control", # Ctrl
}
# ----------------------------------------
# Mouse
# ----------------------------------------
# Controling floating windows with a
# mouse
mouse = [
EzDrag(
"M-<Button1>",
lazy.window.set_position_floating(),
start=lazy.window.get_position(),
),
EzDrag(
"M-<Button3>", lazy.window.set_size_floating(), start=lazy.window.get_size()
),
EzClick("M-<Button2>", lazy.window.bring_to_front()),
]
# ----------------------------------------
# Window
# ----------------------------------------
# Different lists of window controls for
# Qtile
window_navigation = [
EzKey("M-<Tab>", lazy.group.next_window(), float_to_front()),
EzKey("M-<Left>", lazy.layout.left()),
EzKey("M-<Down>", lazy.layout.down()),
EzKey("M-<Up>", lazy.layout.up()),
EzKey("M-<Right>", lazy.layout.right()),
]
window_displacement = [
EzKey("M-C-<Left>", lazy.layout.swap_left(), lazy.layout.shuffle_left()),
EzKey("M-C-<Down>", lazy.layout.swap_down(), lazy.layout.shuffle_down()),
EzKey("M-C-<Up>", lazy.layout.swap_up(), lazy.layout.shuffle_up()),
EzKey("M-C-<Right>", lazy.layout.swap_right(), lazy.layout.shuffle_right()),
]
window_dimension = [
EzKey("M-S-<Left>", lazy.layout.grow()),
EzKey("M-S-<Right>", lazy.layout.shrink()),
EzKey("M-S-<Tab>", lazy.layout.reset()),
]
window_toggles = [
EzKey("M-y", lazy.next_layout()),
EzKey("M-q", lazy.window.kill()),
EzKey("M-g", lazy.window.toggle_floating()),
EzKey("M-m", lazy.window.toggle_fullscreen()),
]
# ----------------------------------------
# Qtile and App
# ----------------------------------------
# Launching apps and qtile settings
qtilectl = [
EzKey("M-S-r", lazy.restart()),
EzKey("M-S-q", lazy.shutdown()),
EzKey("M-L", lazy.spawn("dm-tool lock")),
]
rofi = [
EzKey("M-r", lazy.spawn(LAUNCHER)),
]
application_spawns = [
EzKey("M-t", lazy.spawn(TERMINAL)),
EzKey("M-b", lazy.spawn(BROWSER)),
]
mediactl = [
EzKey("<XF86AudioPlay>", lazy.spawn("playerctl play-pause -i firefox")),
EzKey("<XF86AudioNext>", lazy.spawn("playerctl next -i firefox")),
EzKey("<XF86AudioPrev>", lazy.spawn("playerctl previous -i firefox")),
]
volumectl = [
EzKey("<XF86AudioRaiseVolume>", lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ +5%")),
EzKey("<XF86AudioLowerVolume>", lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ -5%")),
EzKey("<XF86AudioMute>", lazy.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")),
EzKey("M-f", lazy.spawn(os.path.expanduser("~/.config/qtile/scripts/toggle_mic"))),
]
scrcap = [
EzKey("<Print>", lazy.spawn(SCREENSHOT)),
]
# ----------------------------------------
# Keybinds
# ----------------------------------------
# Putting all keybinds into one list to
# use in other scripts
keys = [
*window_navigation,
*window_displacement,
*window_dimension,
*window_toggles,
*qtilectl,
*rofi,
*application_spawns,
*mediactl,
*volumectl,
*scrcap,
]

View file

@ -0,0 +1,17 @@
paradise = [
"#151515", # bg
"#E8E3E3", # fg
"#8C977D", # accent
"#101010", # black
"#E8E3E3", # white
"#B66467", # red
"#D9BC8C", # orange
"#D9BC8C", # yellow
"#8C977D", # green
"#8DA3B9", # blue
"#A988B0", # purple
]
theme = paradise

View file

@ -0,0 +1,81 @@
# ----------------------------------------
# Importing
# ----------------------------------------
# Used to move workspaces and windows
from libqtile import layout
from libqtile.command import lazy
from libqtile.config import EzKey, Group, Match, Screen
from modules.keybinds import keys
from modules.themes import theme
# ----------------------------------------
# Groups
# ----------------------------------------
# Listing usable groups/workspaces
groups = [
Group("1", label="1"),
Group("2", label="2"),
Group("3", label="3"),
Group("4", label="4"),
Group("5", label="5"),
Group("6", label="6"),
Group("7", label="7"),
Group("8", label="8"),
Group("9", label="9"),
]
# ----------------------------------------
# Keybinds
# ----------------------------------------
# Used to move view/application to
# different workspace/group
for i in groups:
keys.extend(
[
# mod1 + letter of group = switch to group
EzKey("M-%s" % i.name, lazy.group[i.name].toscreen()),
# mod1 + shift + letter of group => move focused window to group
EzKey("M-S-%s" % i.name, lazy.window.togroup(i.name)),
]
)
border = dict(
border_focus=theme[0],
border_normal=theme[3],
border_width=0,
margin=8,
)
layouts = [
layout.MonadTall(**border, ratio=0.5),
layout.MonadThreeCol(**border),
layout.MonadWide(**border, ratio=0.69),
layout.Spiral(**border),
layout.Max(**border),
]
floating_layout = layout.Floating(
**border,
float_rules=[
*layout.Floating.default_float_rules,
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"),
Match(wm_class="toolbar"),
Match(wm_class="confirmreset"), # gitk
Match(wm_class="makebranch"), # gitk
Match(wm_class="maketag"), # gitk
Match(title="branchdialog"), # gitk
Match(wm_class="pinentry"), # GPG key password entry
Match(title="Picture-in-Picture"), # FireFox
Match(wm_class="ssh-askpass"), # ssh-askpass
],
)
screens = [ Screen() ]