This commit is contained in:
atagen 2023-09-28 12:07:54 +10:00
parent 7a1488860b
commit b07d950147
27 changed files with 3330 additions and 169 deletions

View file

@ -0,0 +1 @@
/nix/store/dn5wzc9a8hrpml66i6kz5f3q6dr3jjmk-source

View file

@ -0,0 +1 @@
/nix/store/p58d2j0ac7zvja5jl14xzbc19fakjxh2-source

View file

@ -0,0 +1 @@
/nix/store/p7iz0r8gs6ppkhj83zjmwyd21k8b7v3y-source

View file

@ -0,0 +1 @@
/nix/store/xdms5kxx5gzkjfsfkaz3akvh0y8vqx1r-source

View file

@ -0,0 +1 @@
/nix/store/yj1wxm9hh8610iyzqnz75kvs6xl8j3my-source

View file

@ -0,0 +1 @@
/nix/store/ipg70lcppm6g4xs075am8pgihccvg3sr-nix-shell-env

File diff suppressed because one or more lines are too long

1
home/dots/qtile/.envrc Normal file
View file

@ -0,0 +1 @@
use flake

12
home/dots/qtile/autostart.sh Executable file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
ckb-next -c -b &
mullvad connect &
xrdb -l ~/.Xresources &
# for later..
# gsettings set org.gnome.desktop.interface gtk-theme '${rice.gtk-theme.name}'";}
# gsettings set org.gnome.desktop.interface font-name '${rice.fonts.sans.name}'";}
# gsettings set org.gnome.desktop.interface icon-theme '${rice.icons.name}'";}
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL; systemctl --user start qtile-session.target

175
home/dots/qtile/config.py Executable file
View file

@ -0,0 +1,175 @@
#!/usr/bin/env python3
# import coconut.api
from __future__ import annotations
import importlib
import subprocess
import sys
import os
from typing import List
from libqtile import bar, hook, layout, qtile, utils, widget
from libqtile.backend import base
from libqtile.lazy import lazy
from libqtile.config import Key, Match, Screen, Click, Drag, Group, ScratchPad, DropDown
# import qtile_extras.widget as extra_widgets
assert qtile is not None
from typing import Any
from libqtile.core.manager import Qtile
from libqtile.backend.wayland import InputConfig
wl_input_rules = {
"type:keyboard": InputConfig(kb_options="caps:escape"),
"*": InputConfig(accel_profile="flat", pointer_accel="0.0"),
}
mod = "mod4"
class Apps:
term = "kitty"
launcher = "fuzzel"
browser = "firefox"
fm = "thunar"
logout = "wlogout"
noti = "swaync-client -t"
ss = '''grim -g "$(slurp)" -t png -o "~/Pictures/$(date +%F_%H-%m-%S).png" && notify-send "Screenshot taken."'''
passmgr = "keepassxc"
class OSD:
mute = "swayosd --output-volume mute-toggle"
vol_up = "swayosd --output-volume raise"
vol_down = "swayosd --output-volume lower"
next = "playerctl next"
prev = "playerctl prev"
stop = "playerctl stop"
play = "playerctl play-pause"
brightup = "swayosd --brightness raise"
brightdown = "swayosd --brightness lower"
keys = [
Key([mod], "Return", lazy.spawn(Apps.term)),
Key([mod], "d", lazy.spawn(Apps.launcher)),
Key([mod], "f", lazy.spawn(Apps.browser)),
Key([mod], "e", lazy.spawn(Apps.fm)),
Key([mod, "Shift"], "e", lazy.spawn(Apps.logout)),
Key([mod], "n", lazy.spawn(Apps.noti)),
Key([mod, "Shift"], "s", lazy.spawn(Apps.ss)),
Key([], "XF86AudioMute", lazy.spawn(OSD.mute)),
Key([], "XF86AudioRaiseVolume", lazy.spawn(OSD.vol_up)),
Key([], "XF86AudioLowerVolume", lazy.spawn(OSD.vol_down)),
Key([], "XF86AudioStop", lazy.spawn(OSD.stop)),
Key([], "XF86AudioPlay", lazy.spawn(OSD.play)),
Key([], "XF86AudioPrev", lazy.spawn(OSD.prev)),
Key([], "XF86AudioNext", lazy.spawn(OSD.next)),
Key([], "XF86MonBrightnessUp", lazy.spawn(OSD.brightup)),
Key([], "XF86MonBrightnessDown", lazy.spawn(OSD.brightdown)),
Key([mod, "shift"], "q", lazy.window.kill()),
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, "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, "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], "space", lazy.window.toggle_floating()),
Key([mod, "shift"], "space", lazy.window.toggle_fullscreen()),
Key([mod], "Tab", lazy.layout.next_layout()),
]
groups = [Group(i) for i in "123456"]
for i in groups:
keys.extend(
[
# mod1 + letter of group = switch to group
Key(
[mod],
i.name,
lazy.group[i.name].toscreen(),
desc="Switch to group {}".format(i.name),
),
# mod1 + shift + letter of group = move focused window to group
Key(
[mod, "shift"],
i.name,
lazy.window.togroup(i.name),
desc="move focused window to group {}".format(i.name),
),
]
)
groups.append(ScratchPad("scratch", [
DropDown("term", Apps.term, width=0.8, height=0.45, x=0.2, y=0.0),
DropDown("pass", Apps.passmgr, width=0.5, height=0.5, x=0.25, y=0.25),
]))
keys.extend([
Key([mod], 'grave', lazy.group['scratch'].dropdown_toggle('term')),
Key([mod], 'minus', lazy.group['scratch'].dropdown_toggle('pass')),
])
layouts = [
layout.Bsp(margin_on_single=0),
layout.Slice(fallback=layout.Bsp(), side="top", width=1280),
]
widget_defaults = dict(
font="Inria Sans",
fontsize=12,
)
mouse = [
Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()),
Drag([mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()),
]
screens = [
Screen(
top = bar.Bar(
[
widget.GroupBox(),
widget.WindowTabs(),
widget.CurrentLayout(),
# widget.Volume(),
# widget.Systray(),
widget.Clock()
# widget.Clock('%B %d %a %I:%M %p'),
],
16,
)
)
]
dgroups_key_binder = None
dgroups_app_rules: List[str] = []
follow_mouse_focus = True
bring_front_click = False
cursor_warp = True
focus_on_window_activation = "smart"
@hook.subscribe.startup
def autostart():
home = os.path.expanduser("~/.config/qtile/autostart.sh")
subprocess.Popen([home])

78
home/dots/qtile/flake.lock generated Normal file
View file

@ -0,0 +1,78 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1695559356,
"narHash": "sha256-kXZ1pUoImD9OEbPCwpTz4tHsNTr4CIyIfXb3ocuR8sI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "261abe8a44a7e8392598d038d2e01f7b33cf26d0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1695318763,
"narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e12483116b3b51a185a33a272bf351e357ba9a99",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable",
"utils": "utils"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

29
home/dots/qtile/flake.nix Normal file
View file

@ -0,0 +1,29 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, nixpkgs-unstable, utils, ... }:
utils.lib.eachDefaultSystem (system:
let
stable = import nixpkgs { inherit system; };
unstable = import nixpkgs-unstable { inherit system; };
in
{
devShell = with unstable; with unstable.python3Packages; mkShell {
buildInputs = [
python-lsp-server
mypy
pylsp-mypy
black
pydantic
coconut
stable.python3Packages.qtile-extras
stable.python3Packages.qtile
];
};
}
);
}