From adc39bd74d0a27b850b58ae46dffb4848899f31d Mon Sep 17 00:00:00 2001
From: Tobias Reisinger <tobias@msrg.cc>
Date: Sat, 1 Jul 2023 16:36:44 +0200
Subject: [PATCH] Improve hyprland and home-manger configs

---
 .config/home-manager/graphical.nix |  9 ----
 .config/home-manager/wayland.nix   |  4 +-
 .config/home-manager/x11.nix       | 16 ++++++
 .config/hypr/base.conf             |  1 +
 .config/hypr/binds.conf            | 81 ++++++++++++++----------------
 5 files changed, 58 insertions(+), 53 deletions(-)
 create mode 100644 .config/home-manager/x11.nix

diff --git a/.config/home-manager/graphical.nix b/.config/home-manager/graphical.nix
index d90ab22..b39225f 100644
--- a/.config/home-manager/graphical.nix
+++ b/.config/home-manager/graphical.nix
@@ -4,11 +4,8 @@
   # Packages that should be installed to the user profile.
   home.packages = with pkgs; [
     #alacritty # terminal emulator
-    bc # calculator (bsp-layout dependency)
     bemenu # tool to display menus
-    bsp-layout # automatic layouts for bpswm
     ckb-next # corsair hardware control
-    conky # shows stuff on the wallpaper
     dunst # notification-daemon
     feh # image viewer and wallpaper-tool
     flameshot # screenshot tool
@@ -17,19 +14,13 @@
     j4-dmenu-desktop # collects .desktop files for a menu
     keepassxc # password manager
     libsForQt5.kdeconnect-kde # tool to connect a phone to the computer
-    parcellite # clipboard-manager
     pavucontrol # Pulseaudio GUI
-    polybar # desktop bar
     #python310Packages.adblock # pylib for adblocking in qutebrowser
     #python310Packages.pynacl # pylib for qutebrowser-keepassxc support
     #(qutebrowser.override { enableWideVine = true; }) # vim-like browser
     solaar # Logitech tool
-    sxhkd # hotkey daemon
-    unclutter-xfixes # hides the cursor
     #vagrant # tool for automated virtual machines
     #virtualbox # tool for virtual machines
-    xclip # clipboard CLI for X
-    xcompmgr # compositor for X
     xfce.thunar # file manager
     xfce.tumbler # thumbnail tool
     xorg.xsetroot # tool to set x background stuff
diff --git a/.config/home-manager/wayland.nix b/.config/home-manager/wayland.nix
index dbda094..4f66224 100644
--- a/.config/home-manager/wayland.nix
+++ b/.config/home-manager/wayland.nix
@@ -3,7 +3,9 @@
 {
   # Packages that should be installed to the user profile.
   home.packages = with pkgs; [
+	cliphist # clipboard manager (history)
 	grim # needed for screenshots/flameshot
-	swww
+	swww # wallpaper daemon
+	wl-clipboard # clipboard manager (tools)
   ];
 }
diff --git a/.config/home-manager/x11.nix b/.config/home-manager/x11.nix
new file mode 100644
index 0000000..95aa205
--- /dev/null
+++ b/.config/home-manager/x11.nix
@@ -0,0 +1,16 @@
+{ config, pkgs, ... }:
+
+{
+  # Packages that should be installed to the user profile.
+  home.packages = with pkgs; [
+    bc # calculator (bsp-layout dependency)
+    bsp-layout # automatic layouts for bpswm
+    conky # shows stuff on the wallpaper
+    parcellite # clipboard-manager
+    polybar # desktop bar
+    sxhkd # hotkey daemon
+    unclutter-xfixes # hides the cursor
+    xclip # clipboard CLI for X
+    xcompmgr # compositor for X
+  ];
+}
diff --git a/.config/hypr/base.conf b/.config/hypr/base.conf
index e54fe89..6628b53 100644
--- a/.config/hypr/base.conf
+++ b/.config/hypr/base.conf
@@ -19,6 +19,7 @@ input {
     kb_model =
     kb_options =
     kb_rules =
+	numlock_by_default = true
 
     follow_mouse = 1
 	accel_profile = flat
diff --git a/.config/hypr/binds.conf b/.config/hypr/binds.conf
index 8879e9e..044e3bc 100644
--- a/.config/hypr/binds.conf
+++ b/.config/hypr/binds.conf
@@ -1,55 +1,50 @@
-$mainMod = SUPER
+$main_mod = SUPER
 
 # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
-bind = $mainMod, return, exec, $TERMINAL
-bind = $mainMod, Q, killactive,
-bind = $mainMod, M, exit,
-bind = $mainMod, E, exec, dolphin
-bind = $mainMod, V, togglefloating,
-bind = $mainMod, D, exec, j4-dmenu-desktop --dmenu="$DMENU"
-bind = $mainMod, P, pseudo, # dwindle
-bind = $mainMod, J, togglesplit, # dwindle
-bind = $mainMod, Pause, exec, menu-shutdown
+bind = $main_mod, return, exec, $TERMINAL
+bind = $main_mod, Q, killactive,
+bind = $main_mod, M, exit,
+bind = $main_mod, S, togglefloating,
+bind = $main_mod, D, exec, j4-dmenu-desktop --dmenu="$DMENU"
+bind = $main_mod, P, pseudo, # dwindle
+bind = $main_mod, J, togglesplit, # dwindle
+bind = $main_mod, Pause, exec, menu-shutdown
 
-bind = $mainMod SHIFT, R, exec, autostart-manage run-wayland
+bind = $main_mod SHIFT, R, exec, autostart-manage run-wayland
 
 # Move focus with mainMod + arrow keys
-bind = $mainMod, left, movefocus, l
-bind = $mainMod, right, movefocus, r
-bind = $mainMod, up, movefocus, u
-bind = $mainMod, down, movefocus, d
+bind = $main_mod, left, movefocus, l
+bind = $main_mod, right, movefocus, r
+bind = $main_mod, up, movefocus, u
+bind = $main_mod, down, movefocus, d
 
 # Switch workspaces with mainMod + [0-9]
-bind = $mainMod, 1, workspace, $ws01
-bind = $mainMod, 2, workspace, $ws02
-bind = $mainMod, 3, workspace, $ws03
-bind = $mainMod, 4, workspace, $ws04
-bind = $mainMod, 5, workspace, $ws05
-bind = $mainMod, 6, workspace, $ws06
-bind = $mainMod, 7, workspace, $ws07
-bind = $mainMod, 8, workspace, $ws08
-bind = $mainMod, 9, workspace, $ws09
-bind = $mainMod, 0, workspace, $ws10
+bind = $main_mod, 1, workspace, $ws01
+bind = $main_mod, 2, workspace, $ws02
+bind = $main_mod, 3, workspace, $ws03
+bind = $main_mod, 4, workspace, $ws04
+bind = $main_mod, 5, workspace, $ws05
+bind = $main_mod, 6, workspace, $ws06
+bind = $main_mod, 7, workspace, $ws07
+bind = $main_mod, 8, workspace, $ws08
+bind = $main_mod, 9, workspace, $ws09
+bind = $main_mod, 0, workspace, $ws10
 
 # Move active window to a workspace with mainMod + SHIFT + [0-9]
-bind = $mainMod SHIFT, 1, movetoworkspacesilent, $ws01
-bind = $mainMod SHIFT, 2, movetoworkspacesilent, $ws02
-bind = $mainMod SHIFT, 3, movetoworkspacesilent, $ws03
-bind = $mainMod SHIFT, 4, movetoworkspacesilent, $ws04
-bind = $mainMod SHIFT, 5, movetoworkspacesilent, $ws05
-bind = $mainMod SHIFT, 6, movetoworkspacesilent, $ws06
-bind = $mainMod SHIFT, 7, movetoworkspacesilent, $ws07
-bind = $mainMod SHIFT, 8, movetoworkspacesilent, $ws08
-bind = $mainMod SHIFT, 9, movetoworkspacesilent, $ws09
-bind = $mainMod SHIFT, 0, movetoworkspacesilent, $ws10
+bind = $main_mod SHIFT, 1, movetoworkspacesilent, $ws01
+bind = $main_mod SHIFT, 2, movetoworkspacesilent, $ws02
+bind = $main_mod SHIFT, 3, movetoworkspacesilent, $ws03
+bind = $main_mod SHIFT, 4, movetoworkspacesilent, $ws04
+bind = $main_mod SHIFT, 5, movetoworkspacesilent, $ws05
+bind = $main_mod SHIFT, 6, movetoworkspacesilent, $ws06
+bind = $main_mod SHIFT, 7, movetoworkspacesilent, $ws07
+bind = $main_mod SHIFT, 8, movetoworkspacesilent, $ws08
+bind = $main_mod SHIFT, 9, movetoworkspacesilent, $ws09
+bind = $main_mod SHIFT, 0, movetoworkspacesilent, $ws10
 
-bind = $mainMod, dead_circumflex, workspace, $ws_focus
-bind = $mainMod SHIFT, dead_circumflex, movetoworkspacesilent, $ws_focus
-
-# Scroll through existing workspaces with mainMod + scroll
-bind = $mainMod, mouse_down, workspace, e+1
-bind = $mainMod, mouse_up, workspace, e-1
+bind = $main_mod, dead_circumflex, workspace, $ws_focus
+bind = $main_mod SHIFT, dead_circumflex, movetoworkspacesilent, $ws_focus
 
 # Move/resize windows with mainMod + LMB/RMB and dragging
-bindm = $mainMod, mouse:272, movewindow
-bindm = $mainMod, mouse:273, resizewindow
+bindm = $main_mod, mouse:272, movewindow
+bindm = $main_mod, mouse:273, resizewindow