aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-07-16 20:26:36 +0200
committerAdrian Kummerlaender2019-07-16 20:26:36 +0200
commit3dad0c779f22fe2a134c8586460c3e8450fd7036 (patch)
tree53ee9f1274b0a941a3eb9ed7a2a0a8ab19a17b8b
parente437263098ffadb84ff61c64579809332a750ea2 (diff)
downloadnixos_home-3dad0c779f22fe2a134c8586460c3e8450fd7036.tar
nixos_home-3dad0c779f22fe2a134c8586460c3e8450fd7036.tar.gz
nixos_home-3dad0c779f22fe2a134c8586460c3e8450fd7036.tar.bz2
nixos_home-3dad0c779f22fe2a134c8586460c3e8450fd7036.tar.lz
nixos_home-3dad0c779f22fe2a134c8586460c3e8450fd7036.tar.xz
nixos_home-3dad0c779f22fe2a134c8586460c3e8450fd7036.tar.zst
nixos_home-3dad0c779f22fe2a134c8586460c3e8450fd7036.zip
Add basic qtile wm config
-rw-r--r--gui/conf/qtile.py133
-rw-r--r--gui/qtile.nix40
2 files changed, 173 insertions, 0 deletions
diff --git a/gui/conf/qtile.py b/gui/conf/qtile.py
new file mode 100644
index 0000000..d626d10
--- /dev/null
+++ b/gui/conf/qtile.py
@@ -0,0 +1,133 @@
+from libqtile.config import Key, Screen, Group, Drag, Click
+from libqtile.command import lazy
+from libqtile import layout, bar, widget
+
+from typing import List
+
+mod = "mod4"
+
+def hide_show_bar(qtile):
+ bar = qtile.currentScreen.top
+ if bar.is_show():
+ bar.show(is_show=False)
+ else:
+ bar.show(is_show=True)
+ qtile.currentGroup.layoutAll()
+
+keys = [
+ Key([mod], "k", lazy.layout.down()),
+ Key([mod], "j", lazy.layout.up()),
+
+ Key([mod, "shift"], "k", lazy.layout.shuffle_down()),
+ Key([mod, "shift"], "j", lazy.layout.shuffle_up()),
+
+ Key([mod], "l", lazy.layout.next()),
+ Key([mod], "h", lazy.layout.previous()),
+
+ Key([mod], "s", lazy.layout.toggle_split()),
+
+ Key([mod], "Return", lazy.spawn("kitty")),
+
+ Key([mod], "v", lazy.next_layout()),
+
+ Key([mod, "shift"], "q", lazy.window.kill()),
+
+ Key(["control", "mod1"], "Escape", lazy.shutdown()),
+ Key(["control", "mod1"], "BackSpace", lazy.restart()),
+
+ Key([mod], "space", lazy.spawn("rofi -show combi")),
+
+ Key([mod, "shift"], "b", lazy.function(hide_show_bar)),
+]
+
+groups = [Group(i) for i in "0123456789"]
+
+for i in groups:
+ keys.extend([
+ Key([mod], i.name, lazy.group[i.name].toscreen()),
+ Key([mod, "shift"], i.name, lazy.window.togroup(i.name)),
+ ])
+
+layouts = [
+ layout.Max(),
+ layout.Stack(
+ num_stacks=2,
+ border_focus="#909636",
+ border_normal="#161616",
+ border_width=5
+ ),
+ layout.Stack(
+ num_stacks=3,
+ border_focus="#909636",
+ border_normal="#161616",
+ border_width=5
+ ),
+]
+
+widget_defaults = dict(
+ font='Iosevka',
+ fontsize=22,
+ padding=3,
+)
+extension_defaults = widget_defaults.copy()
+
+screens = [
+ Screen(
+ top=bar.Bar(
+ [
+ widget.GroupBox(
+ foreground = '#161616',
+ active = '#161616',
+ inactive = '#161616',
+ disable_drag = True,
+ this_current_screen_border = '#161616',
+ ),
+ widget.WindowName(
+ foreground = '#161616',
+ ),
+ widget.Systray(
+ icon_size = 25,
+ ),
+ widget.Clock(
+ foreground = '#161616',
+ format = '%Y-%m-%d %R'
+ ),
+ ],
+ 38,
+ background = "#909636",
+ ),
+ ),
+]
+
+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()),
+ Click([mod], "Button2", lazy.window.bring_to_front())
+]
+
+dgroups_key_binder = None
+dgroups_app_rules = [] # type: List
+main = None
+follow_mouse_focus = True
+bring_front_click = False
+cursor_warp = True
+floating_layout = layout.Floating(float_rules=[
+ {'wmclass': 'confirm'},
+ {'wmclass': 'dialog'},
+ {'wmclass': 'download'},
+ {'wmclass': 'error'},
+ {'wmclass': 'file_progress'},
+ {'wmclass': 'notification'},
+ {'wmclass': 'splash'},
+ {'wmclass': 'toolbar'},
+ {'wmclass': 'confirmreset'}, # gitk
+ {'wmclass': 'makebranch'}, # gitk
+ {'wmclass': 'maketag'}, # gitk
+ {'wname': 'branchdialog'}, # gitk
+ {'wname': 'pinentry'}, # GPG key password entry
+ {'wmclass': 'ssh-askpass'}, # ssh-askpass
+])
+auto_fullscreen = True
+focus_on_window_activation = "smart"
diff --git a/gui/qtile.nix b/gui/qtile.nix
new file mode 100644
index 0000000..12aa042
--- /dev/null
+++ b/gui/qtile.nix
@@ -0,0 +1,40 @@
+{ config, pkgs, ... }:
+
+let
+ hidpi = config.custom.hidpi;
+
+in {
+ imports = [
+ ./gtk.nix
+ ./rofi.nix
+ ./twmn.nix
+ ];
+
+ xsession = {
+ enable = true;
+
+ pointerCursor = {
+ package = pkgs.vanilla-dmz;
+ name = "Vanilla-DMZ-AA";
+ size = if hidpi then 48 else 16;
+ };
+
+ windowManager.command = "qtile";
+ };
+
+ home.packages = with pkgs; [
+ # wm
+ qtile
+ # lockscreen
+ i3lock
+ ];
+
+ home.file.".config/qtile/config.py".source = ./conf/qtile.py;
+
+ services.screen-locker = {
+ enable = true;
+ lockCmd = "${pkgs.i3lock}/bin/i3lock -n -c 000000";
+ };
+
+ services.flameshot.enable = true;
+}