qtile
This commit is contained in:
parent
7a1488860b
commit
b07d950147
27 changed files with 3330 additions and 169 deletions
|
@ -0,0 +1 @@
|
|||
/nix/store/dn5wzc9a8hrpml66i6kz5f3q6dr3jjmk-source
|
|
@ -0,0 +1 @@
|
|||
/nix/store/p58d2j0ac7zvja5jl14xzbc19fakjxh2-source
|
|
@ -0,0 +1 @@
|
|||
/nix/store/p7iz0r8gs6ppkhj83zjmwyd21k8b7v3y-source
|
|
@ -0,0 +1 @@
|
|||
/nix/store/xdms5kxx5gzkjfsfkaz3akvh0y8vqx1r-source
|
|
@ -0,0 +1 @@
|
|||
/nix/store/yj1wxm9hh8610iyzqnz75kvs6xl8j3my-source
|
|
@ -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
1
home/dots/qtile/.envrc
Normal file
|
@ -0,0 +1 @@
|
|||
use flake
|
12
home/dots/qtile/autostart.sh
Executable file
12
home/dots/qtile/autostart.sh
Executable 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
175
home/dots/qtile/config.py
Executable 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
78
home/dots/qtile/flake.lock
generated
Normal 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
29
home/dots/qtile/flake.nix
Normal 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
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
166
home/dots/river/init
Executable file
166
home/dots/river/init
Executable file
|
@ -0,0 +1,166 @@
|
|||
#!/bin/sh
|
||||
|
||||
# This is the example configuration file for river.
|
||||
#
|
||||
# If you wish to edit this, you will probably want to copy it to
|
||||
# $XDG_CONFIG_HOME/river/init or $HOME/.config/river/init first.
|
||||
#
|
||||
# See the river(1), riverctl(1), and kile(1) man pages for complete
|
||||
# documentation.
|
||||
|
||||
# Note: the "Super" modifier is also known as Logo, GUI, Windows, Mod4, etc.
|
||||
|
||||
# MY BINDS
|
||||
|
||||
riverctl map normal Super Return spawn kitty
|
||||
riverctl map normal Super D spawn fuzzel
|
||||
riverctl map normal Super E spawn thunar
|
||||
riverctl map normal Super F spawn firefox
|
||||
riverctl map normal Super+Shift E spawn wlogout
|
||||
riverctl map normal Super+Shift S spawn grim -g "$(slurp)" -t png -o ~/Pictures/$(date +%F_%H-%m-%S).png && notify-send "Screenshot taken."
|
||||
riverctl map normal Super+Shift+Ctrl S spawn kooha
|
||||
|
||||
# Super+Q to close the focused view
|
||||
riverctl map normal Super+Shift Q close
|
||||
|
||||
# Super+J and Super+K to focus the next/previous view in the layout stack
|
||||
riverctl map normal Super J focus-view next
|
||||
riverctl map normal Super K focus-view previous
|
||||
|
||||
# Super+Shift+J and Super+Shift+K to swap the focused view with the next/previous
|
||||
# view in the layout stack
|
||||
riverctl map normal Super+Shift J swap next
|
||||
riverctl map normal Super+Shift K swap previous
|
||||
|
||||
# Super+Period and Super+Comma to focus the next/previous output
|
||||
riverctl map normal Super Period focus-output next
|
||||
riverctl map normal Super Comma focus-output previous
|
||||
|
||||
# Super+Shift+{Period,Comma} to send the focused view to the next/previous output
|
||||
riverctl map normal Super+Shift Period send-to-output next
|
||||
riverctl map normal Super+Shift Comma send-to-output previous
|
||||
|
||||
# Super+Return to bump the focused view to the top of the layout stack
|
||||
riverctl map normal Super+Shift Return zoom
|
||||
|
||||
# Super+H and Super+L to decrease/increase the main ratio of kile(1)
|
||||
riverctl map normal Super H send-layout-cmd kile "main-ratio -0.05"
|
||||
riverctl map normal Super L send-layout-cmd kile "main-ratio +0.05"
|
||||
|
||||
# Super+Shift+H and Super+Shift+L to increment/decrement the main count of kile(1)
|
||||
riverctl map normal Super+Shift H send-layout-cmd kile "main-count +1"
|
||||
riverctl map normal Super+Shift L send-layout-cmd kile "main-count -1"
|
||||
|
||||
# Super+Alt+{H,J,K,L} to move views
|
||||
riverctl map normal Super+Alt H move left 100
|
||||
riverctl map normal Super+Alt J move down 100
|
||||
riverctl map normal Super+Alt K move up 100
|
||||
riverctl map normal Super+Alt L move right 100
|
||||
|
||||
# Super+Alt+Control+{H,J,K,L} to snap views to screen edges
|
||||
riverctl map normal Super+Alt+Control H snap left
|
||||
riverctl map normal Super+Alt+Control J snap down
|
||||
riverctl map normal Super+Alt+Control K snap up
|
||||
riverctl map normal Super+Alt+Control L snap right
|
||||
|
||||
# Super+Alt+Shift+{H,J,K,L} to resize views
|
||||
riverctl map normal Super+Alt+Shift H resize horizontal -100
|
||||
riverctl map normal Super+Alt+Shift J resize vertical 100
|
||||
riverctl map normal Super+Alt+Shift K resize vertical -100
|
||||
riverctl map normal Super+Alt+Shift L resize horizontal 100
|
||||
|
||||
# Super + Left Mouse Button to move views
|
||||
riverctl map-pointer normal Super BTN_LEFT move-view
|
||||
|
||||
# Super + Right Mouse Button to resize views
|
||||
riverctl map-pointer normal Super BTN_RIGHT resize-view
|
||||
|
||||
# Super + Middle Mouse Button to toggle float
|
||||
riverctl map-pointer normal Super BTN_MIDDLE toggle-float
|
||||
|
||||
for i in $(seq 1 9)
|
||||
do
|
||||
tags=$((1 << ($i - 1)))
|
||||
|
||||
# Super+[1-9] to focus tag [0-8]
|
||||
riverctl map normal Super $i set-focused-tags $tags
|
||||
|
||||
# Super+Shift+[1-9] to tag focused view with tag [0-8]
|
||||
riverctl map normal Super+Shift $i set-view-tags $tags
|
||||
|
||||
# Super+Control+[1-9] to toggle focus of tag [0-8]
|
||||
riverctl map normal Super+Control $i toggle-focused-tags $tags
|
||||
|
||||
# Super+Shift+Control+[1-9] to toggle tag [0-8] of focused view
|
||||
riverctl map normal Super+Shift+Control $i toggle-view-tags $tags
|
||||
done
|
||||
|
||||
# Super+0 to focus all tags
|
||||
# Super+Shift+0 to tag focused view with all tags
|
||||
all_tags=$(((1 << 32) - 1))
|
||||
riverctl map normal Super 0 set-focused-tags $all_tags
|
||||
riverctl map normal Super+Shift 0 set-view-tags $all_tags
|
||||
|
||||
# Super+Space to toggle float
|
||||
riverctl map normal Super Space toggle-float
|
||||
|
||||
# Super+F to toggle fullscreen
|
||||
riverctl map normal Super+Shift Space toggle-fullscreen
|
||||
|
||||
# Super+{Up,Right,Down,Left} to change layout orientation
|
||||
riverctl map normal Super Up send-layout-cmd kile "main-location top"
|
||||
riverctl map normal Super Right send-layout-cmd kile "main-location right"
|
||||
riverctl map normal Super Down send-layout-cmd kile "main-location bottom"
|
||||
riverctl map normal Super Left send-layout-cmd kile "main-location left"
|
||||
|
||||
# Declare a passthrough mode. This mode has only a single mapping to return to
|
||||
# normal mode. This makes it useful for testing a nested wayland compositor
|
||||
riverctl declare-mode passthrough
|
||||
|
||||
# Super+F11 to enter passthrough mode
|
||||
riverctl map normal Super F11 enter-mode passthrough
|
||||
|
||||
# Super+F11 to return to normal mode
|
||||
riverctl map passthrough Super F11 enter-mode normal
|
||||
|
||||
# Various media key mapping examples for both normal and locked mode which do
|
||||
# not have a modifier
|
||||
for mode in normal locked
|
||||
do
|
||||
# Eject the optical drive (well if you still have one that is)
|
||||
riverctl map $mode None XF86Eject spawn 'eject -T'
|
||||
|
||||
# Control pulse audio volume with pamixer (https://github.com/cdemoulins/pamixer)
|
||||
riverctl map $mode None XF86AudioRaiseVolume spawn 'swayosd --output-volume raise'
|
||||
riverctl map $mode None XF86AudioLowerVolume spawn 'swayosd --output-volume lower'
|
||||
riverctl map $mode None XF86AudioMute spawn 'swayosd --output-volume mute-toggle'
|
||||
|
||||
# Control MPRIS aware media players with playerctl (https://github.com/altdesktop/playerctl)
|
||||
riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause'
|
||||
riverctl map $mode None XF86AudioPlay spawn 'playerctl play-pause'
|
||||
riverctl map $mode None XF86AudioPrev spawn 'playerctl previous'
|
||||
riverctl map $mode None XF86AudioNext spawn 'playerctl next'
|
||||
|
||||
# Control screen backlight brightness with light (https://github.com/haikarainen/light)
|
||||
riverctl map $mode None XF86MonBrightnessUp spawn 'light -A 5'
|
||||
riverctl map $mode None XF86MonBrightnessDown spawn 'light -U 5'
|
||||
done
|
||||
|
||||
# Set background and border color
|
||||
riverctl background-color 0x#BGCOLOUR
|
||||
riverctl border-color-focused 0x#BORDERCOLOUR
|
||||
riverctl border-color-unfocused 0x#UNFOCUSEDCOLOUR
|
||||
|
||||
# Set keyboard repeat rate
|
||||
riverctl set-repeat 50 300
|
||||
|
||||
# Make all views with an app-id that starts with "float" and title "foo" start floating.
|
||||
# riverctl rule-add float -app-id 'float*' -title 'foo'
|
||||
|
||||
# Make all views with app-id "bar" and any title use client-side decorations
|
||||
# riverctl rule-add csd -app-id "bar"
|
||||
|
||||
# Set the default layout generator to be kile and start it.
|
||||
# River will send the process group of the init executable SIGTERM on exit.
|
||||
riverctl default-layout kile
|
||||
kile &
|
7
home/dots/river/layout.kl
Normal file
7
home/dots/river/layout.kl
Normal file
|
@ -0,0 +1,7 @@
|
|||
const ver Vertical
|
||||
const hor Horizontal
|
||||
|
||||
const vsplit (ver | hor ([1 - 0.5] *hsplit))
|
||||
const hsplit (hor | ver ([1 - 0.5] *vsplit))
|
||||
|
||||
const default vsplit
|
Loading…
Add table
Add a link
Reference in a new issue