diff --git a/alacritty/.config/alacritty/alacritty.yml b/alacritty/.config/alacritty/alacritty.yml index 73c356e..7fd9787 100644 --- a/alacritty/.config/alacritty/alacritty.yml +++ b/alacritty/.config/alacritty/alacritty.yml @@ -48,7 +48,7 @@ schemas: bright: *bright-colors lupan_material_dark: &lupan-material-dark primary: - background: '#424242' + background: '#263238' foreground: '#eeeeee' normal: &material-dark-normal black: '#212121' diff --git a/qtile/.config/qtile/colors.py b/qtile/.config/qtile/colors.py index 0b3682e..ce703cd 100644 --- a/qtile/.config/qtile/colors.py +++ b/qtile/.config/qtile/colors.py @@ -1,3 +1,5 @@ +# Selected colors from https://windicss.org/utilities/colors.html + colors = { "indigo": { 50: "#eef2ff", diff --git a/qtile/.config/qtile/config.py b/qtile/.config/qtile/config.py index 477de87..1315fbd 100644 --- a/qtile/.config/qtile/config.py +++ b/qtile/.config/qtile/config.py @@ -1,13 +1,17 @@ -from libqtile import bar, widget -from libqtile.config import Group, Key, Screen +from libqtile import bar, layout, qtile, widget +from libqtile.config import Group, Key, KeyChord, Screen from libqtile.lazy import lazy +from themes import apply_theme, subtheme, theme, toggle_theme + mod = "mod4" terminal = "alacritty" widget_defaults = dict( font="Iosevka Slab Light", fontsize=26, + padding=5, + foreground=theme["foreground"], ) keys = [] @@ -17,19 +21,33 @@ groups = [Group(name) for name in group_names] keys.extend([Key([mod], name, lazy.group[name].toscreen(toggle=False), desc=f"Switch to group {name}") for name in group_names]) keys.extend([Key([mod, "shift"], name, lazy.window.togroup(name), desc=f"Move window to group {name}") for name in group_names]) +layouts = [ + layout.Max(), + layout.Columns(border_width=4, margin=4, **subtheme("border_focus", "border_normal")), +] + screens = [ Screen(top=bar.Bar([ - widget.GroupBox(), + widget.Spacer(10), + widget.CurrentLayout(fmt="[{:3.3}]"), + widget.Spacer(10), + widget.GroupBox(highlight_method='block', + padding_y=10, + active=theme["foreground"], + **subtheme("inactive", "this_current_screen_border")), + widget.Spacer(15), widget.WindowName(), widget.Spacer(), widget.Clock(), - ], 48)), + widget.Spacer(10), + ], 48, background=theme["background"])), ] keys.extend([ Key([mod], "Return", lazy.spawn(terminal), desc="Run terminal "), Key([mod], "e", lazy.spawn("emacsclient -n -c"), desc="Open new Emacs frame"), - Key([mod], "space", lazy.spawn(["rofi", "-theme", "Arc", "-kb-row-select", "Tab", "-kb-row-tab", "", "-show", "run"]), desc="Run command"), + Key([mod], "space", lazy.spawn(["rofi", "-theme", theme["rofi_theme"], "-kb-row-select", "Tab", "-kb-row-tab", "", "-show", "run"]), + desc="Run command"), Key([mod], "Tab", lazy.screen.toggle_group(), desc="Toggle between current and previous group"), Key([mod], "h", lazy.layout.left(), desc="Focus window on the left of current one"), @@ -46,7 +64,20 @@ keys.extend([ Key([mod, "control"], "l", lazy.layout.grow_right(), desc="Grow current window on its right"), Key([mod], "w", lazy.window.kill(), desc="Kill focused window"), + Key([mod], "s", lazy.window.toggle_floating(), desc="Toggle window floating"), + Key([mod], "m", lazy.next_layout(), desc="Next layout"), + Key([mod, "shift"], "F6", lazy.function(toggle_theme), lazy.restart(), desc="Kill focused window"), + + KeyChord([mod], "semicolon", [ + Key(["shift"], "h", lazy.spawn("systemctl hibernate")), + Key(["shift"], "l", lazy.spawn("slock")), + Key(["shift"], "s", lazy.spawn("systemctl suspend")), + ]), Key([mod, "control"], "q", lazy.shutdown(), desc="Quit qtile"), Key([mod, "control"], "r", lazy.restart(), desc="Restart qtile"), ]) + +cursor_warp = True + +apply_theme(qtile) diff --git a/qtile/.config/qtile/themes.py b/qtile/.config/qtile/themes.py index 61da341..fe32994 100644 --- a/qtile/.config/qtile/themes.py +++ b/qtile/.config/qtile/themes.py @@ -24,22 +24,26 @@ def toggle_theme(qtile): write_theme(light_dark("dark", "light")) theme = dict( - background=light_dark(colors["blue-gray"][200], colors["blue-gray"][700]), - bar_background=light_dark([colors["blue-gray"][200], colors["blue-gray"][300]], - [colors["blue-gray"][600], colors["blue-gray"][900]]), - widget_foreground=light_dark(colors["blue-gray"][600], colors["blue-gray"][400]), + root_background=light_dark(colors["blue-gray"][300], colors["blue-gray"][700]), + background=light_dark([colors["blue-gray"][200], colors["blue-gray"][300]], + [colors["blue-gray"][700], colors["blue-gray"][800]]), + foreground=light_dark(colors["blue-gray"][600], colors["blue-gray"][400]), inactive=light_dark(colors["blue-gray"][400], colors["blue-gray"][500]), - this_current_screen_border=light_dark([colors["blue-gray"][200], colors["blue-gray"][50]], - [colors["blue-gray"][900], colors["blue-gray"][800]]), + this_current_screen_border=light_dark([colors["blue-gray"][50], colors["blue-gray"][200]], + [colors["blue-gray"][600], colors["blue-gray"][700]]), border_focus=light_dark(colors["indigo"][400], colors["blue-gray"][500]), - border_normal=light_dark(colors["indigo"][900], colors["blue-gray"][900]), - alacritty_theme=light_dark("lupan-material-light", "lupan-dark-gray"), - emacs_theme=light_dark("lupan-material-light", "lupan-dark-gray"), + border_normal=light_dark(colors["indigo"][900], colors["blue-gray"][800]), + alacritty_theme=light_dark("lupan-material-light", "lupan-material-dark"), + emacs_theme=light_dark("material-light", "material"), gtk_theme=light_dark("Materia-light", "Materia-dark"), + rofi_theme=light_dark("Arc", "Arc-Dark"), ) -def init_theme(qtile): - qtile.cmd_spawn(["xsetroot", "-solid", theme["background"]]) +def subtheme(*names): + return {name: theme[name] for name in names} + +def apply_theme(qtile): + qtile.cmd_spawn(["xsetroot", "-solid", theme["root_background"]]) qtile.cmd_spawn(["sed", "-i", f"s/^colors: [*].*/colors: *{theme['alacritty_theme']}/", os.path.expanduser("~/.config/alacritty/alacritty.yml")]) qtile.cmd_spawn(["emacsclient", "--eval", f"(my-select-theme '{theme['emacs_theme']})"])