aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorAdrian Kummerlaender2021-11-01 13:19:29 +0100
committerAdrian Kummerlaender2021-11-01 13:19:29 +0100
commitfadcccd3bfd7b61aceed1b8ca034e5c849d00509 (patch)
treec674153fe8911b1f1ac825b516491a09fc7f391a /gui
parent312a22cf92fdda297b4f621745985e36cba060ce (diff)
downloadnixos_home-fadcccd3bfd7b61aceed1b8ca034e5c849d00509.tar
nixos_home-fadcccd3bfd7b61aceed1b8ca034e5c849d00509.tar.gz
nixos_home-fadcccd3bfd7b61aceed1b8ca034e5c849d00509.tar.bz2
nixos_home-fadcccd3bfd7b61aceed1b8ca034e5c849d00509.tar.lz
nixos_home-fadcccd3bfd7b61aceed1b8ca034e5c849d00509.tar.xz
nixos_home-fadcccd3bfd7b61aceed1b8ca034e5c849d00509.tar.zst
nixos_home-fadcccd3bfd7b61aceed1b8ca034e5c849d00509.zip
Play around with Qtile as an alternative to Xmonad
Diffstat (limited to 'gui')
-rw-r--r--gui/conf/qtile.py173
-rw-r--r--gui/qtile.nix14
-rw-r--r--gui/stalonetray.nix2
3 files changed, 97 insertions, 92 deletions
diff --git a/gui/conf/qtile.py b/gui/conf/qtile.py
index bfda21f..3b2927d 100644
--- a/gui/conf/qtile.py
+++ b/gui/conf/qtile.py
@@ -1,49 +1,60 @@
-from libqtile.config import Key, Screen, Group, Drag, Click, ScratchPad, DropDown
-from libqtile.command import lazy
-from libqtile import layout, bar, widget
-
from typing import List
-mod = "mod4"
+from libqtile import layout, widget, hook
+from libqtile.config import Click, Drag, Group, Key, Match, Screen, ScratchPad, DropDown, KeyChord
+from libqtile.lazy import lazy
-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()
+mod = "mod4"
keys = [
- Key([mod], "k", lazy.layout.down()),
- Key([mod], "j", lazy.layout.up()),
+ Key([mod], "j", lazy.layout.down()),
+ Key([mod], "k", lazy.layout.up()),
- Key([mod, "shift"], "k", lazy.layout.shuffle_down()),
- Key([mod, "shift"], "j", lazy.layout.shuffle_up()),
+ Key([mod, "shift"], "j", lazy.layout.shuffle_down()),
+ Key([mod, "shift"], "k", 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, "shift"], "Up", lazy.layout.grow_up()),
+ Key([mod, "shift"], "Down", lazy.layout.grow_down()),
+ Key([mod, "shift"], "Left", lazy.layout.grow_left()),
+ Key([mod, "shift"], "Right", lazy.layout.grow_right()),
+
Key([mod], "Return", lazy.spawn("kitty")),
- Key([mod, "shift"], "Return", lazy.spawn("nvim-qt --no-ext-tabline")),
+ Key([mod, "shift"], "Return", lazy.spawn("emacsclient --create-frame")),
- Key([mod], "v", lazy.next_layout()),
+ KeyChord([mod], "s", [
+ Key([], "s", lazy.layout.toggle_split()),
+ Key([], "j", 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)),
+ Key(["control", "mod1"], "l", lazy.spawn("i3lock -c 000000")),
+ Key([], "Print", lazy.spawn("flameshot gui")),
- Key([], "Menu", lazy.group['scratchpad'].dropdown_toggle('term'))
+ Key([mod], "space", lazy.spawn("rofi -show combi")),
+ Key([mod], "p", lazy.spawn("passrofi")),
+
+ Key([], "Menu", lazy.group['scratch'].dropdown_toggle('term')),
+ Key([mod], "b", lazy.group['scratch'].dropdown_toggle('browser')),
+ Key([mod], "m", lazy.group['scratch'].dropdown_toggle('telegram')),
+
+ KeyChord([mod], "c", [
+ Key([], "m", lazy.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")),
+ Key([], "Up", lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ +10%")),
+ Key([], "Down", lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ -10%")),
+ Key([], "s", lazy.spawn("systemctl suspend")),
+ Key([], "h", lazy.spawn("systemctl hibernate")),
+ ]),
]
-groups = [ Group(i) for i in "1234567890" ]
+groups = [Group(i) for i in "1234567890"]
for i in groups:
keys.extend([
@@ -51,58 +62,44 @@ for i in groups:
Key([mod, "shift"], i.name, lazy.window.togroup(i.name)),
])
-groups += [ScratchPad("scratchpad", [
- DropDown("term", "kitty")
-])]
-
-layouts = [
- layout.Max(),
- layout.Stack(
- num_stacks=2,
- border_focus="#909636",
- border_normal="#161616",
- border_width=4
- ),
- layout.Stack(
- num_stacks=3,
- border_focus="#909636",
- border_normal="#161616",
- border_width=4
- )
+scratchpad_defaults = {
+ "height": 0.8,
+ "width": 0.9,
+ "x": 0.05,
+ "y": 0.0,
+ "on_focus_lost_hide": False,
+}
+
+scratchpad_rhs = {
+ "height": 0.8,
+ "width": 0.3,
+ "x": 0.7,
+ "y": 0.1,
+ "on_focus_lost_hide": False,
+}
+
+groups += [
+ ScratchPad('scratch', [
+ DropDown("term", "kitty", **scratchpad_defaults),
+ DropDown("browser", "firefox", **scratchpad_defaults),
+ DropDown("telegram", "telegram-desktop", **scratchpad_rhs)
+ ]),
]
-widget_defaults = dict(
- font='Iosevka',
- fontsize=12,
- padding=2,
-)
-extension_defaults = widget_defaults.copy()
+border_default = {
+ "border_focus" : "#909636",
+ "border_normal": "#161616",
+ "border_width" : 2,
+}
-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.Clock(
- foreground = '#161616',
- format = '%Y-%m-%d %R'
- ),
- ],
- 24,
- background = "#909636",
- ),
- ),
+layouts = [
+ layout.Max(),
+ layout.MonadTall(**border_default),
+ layout.Stack(num_stacks=2, **border_default),
+ layout.Stack(num_stacks=3, **border_default),
]
+# Drag floating layouts.
mouse = [
Drag([mod], "Button1", lazy.window.set_position_floating(),
start=lazy.window.get_position()),
@@ -111,23 +108,27 @@ mouse = [
Click([mod], "Button2", lazy.window.bring_to_front())
]
+screens = [
+ Screen()
+]
+
+floating_layout = layout.Floating(
+ border_focus="#aadb0f",
+ border_normal="#161616",
+ border_width=4,
+ float_rules=[
+ *layout.Floating.default_float_rules,
+ Match(wm_class='ssh-askpass'), # ssh-askpass
+ Match(title='pinentry'), # GPG key password entry
+ ])
+
dgroups_key_binder = None
-dgroups_app_rules = [] # type: List
-main = None
+dgroups_app_rules = []
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'},
- {'wname': 'pinentry'},
- {'wmclass': 'ssh-askpass'},
-])
+cursor_warp = False
auto_fullscreen = True
focus_on_window_activation = "smart"
+reconfigure_screens = True
+
+wmname = "LG3D"
diff --git a/gui/qtile.nix b/gui/qtile.nix
index 12aa042..7f0d5a8 100644
--- a/gui/qtile.nix
+++ b/gui/qtile.nix
@@ -1,4 +1,4 @@
-{ config, pkgs, ... }:
+{ config, pkgs, pkgs-unstable, ... }:
let
hidpi = config.custom.hidpi;
@@ -19,14 +19,18 @@ in {
size = if hidpi then 48 else 16;
};
- windowManager.command = "qtile";
+ windowManager.command = "qtile start";
+
+ initExtra = ''
+ xsetroot -solid "#000000"
+ '';
};
- home.packages = with pkgs; [
+ home.packages = [
# wm
- qtile
+ pkgs-unstable.qtile
# lockscreen
- i3lock
+ pkgs.i3lock
];
home.file.".config/qtile/config.py".source = ./conf/qtile.py;
diff --git a/gui/stalonetray.nix b/gui/stalonetray.nix
index ca3baaf..d74ba1e 100644
--- a/gui/stalonetray.nix
+++ b/gui/stalonetray.nix
@@ -13,7 +13,7 @@
background = "#000000";
dockapp_mode = "none";
window_layer = "bottom";
- window_strut = "bottom";
+ window_strut = "none";
window_type = "dock";
};
};